X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2Fviewport.cpp;h=0fe24085739db91a49385b635028497f2c358e6f;hb=HEAD;hp=cb446191ab8b0458769c21e0bd21916528af3fe4;hpb=d2f4c8720ae2326fac4203fa4984d835e875b355;p=blank.git diff --git a/src/graphics/viewport.cpp b/src/graphics/viewport.cpp index cb44619..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 @@ -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" + } } }