]> git.localhorst.tv Git - blank.git/commitdiff
allow disabling vsync to fail
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 23 Nov 2016 15:39:08 +0000 (16:39 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 23 Nov 2016 15:39:08 +0000 (16:39 +0100)
src/graphics/viewport.cpp

index a475f3e796f1d4c8d2b2af82987db711d368beb5..0fe24085739db91a49385b635028497f2c358e6f 100644 (file)
@@ -105,7 +105,12 @@ Viewport::Viewport()
 
 void Viewport::VSync(bool b) {
        if (SDL_GL_SetSwapInterval(b) != 0) {
-               throw SDLError("SDL_GL_SetSwapInterval");
+               if (b) {
+                       throw SDLError("SDL_GL_SetSwapInterval(1)");
+               } else {
+                       // allow failure, because this usually means there's no vsync
+                       // support at all, i.e. "it's off"
+               }
        }
 }