diff --git a/doc/changelog.dox b/doc/changelog.dox index 6aa5069bc..0893a1c7d 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -185,6 +185,9 @@ See also: @cpp #include  @ce, causing iOS builds to fail to initialize. The include got added back and initialization failures are reported with more information now. +- Calling @ref Platform::Sdl2Application::setSwapInterval() with @cpp 0 @ce + caused @ref Platform::Sdl2Application::setMinimalLoopPeriod() "setMinimalLoopPeriod()" + to be ignored even though Vsync was in fact not enabled. @subsection changelog-latest-deprecated Deprecated APIs diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index a629fec7e..fb8e9a865 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -719,7 +719,8 @@ bool Sdl2Application::setSwapInterval(const Int interval) { return false; } - _flags |= Flag::VSyncEnabled; + if(interval) _flags |= Flag::VSyncEnabled; + else _flags &= ~Flag::VSyncEnabled; return true; } diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index ee1149dce..46c19767c 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -822,7 +822,8 @@ class Sdl2Application { * * This setting reduces the main loop frequency in case VSync is * not/cannot be enabled or no drawing is done. Default is @cpp 0 @ce - * (i.e. looping at maximum frequency). + * (i.e. looping at maximum frequency). If the application is drawing + * on the screen and VSync is enabled, this setting is ignored. * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten", * the browser is managing the frequency instead. * @see @ref setSwapInterval()