Browse Source

Platform: properly fire Sdl2Application::viewportEvent() in all cases.

The event wasn't fired when the window size got changed through an API
call. Unfortunately after this change the event gets fired any time
I call setMaxWindowSize(), not just when the size changes.
pull/397/head
Vladimír Vondruš 7 years ago
parent
commit
322a57e88c
  1. 3
      doc/changelog.dox
  2. 5
      src/Magnum/Platform/Sdl2Application.cpp

3
doc/changelog.dox

@ -98,6 +98,9 @@ See also:
@subsection changelog-latest-bugfixes Bug fixes
- @ref Platform::Sdl2Application::viewportEvent() gets properly fired also
when window size changes programmatically (such as through
@ref Platform::Sdl2Application::setMinWindowSize() "setMinWindowSize()")
- The @ref Primitives::cylinderSolid() and @ref Primitives::coneSolid()
primitives were missing a face when both caps and texture coordinates were
enabled (see [mosra/magnum#386](https://github.com/mosra/magnum/issues/386))

5
src/Magnum/Platform/Sdl2Application.cpp

@ -755,7 +755,10 @@ bool Sdl2Application::mainLoopIteration() {
switch(event.type) {
case SDL_WINDOWEVENT:
switch(event.window.event) {
case SDL_WINDOWEVENT_RESIZED: {
/* Not using SDL_WINDOWEVENT_RESIZED, because that doens't
get fired when the window is resized programmatically
(such as through setMaxWindowSize()) */
case SDL_WINDOWEVENT_SIZE_CHANGED: {
#ifdef CORRADE_TARGET_EMSCRIPTEN
/* If anybody sees this assert, then emscripten finally
implemented resize events. Praise them for that.

Loading…
Cancel
Save