From a771b60af6ca1e5ade61d92357babdbcbb7a85bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Feb 2016 11:43:15 +0100 Subject: [PATCH] Platform: use zero window size on iOS and let SDL2 autodetect. Hopefully this feature won't go away in some future version. --- src/Magnum/Platform/Sdl2Application.cpp | 7 ++++++- src/Magnum/Platform/Sdl2Application.h | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 37310ad73..37e0c3b20 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -439,7 +439,12 @@ Sdl2Application::Configuration::Configuration(): #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) _title("Magnum SDL2 Application"), #endif - _size(800, 600), _windowFlags{}, _sampleCount(0) + #ifndef CORRADE_TARGET_IOS + _size{800, 600}, + #else + _size{}, /* SDL2 detects someting for us */ + #endif + _windowFlags{}, _sampleCount(0) #ifndef CORRADE_TARGET_EMSCRIPTEN , _version(Version::None), _sRGBCapable{false} #endif diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index fefecd3ae..690041b1c 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -653,7 +653,10 @@ class Sdl2Application::Configuration { * @brief Set window size * @return Reference to self (for method chaining) * - * Default is `{800, 600}`. + * Default is `{800, 600}`. On iOS it defaults to a "reasonable" size + * based on whether HiDPI support is enabled using + * @ref WindowFlag::AllowHighDpi, but not necessarily native display + * resolution (you have to set it explicitly). */ Configuration& setSize(const Vector2i& size) { _size = size;