diff --git a/src/Platform/Sdl2Application.cpp b/src/Platform/Sdl2Application.cpp index 93635eab7..969b852dc 100644 --- a/src/Platform/Sdl2Application.cpp +++ b/src/Platform/Sdl2Application.cpp @@ -109,8 +109,8 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, configuration.sampleCount()); /* Flags: if not hidden, set as shown */ - Uint32 flags(configuration.flags()); - if(!(configuration.flags() & Configuration::Flag::Hidden)) flags |= SDL_WINDOW_SHOWN; + Uint32 windowFlags(configuration.windowFlags()); + if(!(configuration.windowFlags() & Configuration::WindowFlag::Hidden)) windowFlags |= SDL_WINDOW_SHOWN; /** @todo Remove when Emscripten has proper SDL2 support */ #ifndef CORRADE_TARGET_EMSCRIPTEN @@ -158,7 +158,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { if(!(window = SDL_CreateWindow(configuration.title().data(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, configuration.size().x(), configuration.size().y(), - SDL_WINDOW_OPENGL|flags))) + SDL_WINDOW_OPENGL|windowFlags))) { Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create window:" << SDL_GetError(); return false; @@ -328,7 +328,7 @@ Sdl2Application::Configuration::Configuration(): #ifndef CORRADE_TARGET_EMSCRIPTEN _title("Magnum SDL2 Application"), #endif - _size(800, 600), _flags(Flag::Resizable), _sampleCount(0), _version(Version::None) {} + _size(800, 600), _windowFlags(WindowFlag::Resizable), _sampleCount(0), _version(Version::None) {} Sdl2Application::Configuration::~Configuration() = default; diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index bb03214f0..253a63111 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -41,6 +41,10 @@ #include #include +#ifdef MAGNUM_BUILD_DEPRECATED +#include +#endif + namespace Magnum { class Context; @@ -370,9 +374,9 @@ class Sdl2Application::Configuration { /** * @brief Window flag * - * @see @ref Flags, @ref setFlags() + * @see @ref WindowFlags, @ref setWindowFlags() */ - enum class Flag: Uint32 { + enum class WindowFlag: Uint32 { Resizable = SDL_WINDOW_RESIZABLE, /**< Resizable window */ Fullscreen = SDL_WINDOW_FULLSCREEN, /**< Fullscreen window */ Hidden = SDL_WINDOW_HIDDEN, /**< Hidden window */ @@ -381,14 +385,30 @@ class Sdl2Application::Configuration { MouseLocked = SDL_WINDOW_INPUT_GRABBED /**< Window with mouse locked */ }; + #ifdef MAGNUM_BUILD_DEPRECATED + /** + * @copybrief WindowFlag + * @deprecated Use @ref Magnum::Platform::Sdl2Application::Configuration::WindowFlag "WindowFlag" instead. + */ + typedef CORRADE_DEPRECATED("use WindowFlag instead") WindowFlag Flag; + #endif + /** * @brief Window flags * * @see @ref setFlags() */ - typedef Containers::EnumSet Flags; + SDL_WINDOW_MINIMIZED|SDL_WINDOW_INPUT_GRABBED> WindowFlags; + + #ifdef MAGNUM_BUILD_DEPRECATED + /** + * @copybrief WindowFlags + * @deprecated Use @ref Magnum::Platform::Sdl2Application::Configuration::WindowFlags "WindowFlags" instead. + */ + typedef CORRADE_DEPRECATED("use WindowFlags instead") WindowFlags Flags; + #endif /*implicit*/ Configuration(); ~Configuration(); @@ -435,19 +455,39 @@ class Sdl2Application::Configuration { } /** @brief Window flags */ - Flags flags() const { return _flags; } + WindowFlags windowFlags() const { return _windowFlags; } + + #ifdef MAGNUM_BUILD_DEPRECATED + /** + * @copybrief windowFlags() + * @deprecated Use @ref Magnum::Platform::Sdl2Application::Configuration::windowFlags() "windowFlags()" instead. + */ + CORRADE_DEPRECATED("use windowFlags() instead") WindowFlags flags() const { + return windowFlags(); + } + #endif /** * @brief Set window flags * @return Reference to self (for method chaining) * - * Default is @ref Flag::Resizable. + * Default is @ref WindowFlag::Resizable. */ - Configuration& setFlags(const Flags flags) { - _flags = flags; + Configuration& setWindowFlags(WindowFlags flags) { + _windowFlags = flags; return *this; } + #ifdef MAGNUM_BUILD_DEPRECATED + /** + * @copybrief setWindowFlags() + * @deprecated Use @ref Magnum::Platform::Sdl2Application::Configuration::setWindowFlags "setWindowFlags()" instead. + */ + CORRADE_DEPRECATED("use setWindowFlags() instead") Configuration& setFlags(WindowFlags flags) { + return setWindowFlags(flags); + } + #endif + #ifndef CORRADE_TARGET_EMSCRIPTEN /** * @brief Context version @@ -496,12 +536,12 @@ class Sdl2Application::Configuration { std::string _title; #endif Vector2i _size; - Flags _flags; + WindowFlags _windowFlags; Int _sampleCount; Version _version; }; -CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::Flags) +CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::WindowFlags) /** @brief Base for input events