diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index fa18c0b1b..cb28cf062 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -245,6 +245,9 @@ void OglSdlFinishUpdate(boolean waitvbl) { static boolean oldwaitvbl = false; int sdlw, sdlh; + + const boolean usefbo = UseScreenFBO(); + if (oldwaitvbl != waitvbl) { SDL_GL_SetSwapInterval(waitvbl ? 1 : 0); @@ -256,15 +259,19 @@ void OglSdlFinishUpdate(boolean waitvbl) HWR_MakeScreenFinalTexture(); #ifdef USE_FBO_OGL - if (UseScreenFBO()) + if (usefbo) + { GLFramebuffer_Unbind(); + } #endif HWR_DrawScreenFinalTexture(sdlw, sdlh, HWR_ShouldUsePaletteRendering()); #ifdef USE_FBO_OGL - if (UseScreenFBO()) + if (usefbo) + { GLFramebuffer_Enable(); + } #endif SDL_GL_SwapWindow(window);