From c657da8017ef48f42f3504810d68ff0addaac288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 22 Aug 2018 21:17:48 +0200 Subject: [PATCH] Platform: use our own APIs to get framebuffer size. --- src/Magnum/Platform/Sdl2Application.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index b7d397a7f..8beb97cf2 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -442,9 +442,10 @@ bool Sdl2Application::tryCreate(const Configuration& configuration, const GLConf in so all other code can assume that the viewport is set to sane values. Fortunately on iOS we also don't have to load any function pointers so it's safe to do the glViewport() call as it is linked statically. */ - Vector2i drawableSize; - SDL_GL_GetDrawableSize(_window, &drawableSize.x(), &drawableSize.y()); - glViewport(0, 0, drawableSize.x(), drawableSize.y()); + { + const Vector2i viewport = framebufferSize(); + glViewport(0, 0, viewport.x(), viewport.y()); + } #endif /* Emscripten-specific initialization */