From: Daniel Karbach Date: Wed, 23 Nov 2016 15:39:08 +0000 (+0100) Subject: allow disabling vsync to fail X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=f4729fcfcf6f4802dd2439aa23dc3a4faf39827d;p=blank.git allow disabling vsync to fail --- diff --git a/src/graphics/viewport.cpp b/src/graphics/viewport.cpp index a475f3e..0fe2408 100644 --- a/src/graphics/viewport.cpp +++ b/src/graphics/viewport.cpp @@ -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" + } } }