From 80ba53dc3c21880fdcdc9fbecd5b9baec4bc6a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 22 Aug 2018 12:02:05 +0200 Subject: [PATCH] Platform: hide meaningless Sdl2Application window flags on Emscripten. --- doc/changelog.dox | 2 + src/Magnum/Platform/Sdl2Application.h | 56 +++++++++++++++++++++++---- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index e69531d1c..8d795c089 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -189,6 +189,8 @@ See also: - @ref Platform::BasicScreen::viewportEvent() "Platform::Screen::viewportEvent()" is no longer pure virtual to be consistent with all `*Application` implementations +- @ref Platform::Sdl2Application::Configuration::WindowFlags values that make + no sense on Emscripten are not available there anymore @subsubsection changelog-latest-changes-shaders Shaders library diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index d9c448857..8d72a6a1b 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -1164,10 +1164,21 @@ class Sdl2Application::Configuration { */ Resizable = SDL_WINDOW_RESIZABLE, - Fullscreen = SDL_WINDOW_FULLSCREEN, /**< Fullscreen window */ + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** + * Fullscreen window + * + * @note Not available on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ + Fullscreen = SDL_WINDOW_FULLSCREEN, - /** No window decoration. On iOS this hides the menu bar. */ + /** + * No window decoration. On iOS this hides the menu bar. + * + * @note Not available on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ Borderless = SDL_WINDOW_BORDERLESS, + #endif #ifdef MAGNUM_BUILD_DEPRECATED /** @@ -1180,10 +1191,35 @@ class Sdl2Application::Configuration { AllowHighDpi CORRADE_DEPRECATED_ENUM("has no effect, passed implicitly on platforms that need it") = 0, #endif - Hidden = SDL_WINDOW_HIDDEN, /**< Hidden window */ - Maximized = SDL_WINDOW_MAXIMIZED, /**< Maximized window */ - Minimized = SDL_WINDOW_MINIMIZED, /**< Minimized window */ - MouseLocked = SDL_WINDOW_INPUT_GRABBED, /**< Window with mouse locked */ + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** + * Hidden window + * + * @note Not available on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ + Hidden = SDL_WINDOW_HIDDEN, + + /** + * Maximized window + * + * @note Not available on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ + Maximized = SDL_WINDOW_MAXIMIZED, + + /** + * Minimized window + * + * @note Not available on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ + Minimized = SDL_WINDOW_MINIMIZED, + + /** + * Window with mouse locked + * + * @note Not available on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ + MouseLocked = SDL_WINDOW_INPUT_GRABBED, + #endif /** * Do not create any GPU context. Use together with @@ -1202,8 +1238,12 @@ class Sdl2Application::Configuration { */ #ifndef DOXYGEN_GENERATING_OUTPUT typedef Containers::EnumSet WindowFlags; + #ifndef CORRADE_TARGET_EMSCRIPTEN + SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS|SDL_WINDOW_HIDDEN| + SDL_WINDOW_MAXIMIZED|SDL_WINDOW_MINIMIZED|SDL_WINDOW_INPUT_GRABBED| + #endif + Uint32(WindowFlag::Contextless) + > WindowFlags; #else typedef Containers::EnumSet WindowFlags; #endif