From 45561c45f374cf8511b755da74c1786be6a3f85c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 19 Dec 2015 19:15:46 +0300 Subject: Fix OpenGL rederers in Android. --- src/graphicsmanager.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index e4949fbaf..d04588456 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -540,7 +540,7 @@ void GraphicsManager::initGraphics() openGLMode = RENDER_NORMAL_OPENGL; } } - if (openGLMode == RENDER_NORMAL_OPENGL || openGLMode == RENDER_GLES_OPENGL) + if (openGLMode == RENDER_NORMAL_OPENGL) { if (!checkGLVersion(2, 0)) { @@ -548,6 +548,14 @@ void GraphicsManager::initGraphics() openGLMode = RENDER_SAFE_OPENGL; } } + if (openGLMode == RENDER_GLES_OPENGL) + { + if (!checkGLVersion(2, 0) && !checkGLesVersion(1, 0)) + { + logger->log("Fallback to safe OpenGL mode"); + openGLMode = RENDER_SAFE_OPENGL; + } + } if (openGLMode == RENDER_GLES2_OPENGL) { // +++ here need check also not implimented gles flag @@ -858,6 +866,15 @@ void GraphicsManager::setGLVersion() cutFirst(version, "OpenGL ES "); sscanf(version.c_str(), "%5d.%5d", &mSLMajor, &mSLMinor); logger->log("Detected glsl version: %d.%d", mSLMajor, mSLMinor); +#ifdef ANDROID + if (!mMajor && !mMinor) + { + logger->log("Overriding detected OpenGL version on Android to 1.0"); + mGles = true; + mMajor = 1; + mMinor = 0; + } +#endif } void GraphicsManager::logVersion() const -- cgit v1.2.3-70-g09d2