]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
vid_vsync: work around Wayland-specific init bug
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 12 Mar 2024 14:22:14 +0000 (00:22 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 12 Mar 2024 14:45:54 +0000 (00:45 +1000)
Fixes https://gitlab.com/xonotic/darkplaces/-/issues/413

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
vid_sdl.c

index 88ec122efb485eaabc925f6daa14e2f7db59461f..11868087460cb021753c97bc82a5f442ee2fc742 100644 (file)
--- 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");