added storing current video vsync mode after setting it
[rocksndiamonds.git] / 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)