View Full Version : Is it possible to change the stencil buffer bits in the application based on MFC?

02-18-2013, 09:38 PM
I maked OpenGL program by using MFC and in this program I used stencil buffer that the size is 8bit.
I want to raise the stencil buffer bit size to 16bit.
Is it possible?
I want to know whether it is possible to change the opengl stencil buffer bit size.
And how it does?


02-19-2013, 05:11 AM
The answer is "it depends".
It depends upon your hardware and drivers as to whether it supports 16-bit stencil buffers. Typically, AMD and nVidia only support 8-bit stencil buffers.
You select the number of stencil bits for your back buffer when you create the main window, you first query the device and then select the closest match (on Windows anyway) - via wglChoosePixelFormatARB

02-19-2013, 06:11 AM
Dear BionicBytes!
I'm appreciate for your help.

What's kind of device supports the 16-bit stencil buffer? Could you tell me about this?

Alfonse Reinheart
02-19-2013, 06:28 AM
I don't know of any that do. Certainly no consumer hardware supports greater-than-8-bits of stencil.