From ce0efd1aebd8638223222aa6fde3c702b3b911d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 9 Apr 2020 15:11:51 +0200 Subject: [PATCH] Platform: move a window creation asset to a better place in GlfwApp. So this gets checked even when the user is calling mainLoopIteration() directly. --- src/Magnum/Platform/GlfwApplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();