diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 2cc855a6c..863ef3bd2 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -720,14 +720,14 @@ void GlfwApplication::setSwapInterval(const Int interval) { void GlfwApplication::redraw() { _flags |= Flag::Redraw; } int GlfwApplication::exec() { - CORRADE_ASSERT(_window, "Platform::GlfwApplication::exec(): no window opened", {}); - while(mainLoopIteration()) {} return _exitCode; } bool GlfwApplication::mainLoopIteration() { + CORRADE_ASSERT(_window, "Platform::GlfwApplication::mainLoopIteration(): no window opened", {}); + if(_flags & Flag::Redraw) { _flags &= ~Flag::Redraw; drawEvent();