From: bones_was_here Date: Tue, 12 Mar 2024 14:22:14 +0000 (+1000) Subject: vid_vsync: work around Wayland-specific init bug X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=02cc3403ad217f5566a416771725b6aac97d4559;p=xonotic%2Fdarkplaces.git vid_vsync: work around Wayland-specific init bug Fixes https://gitlab.com/xonotic/darkplaces/-/issues/413 Signed-off-by: bones_was_here --- diff --git a/vid_sdl.c b/vid_sdl.c index 88ec122e..11868087 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1480,8 +1480,12 @@ static void VID_SetVsync_c(cvar_t *var) if (!context) return; +/* +Can't check first: on Wayland SDL_GL_GetSwapInterval() may initially return 0 when vsync is on. +On Xorg it returns the correct value. if (SDL_GL_GetSwapInterval() == vsyncwanted) return; +*/ if (SDL_GL_SetSwapInterval(vsyncwanted) >= 0) Con_DPrintf("Vsync %s\n", vsyncwanted ? "activated" : "deactivated");