added check if setting vsync mode to selected value was successful
authorHolger Schemel <info@artsoft.org>
Sat, 5 Sep 2020 23:54:33 +0000 (01:54 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 5 Sep 2020 23:54:33 +0000 (01:54 +0200)
src/screens.c

index 1808e9bcd4a6dbfe71083b9117e52ec82762ab3f..a4db11b24383cc085b334227442d1c8a202e5e95 100644 (file)
@@ -5332,8 +5332,23 @@ static void execSetupGraphics(void)
   // screen rendering mode may have changed at this point
   SDLSetScreenRenderingMode(setup.screen_rendering_mode);
 
+  int setup_vsync_mode = VSYNC_MODE_STR_TO_INT(setup.vsync_mode);
+  int video_vsync_mode = video.vsync_mode;
+
   // screen vsync mode may have changed at this point
   ChangeVsyncModeIfNeeded();
+
+  // check if setting vsync mode to selected value failed
+  if (setup_vsync_mode != video_vsync_mode &&
+      setup_vsync_mode != video.vsync_mode)
+  {
+    // changing vsync mode to selected value failed -- reset displayed value
+    execSetupGraphics_setVsyncModes(TRUE);
+
+    Request("Setting VSync failed!", REQ_CONFIRM);
+
+    DrawSetupScreen();
+  }
 }
 
 static void execSetupChooseWindowSize(void)