Browse Source

Platform: deprecate Sdl2Application AllowHighDpi window flag.

It's now passed implicitly on platforms that need it.
pull/272/head
Vladimír Vondruš 8 years ago
parent
commit
56a933b17c
  1. 5
      doc/changelog.dox
  2. 6
      src/Magnum/Platform/Sdl2Application.cpp
  3. 15
      src/Magnum/Platform/Sdl2Application.h

5
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"

6
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;

15
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 */

Loading…
Cancel
Save