added check for OpenGL renderer when trying to change vsync mode
authorHolger Schemel <info@artsoft.org>
Sat, 5 Sep 2020 18:50:00 +0000 (20:50 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 5 Sep 2020 18:50:00 +0000 (20:50 +0200)
src/libgame/sdl.c

index d34feb4cd2b93af6c4319b210a13520313bf669a..407667452dbac5f8632587e9014d403159acd1f8 100644 (file)
@@ -877,6 +877,10 @@ void SDLSetScreenRenderingMode(char *screen_rendering_mode)
 
 void SDLSetScreenVsyncMode(char *vsync_mode)
 {
+  // changing vsync mode without re-creating renderer only supported by OpenGL
+  if (!strPrefixLower((char *)SDLGetRendererName(), "opengl"))
+    return;
+
   int interval = VSYNC_MODE_STR_TO_INT(vsync_mode);
   int result = SDL_GL_SetSwapInterval(interval);