From: Holger Schemel Date: Sat, 5 Sep 2020 18:50:00 +0000 (+0200) Subject: added check for OpenGL renderer when trying to change vsync mode X-Git-Tag: 4.2.0.2~8 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3eb5d3a10dc341e94a1290bbe1f9735e18e83e5f;p=rocksndiamonds.git added check for OpenGL renderer when trying to change vsync mode --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index d34feb4c..40766745 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -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);