From f4729fcfcf6f4802dd2439aa23dc3a4faf39827d Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Wed, 23 Nov 2016 16:39:08 +0100 Subject: [PATCH] allow disabling vsync to fail --- src/graphics/viewport.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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" + } } } -- 2.39.2