Fix #34997: when starting the game engine in one window and switching to a second

window, the game would stop drawing in the first and mess up the OpenGL state of
the second.

Also fixes glPushAttrib/glPopAttrib getting out of sync in some cases.
This commit is contained in:
2013-04-18 16:28:39 +00:00
parent fb2b3155f7
commit feeab1ad53
12 changed files with 44 additions and 34 deletions

View File

@@ -900,8 +900,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex)
void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex, int w, int h)
{
/* push attributes */
glPushAttrib(GL_ENABLE_BIT);
glPushAttrib(GL_VIEWPORT_BIT);
glPushAttrib(GL_ENABLE_BIT | GL_VIEWPORT_BIT);
glDisable(GL_SCISSOR_TEST);
/* bind framebuffer */
@@ -927,7 +926,6 @@ void GPU_framebuffer_texture_unbind(GPUFrameBuffer *UNUSED(fb), GPUTexture *UNUS
/* restore attributes */
glPopAttrib();
glPopAttrib();
glEnable(GL_SCISSOR_TEST);
}