From 11cc7e63b7ca14f9ed6bbd55662a7bb2520c8f14 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 20 Dec 2024 00:57:15 +0100 Subject: [PATCH] just query this once --- src/sdl/ogl_sdl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index a244b8f59..9f96f141e 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -260,6 +260,9 @@ void OglSdlFinishUpdate(boolean waitvbl) { static boolean oldwaitvbl = false; int sdlw, sdlh; + + const boolean usefbo = UseScreenFBO(); + if (oldwaitvbl != waitvbl) { if (waitvbl) @@ -279,18 +282,17 @@ void OglSdlFinishUpdate(boolean waitvbl) HWR_MakeScreenFinalTexture(); #ifdef USE_FBO_OGL - if (UseScreenFBO()) + if (usefbo) { GL_Framebuffer_Unbind(); - fbo_shader = HWR_UseShader() && !WipeInAction; // this looks awful with wipes + fbo_shader = (HWR_UseShader() && !WipeInAction); // this looks awful with wipes } #endif - //HWR_DrawScreenFinalTexture(sdlw, sdlh); GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, sdlw, sdlh, (HWR_ShouldUsePaletteRendering() || fbo_shader)); #ifdef USE_FBO_OGL - if (UseScreenFBO()) + if (usefbo) { GL_Framebuffer_Enable(); }