diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index a8b634f42..1316c3ecb 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1422,7 +1422,7 @@ void I_FinishUpdate(void) #ifdef HWRENDER if (rendermode == render_opengl) { - OglSdlFinishUpdate(cv_vidwait.value); + OglSdlFinishUpdate(); return; } #endif @@ -2209,17 +2209,17 @@ UINT32 I_GetRefreshRate(void) static void Impl_SetVsync(void) { -#if SDL_VERSION_ATLEAST(2,0,18) - if (renderer) - SDL_RenderSetVSync(renderer, cv_vidwait.value); -#endif #ifdef HWRENDER - if (!renderer && rendermode == render_opengl && - sdlglcontext != NULL && SDL_GL_GetCurrentContext() == sdlglcontext) + if (rendermode == render_opengl && + sdlglcontext != NULL && SDL_GL_GetCurrentContext() == sdlglcontext) { SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0); } #endif +#if SDL_VERSION_ATLEAST(2,0,18) + if (renderer) + SDL_RenderSetVSync(renderer, cv_vidwait.value); +#endif } void I_SetBorderlessWindow(void) diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index b63166639..f7bf2d8b2 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -246,22 +246,14 @@ boolean OglSdlSurface(INT32 w, INT32 h) \return void */ -void OglSdlFinishUpdate(boolean waitvbl) +void OglSdlFinishUpdate(void) { - static boolean oldwaitvbl = false; int sdlw, sdlh; #ifdef USE_FBO_OGL const boolean usefbo = UseScreenFBO(); #endif - if (oldwaitvbl != waitvbl) - { - SDL_GL_SetSwapInterval(waitvbl ? 1 : 0); - } - - oldwaitvbl = waitvbl; - SDL_GetWindowSize(window, &sdlw, &sdlh); HWR_MakeScreenFinalTexture(); diff --git a/src/sdl/ogl_sdl.h b/src/sdl/ogl_sdl.h index 6d614cd22..8dd2b9e0e 100644 --- a/src/sdl/ogl_sdl.h +++ b/src/sdl/ogl_sdl.h @@ -20,7 +20,7 @@ boolean OglSdlSurface(INT32 w, INT32 h); -void OglSdlFinishUpdate(boolean vidwait); +void OglSdlFinishUpdate(void); boolean VID_LoadOGLAPI(void); extern SDL_Renderer *renderer;