simplify opengl vsync set

This commit is contained in:
Alug committed 2025-12-26 23:20:39 +01:00
1 parent 25dd3b4976
commit 40bd3e5e19
3 files changed
+9 -17

No files matched your search

+7 -7
View File
@@ -1426,7 +1426,7 @@ void I_FinishUpdate(void)
#ifdef HWRENDER
if (rendermode == render_opengl)
{
OglSdlFinishUpdate(cv_vidwait.value);
OglSdlFinishUpdate();
return;
}
#endif
@@ -2028,17 +2028,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
@@ -241,22 +241,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;