Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.
glPushAttrib(GL_ALL_ATTRIB_BITS);
glBindTexture(GL_TEXTURE_2D, 0);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboId);
gl::drawFilled(mesh_);
//glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

glAssert();
glPopAttrib();
glAssert(); // <= crashes here

If I uncomment the line //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); it works, how come?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I would suppose the FBO manages some of its own state (there are some pushed/popped states whose values depend on the framebuffer binding) and it gets somehow messed up when you pop these and the framebuffer has suddenly changed. Maybe it's a driver fault where they didn't integrate the FBOs correctly with the rare case of intermediate state pushes/pops (which are quite old and deprecated anyway).

But don't use glPush/glPopAttrib anyway, it's quite slow, as you surely don't need to push every state. Don't do that just out of laziness.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.