Browse Source

First-class WebGL support, part 13: reduce version enum.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
61d9697f00
  1. 4
      src/Magnum/Context.cpp
  2. 2
      src/Magnum/Platform/magnum-info.cpp
  3. 3
      src/Magnum/Version.cpp
  4. 6
      src/Magnum/Version.h

4
src/Magnum/Context.cpp

@ -323,8 +323,10 @@ const std::vector<Extension>& Extension::extensions(Version version) {
#else
return empty;
#endif
#ifndef MAGNUM_TARGET_WEBGL
case Version::GLES310: return empty;
#endif
#endif
}
CORRADE_ASSERT_UNREACHABLE();
@ -435,8 +437,10 @@ Context::Context(void functionLoader()) {
#else
Version::GLES200,
Version::GLES300,
#ifndef MAGNUM_TARGET_WEBGL
Version::GLES310,
#endif
#endif
Version::None
};

2
src/Magnum/Platform/magnum-info.cpp

@ -261,8 +261,10 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
Version::GL450,
#else
Version::GLES300,
#ifndef MAGNUM_TARGET_WEBGL
Version::GLES310,
#endif
#endif
Version::None
};
std::size_t future = 0;

3
src/Magnum/Version.cpp

@ -46,6 +46,9 @@ Debug operator<<(Debug debug, Version value) {
_c(GL430, "OpenGL 4.3")
_c(GL440, "OpenGL 4.4")
_c(GL450, "OpenGL 4.5")
#elif defined(MAGNUM_TARGET_WEBGL)
_c(GLES200, "WebGL 1.0")
_c(GLES300, "WebGL 2.0")
#else
_c(GLES200, "OpenGL ES 2.0")
_c(GLES300, "OpenGL ES 3.0")

6
src/Magnum/Version.h

@ -58,7 +58,7 @@ enum class Version: Int {
#endif
/**
* @brief OpenGL ES 2.0, GLSL ES 1.00
* @brief OpenGL ES 2.0 or WebGL 1.0, GLSL ES 1.00
*
* All the functionality is present in OpenGL 4.2 (extension
* @extension{ARB,ES2_compatibility}), so on desktop OpenGL this is
@ -71,7 +71,7 @@ enum class Version: Int {
#endif
/**
* @brief OpenGL ES 3.0, GLSL ES 3.00
* @brief OpenGL ES 3.0 or WebGL 2.0, GLSL ES 3.00
*
* All the functionality is present in OpenGL 4.3 (extension
* @extension{ARB,ES3_compatibility}), so on desktop OpenGL this is the
@ -83,6 +83,7 @@ enum class Version: Int {
GLES300 = 300,
#endif
#ifndef MAGNUM_TARGET_WEBGL
/**
* @brief OpenGL ES 3.1, GLSL ES 3.10
*
@ -95,6 +96,7 @@ enum class Version: Int {
#else
GLES310 = 310
#endif
#endif
};
/** @brief Enum value from major and minor version number */

Loading…
Cancel
Save