PDA

View Full Version : Stencil Buffer Won't Enable



Clayton
08-11-2003, 08:27 AM
For whatever reason my stencil buffer won't enable. I call glEnable with GL_STENCIL_TEST and then do if glIsEnabled with GL_STENCIL_TEST != GL_TRUE then cout "asdf" and it always outputs "asdf" which would explain why none of the stencil buffer things I've been working with have been functional. Any reasons that this would happen?

Bob
08-11-2003, 08:44 AM
Check what glGetInteger and GL_STENCIL_BITS returns. If it returns 0, I bet you forgot to ask for a stencil buffer when creating the pixel format.

Clayton
08-11-2003, 08:58 AM
That seems to be the problem, However I'm using qgl, and I don't know how to request said bits in qgl. Does anyone?

Clayton
08-11-2003, 11:54 AM
I got it. For future reference to this question, under QGL there's a class called QGLFormat that must be messed with to create every buffer except for the double and depth buffers. Create a QGLFormat, set flags with the set___(bool) calls and then call QGLFormat::setDefault() with your QGLFormat as the variable.