Browse Source

Platform: ensure Sdl2Application has a window opened in the main loop.

Same is done in GlfwApplication, and not doing so makes no sense.
pull/434/head
Vladimír Vondruš 6 years ago
parent
commit
ad9b9f5a3d
  1. 6
      src/Magnum/Platform/Sdl2Application.cpp

6
src/Magnum/Platform/Sdl2Application.cpp

@ -812,6 +812,12 @@ void Sdl2Application::exit(const int exitCode) {
} }
bool Sdl2Application::mainLoopIteration() { 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 #ifndef CORRADE_TARGET_EMSCRIPTEN
const UnsignedInt timeBefore = _minimalLoopPeriod ? SDL_GetTicks() : 0; const UnsignedInt timeBefore = _minimalLoopPeriod ? SDL_GetTicks() : 0;
#endif #endif

Loading…
Cancel
Save