2
\$\begingroup\$
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?

\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .