From 56a933b17ce2dd5be20da6a3e08800caf46cef8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 21 Aug 2018 12:18:24 +0200 Subject: [PATCH] Platform: deprecate Sdl2Application AllowHighDpi window flag. It's now passed implicitly on platforms that need it. --- doc/changelog.dox | 5 ++++- src/Magnum/Platform/Sdl2Application.cpp | 6 +++--- src/Magnum/Platform/Sdl2Application.h | 15 +++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 564698968..e69531d1c 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -281,6 +281,9 @@ See also: because it doesn't provide all information needed for DPI-aware rendering. Override the @ref Platform::Sdl2Application::viewportEvent(ViewportEvent&) "viewportEvent(ViewportEvent&)" function instead. +- `Platform::Sdl2Application::Configuration::WindowFlags::AllowHighDpi` is + deprecated and has no effect as it is now passed implicitly on platforms + that need it - `Math::Geometry`, `Math::Geometry::Distance` and `Math::Geometry::Intersection` namespaces are deprecated for being too deeply nested, use @ref Math::Distance and @ref Math::Intersection instead @@ -1065,7 +1068,7 @@ a high-level overview. application) (see [mosra/magnum#105](https://github.com/mosra/magnum/issues/105)) - Added @ref Platform::Sdl2Application::GLConfiguration::setSRGBCapable() "Platform::Sdl2Application::Configuration::setSRGBCapable()" - Added @ref Platform::Sdl2Application::Configuration::WindowFlag::Borderless - and @ref Platform::Sdl2Application::Configuration::WindowFlag::AllowHighDpi + and `Platform::Sdl2Application::Configuration::WindowFlag::AllowHighDpi` for iOS and macOS - Added @ref Platform::WindowlessGlxApplication::Configuration::setFlags() "Platform::Windowless*Application::Configuration::setFlags()" with @ref Platform::WindowlessGlxApplication::Configuration::Flag::Debug "Flag::Debug" diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 52e6de855..fac826de3 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -241,7 +241,7 @@ bool Sdl2Application::tryCreate(const Configuration& configuration) { #endif SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, scaledWindowSize.x(), scaledWindowSize.y(), - Uint32(configuration.windowFlags()&~Configuration::WindowFlag::Contextless)))) + SDL_WINDOW_ALLOW_HIGHDPI|Uint32(configuration.windowFlags() & ~Configuration::WindowFlag::Contextless)))) { Error() << "Platform::Sdl2Application::tryCreate(): cannot create window:" << SDL_GetError(); return false; @@ -365,7 +365,7 @@ bool Sdl2Application::tryCreate(const Configuration& configuration, const GLConf #endif SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, scaledWindowSize.x(), scaledWindowSize.y(), - SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN|Uint32(configuration.windowFlags())))) + SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN|SDL_WINDOW_ALLOW_HIGHDPI|Uint32(configuration.windowFlags())))) { Error() << "Platform::Sdl2Application::tryCreate(): cannot create window:" << SDL_GetError(); return false; @@ -418,7 +418,7 @@ bool Sdl2Application::tryCreate(const Configuration& configuration, const GLConf if(!(_window = SDL_CreateWindow(configuration.title().data(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, scaledWindowSize.x(), scaledWindowSize.y(), - SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN|Uint32(configuration.windowFlags()&~Configuration::WindowFlag::Contextless)))) + SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN|SDL_WINDOW_ALLOW_HIGHDPI|Uint32(configuration.windowFlags()&~Configuration::WindowFlag::Contextless)))) { Error() << "Platform::Sdl2Application::tryCreate(): cannot create window:" << SDL_GetError(); return false; diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index db1c55033..d9c448857 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -235,8 +235,6 @@ options needs to be set via a `*.plist` file. Some options can be configured from runtime when creating the SDL2 application window, see documentation of a particular value for details: -- @ref Configuration::WindowFlag::AllowHighDpi allows creating HiDPI/Retina - drawable - @ref Configuration::WindowFlag::Borderless hides the menu bar - @ref Configuration::WindowFlag::Resizable makes the application respond to device orientation changes @@ -1171,14 +1169,15 @@ class Sdl2Application::Configuration { /** No window decoration. On iOS this hides the menu bar. */ Borderless = SDL_WINDOW_BORDERLESS, - #ifndef CORRADE_TARGET_EMSCRIPTEN + #ifdef MAGNUM_BUILD_DEPRECATED /** - * Allow high DPI. On iOS you also have to set the - * `NSHighResolutionCapable` entry in the `*.plist` file to make - * it working. - * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + * Allow high DPI. + * + * @deprecated Has no effect, as this flag is passed implicitly + * on platforms where needed. See + * @ref Platform-Sdl2Application-dpi for more information. */ - AllowHighDpi = SDL_WINDOW_ALLOW_HIGHDPI, + AllowHighDpi CORRADE_DEPRECATED_ENUM("has no effect, passed implicitly on platforms that need it") = 0, #endif Hidden = SDL_WINDOW_HIDDEN, /**< Hidden window */