From ad9b9f5a3d8b3eb91a5f52292117737b82cfcd6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 9 Apr 2020 13:14:35 +0200 Subject: [PATCH] Platform: ensure Sdl2Application has a window opened in the main loop. Same is done in GlfwApplication, and not doing so makes no sense. --- src/Magnum/Platform/Sdl2Application.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 276c7ee55..fa65147de 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -812,6 +812,12 @@ void Sdl2Application::exit(const int exitCode) { } bool Sdl2Application::mainLoopIteration() { + #ifndef CORRADE_TARGET_EMSCRIPTEN + CORRADE_ASSERT(_window, "Platform::Sdl2Application::mainLoopIteration(): no window opened", {}); + #else + CORRADE_ASSERT(_surface, "Platform::Sdl2Application::mainLoopIteration(): no window opened", {}); + #endif + #ifndef CORRADE_TARGET_EMSCRIPTEN const UnsignedInt timeBefore = _minimalLoopPeriod ? SDL_GetTicks() : 0; #endif