X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2Fviewport.cpp;h=0fe24085739db91a49385b635028497f2c358e6f;hb=aee07b0f8d8c0d9af66dd7507938d83985d53833;hp=30b1c3c9d04c422dc8753a696790a4a00578819c;hpb=afc50302943e4000a8621c23960d63b208c8a400;p=blank.git diff --git a/src/graphics/viewport.cpp b/src/graphics/viewport.cpp index 30b1c3c..0fe2408 100644 --- a/src/graphics/viewport.cpp +++ b/src/graphics/viewport.cpp @@ -3,7 +3,7 @@ #include "SkyBox.hpp" #include "Viewport.hpp" -#include "../app/init.hpp" +#include "../app/error.hpp" #include "../geometry/const.hpp" #include @@ -103,9 +103,14 @@ Viewport::Viewport() glClearColor(0.0, 0.0, 0.0, 1.0); } -void Viewport::VSync(bool b) noexcept { +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" + } } }