Browse Source

First-class WebGL support, part 11: no context flags.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
9f96ed4658
  1. 2
      src/Magnum/Context.cpp
  2. 16
      src/Magnum/Context.h

2
src/Magnum/Context.cpp

@ -588,6 +588,7 @@ void Context::resetState(const States states) {
#endif #endif
} }
#ifndef MAGNUM_TARGET_WEBGL
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
Debug operator<<(Debug debug, const Context::Flag value) { Debug operator<<(Debug debug, const Context::Flag value) {
switch(value) { switch(value) {
@ -602,5 +603,6 @@ Debug operator<<(Debug debug, const Context::Flag value) {
return debug << "Context::Flag::(invalid)"; return debug << "Context::Flag::(invalid)";
} }
#endif #endif
#endif
} }

16
src/Magnum/Context.h

@ -97,11 +97,13 @@ class MAGNUM_EXPORT Context {
friend Platform::Context; friend Platform::Context;
public: public:
#ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Context flag * @brief Context flag
* *
* @see @ref Flags, @ref flags(), * @see @ref Flags, @ref flags(),
* @ref Platform::Sdl2Application::Configuration::setFlags() "Platform::*Application::Configuration::setFlags()" * @ref Platform::Sdl2Application::Configuration::setFlags() "Platform::*Application::Configuration::setFlags()"
* @requires_gles Context flags are not available in WebGL.
*/ */
enum class Flag: GLint { enum class Flag: GLint {
/** /**
@ -139,8 +141,10 @@ class MAGNUM_EXPORT Context {
* @brief Context flags * @brief Context flags
* *
* @see @ref flags() * @see @ref flags()
* @requires_gles Context flags are not available in WebGL.
*/ */
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
#endif
/** /**
* @brief State to reset * @brief State to reset
@ -322,8 +326,14 @@ class MAGNUM_EXPORT Context {
*/ */
std::vector<std::string> extensionStrings() const; std::vector<std::string> 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; } Flags flags() const { return _flags; }
#endif
/** /**
* @brief Supported extensions * @brief Supported extensions
@ -482,7 +492,9 @@ class MAGNUM_EXPORT Context {
Version _version; Version _version;
Int _majorVersion; Int _majorVersion;
Int _minorVersion; Int _minorVersion;
#ifndef MAGNUM_TARGET_WEBGL
Flags _flags; Flags _flags;
#endif
std::array<Version, 160> _extensionRequiredVersion; std::array<Version, 160> _extensionRequiredVersion;
std::bitset<160> extensionStatus; std::bitset<160> extensionStatus;
@ -493,8 +505,10 @@ class MAGNUM_EXPORT Context {
std::optional<DetectedDrivers> _detectedDrivers; std::optional<DetectedDrivers> _detectedDrivers;
}; };
#ifndef MAGNUM_TARGET_WEBGL
/** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flag} */ /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flag} */
MAGNUM_EXPORT Debug operator<<(Debug debug, Context::Flag value); MAGNUM_EXPORT Debug operator<<(Debug debug, Context::Flag value);
#endif
/** @hideinitializer /** @hideinitializer
@brief Assert that given OpenGL version is supported @brief Assert that given OpenGL version is supported

Loading…
Cancel
Save