From 072710bb8a7717c8454f8374f1566e151579364d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 27 Apr 2014 16:21:30 +0200 Subject: [PATCH] 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). --- src/Magnum/Context.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 8f67e33be..58c3c5cb2 100644 --- a/src/Magnum/Context.cpp +++ b/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