PDA

View Full Version : Querying size of stencil buffer in Core 3.x



thekend
01-21-2010, 02:46 AM
In GL 3.x, glGetIntegerv with GL_STENCIL_BITS is deprecated.
For querying frame buffer parameters there is glGetFramebufferAttachmentParameteriv.
According to the spec this should work for the default framebuffer:



int stencilBits;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFF ER, GL_STENCIL, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, &stencilBits);


However, a GL_INVALID_ENUM is returned.
What's wrong with that?