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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user