From d2245fbf4b1bf52125ad6324df26a9426b29fc77 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 4 Sep 2020 01:48:46 +0200 Subject: [PATCH] added storing current video vsync mode after setting it --- src/libgame/sdl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index e561b177..ab914a4e 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -876,7 +876,16 @@ void SDLSetScreenVsyncMode(char *vsync_mode) // if adaptive vsync requested, but not supported, retry with normal vsync if (result == -1 && interval == VSYNC_MODE_ADAPTIVE) - SDL_GL_SetSwapInterval(VSYNC_MODE_NORMAL); + { + interval = VSYNC_MODE_NORMAL; + + result = SDL_GL_SetSwapInterval(interval); + } + + if (result == -1) + interval = VSYNC_MODE_OFF; + + video.vsync_mode = interval; } void SDLRedrawWindow(void) -- 2.34.1