added storing current video vsync mode after setting it
authorHolger Schemel <info@artsoft.org>
Thu, 3 Sep 2020 23:48:46 +0000 (01:48 +0200)
committerHolger Schemel <info@artsoft.org>
Thu, 3 Sep 2020 23:52:24 +0000 (01:52 +0200)
src/libgame/sdl.c

index e561b177579961dea8066def3053a9cd2f284368..ab914a4e17c71778fb10b56c050c58f345b48133 100644 (file)
@@ -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)