From e0796b0cf1278ca20fc46f5ac3baaad51004e5bf Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 20 Dec 2024 00:59:18 +0100 Subject: [PATCH] just query this once --- src/sdl/ogl_sdl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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);