From b5017752a3646bb0baac9e8ef0d8fe4ffd8e4e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 15 Mar 2014 15:06:18 +0100 Subject: [PATCH] Platform: fix Emscripten build. --- src/Magnum/Platform/Sdl2Application.cpp | 2 ++ src/Magnum/Platform/Sdl2Application.h | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 0a2c86728..14cd04f21 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -109,8 +109,10 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, configuration.sampleCount() > 1 ? 1 : 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, configuration.sampleCount()); + #ifndef CORRADE_TARGET_EMSCRIPTEN /* Context flags */ SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, int(configuration.flags())); + #endif /* Flags: if not hidden, set as shown */ Uint32 windowFlags(configuration.windowFlags()); diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 222e0e1f0..caab3163a 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -423,10 +423,13 @@ depth buffer. */ class Sdl2Application::Configuration { public: + #ifndef CORRADE_TARGET_EMSCRIPTEN /** * @brief Context flag * + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". * @see @ref Flags @ref setFlags() + * @todo re-enable when Emscripten has proper SDL2 support */ enum class Flag: int { Debug = SDL_GL_CONTEXT_DEBUG_FLAG, /**< Create debug context */ @@ -438,6 +441,7 @@ class Sdl2Application::Configuration { /** * @brief Context flags * + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". * @see @ref setFlags() */ #ifndef DOXYGEN_GENERATING_OUTPUT @@ -446,6 +450,7 @@ class Sdl2Application::Configuration { #else typedef Containers::EnumSet Flags; #endif + #endif /** * @brief Window flag @@ -532,7 +537,12 @@ class Sdl2Application::Configuration { return *this; } - /** @brief Context flags */ + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** + * @brief Context flags + * + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ Flags flags() const { return _flags; } /** @@ -540,13 +550,13 @@ class Sdl2Application::Configuration { * @return Reference to self (for method chaining) * * Default is no flag. + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". */ Configuration& setFlags(Flags flags) { _flags = flags; return *this; } - #ifndef CORRADE_TARGET_EMSCRIPTEN /** * @brief Context version * @@ -598,11 +608,13 @@ class Sdl2Application::Configuration { Int _sampleCount; #ifndef CORRADE_TARGET_EMSCRIPTEN Version _version; - #endif Flags _flags; + #endif }; +#ifndef CORRADE_TARGET_EMSCRIPTEN CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::Flags) +#endif CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::WindowFlags) /**