From 9f96ed4658ef09a8adde1bc82008a703c3210d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 May 2015 00:00:05 +0200 Subject: [PATCH] First-class WebGL support, part 11: no context flags. --- src/Magnum/Context.cpp | 2 ++ src/Magnum/Context.h | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index d773c2670..ae866d25d 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -588,6 +588,7 @@ void Context::resetState(const States states) { #endif } +#ifndef MAGNUM_TARGET_WEBGL #ifndef DOXYGEN_GENERATING_OUTPUT Debug operator<<(Debug debug, const Context::Flag value) { switch(value) { @@ -602,5 +603,6 @@ Debug operator<<(Debug debug, const Context::Flag value) { return debug << "Context::Flag::(invalid)"; } #endif +#endif } diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 63c280ac7..424e1e2d1 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -97,11 +97,13 @@ class MAGNUM_EXPORT Context { friend Platform::Context; public: + #ifndef MAGNUM_TARGET_WEBGL /** * @brief Context flag * * @see @ref Flags, @ref flags(), * @ref Platform::Sdl2Application::Configuration::setFlags() "Platform::*Application::Configuration::setFlags()" + * @requires_gles Context flags are not available in WebGL. */ enum class Flag: GLint { /** @@ -139,8 +141,10 @@ class MAGNUM_EXPORT Context { * @brief Context flags * * @see @ref flags() + * @requires_gles Context flags are not available in WebGL. */ typedef Containers::EnumSet Flags; + #endif /** * @brief State to reset @@ -322,8 +326,14 @@ class MAGNUM_EXPORT Context { */ std::vector extensionStrings() const; - /** @brief Context flags */ + #ifndef MAGNUM_TARGET_WEBGL + /** + * @brief Context flags + * + * @requires_gles Context flags are not available in WebGL. + */ Flags flags() const { return _flags; } + #endif /** * @brief Supported extensions @@ -482,7 +492,9 @@ class MAGNUM_EXPORT Context { Version _version; Int _majorVersion; Int _minorVersion; + #ifndef MAGNUM_TARGET_WEBGL Flags _flags; + #endif std::array _extensionRequiredVersion; std::bitset<160> extensionStatus; @@ -493,8 +505,10 @@ class MAGNUM_EXPORT Context { std::optional _detectedDrivers; }; +#ifndef MAGNUM_TARGET_WEBGL /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flag} */ MAGNUM_EXPORT Debug operator<<(Debug debug, Context::Flag value); +#endif /** @hideinitializer @brief Assert that given OpenGL version is supported