simplify opengl vsync set

This commit is contained in:
Alug committed 2025-12-26 23:18:34 +01:00
1 parent ce1c3ced90
commit dfb4ef2e16
3 files changed
+9 -17

No files matched your search

+7 -7
View File
@@ -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)
+1 -9
View File
@@ -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();
+1 -1
View File
@@ -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;