Browse Source

Be less strict in OpenGL ES context version.

I didn't yet have time to add more complete support for ES 3.1, but the
engine should at least work on it. If the driver reports ES 3.0 or 3.1
it is taken as valid value in both ES2 and ES3 builds (i.e. the engine
can work in ES2 mode also on ES3 driver).
pull/54/head
Vladimír Vondruš 12 years ago
parent
commit
072710bb8a
  1. 6
      src/Magnum/Context.cpp

6
src/Magnum/Context.cpp

@ -316,13 +316,15 @@ Context::Context() {
"Context: cannot retrieve OpenGL version:" << versionNumberError, );
#endif
/* Allow ES2 context on driver that reports ES3 as supported */
const std::string version = versionString();
#ifndef MAGNUM_TARGET_GLES
if(version.compare(0, 4, "2.1 ") == 0)
#elif defined(MAGNUM_TARGET_WEBGL)
if(version.find("WebGL 1") != std::string::npos)
#else
if(version.find("OpenGL ES 2.0") != std::string::npos)
if(version.find("OpenGL ES 2.0") != std::string::npos ||
version.find("OpenGL ES 3.") != std::string::npos)
#endif
{
_majorVersion = 2;
@ -354,7 +356,7 @@ Context::Context() {
#elif defined(MAGNUM_TARGET_GLES2)
if(_version != Version::GLES200)
#else
if(_version != Version::GLES300)
if(!isVersionSupported(Version::GLES300))
#endif
{
#ifndef MAGNUM_TARGET_GLES

Loading…
Cancel
Save