summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-19 00:30:56 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-19 00:30:56 +0300
commit6df4fbf165fdc4259c55e8b4d78de2294d6bb059 (patch)
tree02ccbf8421483768b0cd3cc7ab0f9a14989ccb7a
parent3774c37754485ff0ee6f0d9b7573505ba035ab65 (diff)
downloadmanaplus-6df4fbf165fdc4259c55e8b4d78de2294d6bb059.tar.gz
manaplus-6df4fbf165fdc4259c55e8b4d78de2294d6bb059.tar.bz2
manaplus-6df4fbf165fdc4259c55e8b4d78de2294d6bb059.tar.xz
manaplus-6df4fbf165fdc4259c55e8b4d78de2294d6bb059.zip
Check if all OpenGL extensions supported for modernopengl.
If not fallback to normalopengl.
-rw-r--r--src/graphicsmanager.cpp10
-rw-r--r--src/graphicsmanager.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 189a3b3c8..8df17721e 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -141,6 +141,7 @@ GraphicsManager::GraphicsManager() :
mUseTextureSampler(true),
mTextureSampler(0),
mSupportDebug(0),
+ mSupportModernOpengl(false),
#endif
mUseAtlases(false)
{
@@ -468,7 +469,7 @@ void GraphicsManager::initGraphics()
const RenderType oldOpenGLMode = openGLMode;
if (openGLMode == RENDER_MODERN_OPENGL)
{
- if (!checkGLVersion(3, 0))
+ if (!mSupportModernOpengl || !checkGLVersion(3, 0))
{
logger->log("Fallback to normal OpenGL mode");
openGLMode = RENDER_NORMAL_OPENGL;
@@ -835,6 +836,7 @@ void GraphicsManager::initOpenGLFunctions()
const bool is20 = checkGLVersion(2, 0);
const bool is21 = checkGLVersion(2, 1);
const bool is30 = checkGLVersion(3, 0);
+ mSupportModernOpengl = true;
// Texture sampler
if (is10 && supportExtension("GL_ARB_sampler_objects"))
@@ -979,6 +981,7 @@ void GraphicsManager::initOpenGLFunctions()
}
else
{
+ mSupportModernOpengl = false;
logger->log1("GL_ARB_vertex_array_object not found");
}
if (is15)
@@ -991,6 +994,7 @@ void GraphicsManager::initOpenGLFunctions()
}
else
{
+ mSupportModernOpengl = false;
logger->log1("buffers extension not found");
}
if (is20)
@@ -1022,6 +1026,7 @@ void GraphicsManager::initOpenGLFunctions()
}
else
{
+ mSupportModernOpengl = false;
logger->log1("shaders functions incomplete (OpenGL < 3.0)");
}
if (supportExtension("GL_ARB_separate_shader_objects"))
@@ -1034,6 +1039,7 @@ void GraphicsManager::initOpenGLFunctions()
}
else
{
+ mSupportModernOpengl = false;
logger->log1("GL_ARB_separate_shader_objects not supported");
}
if (supportExtension("GL_ARB_separate_shader_objects"))
@@ -1058,6 +1064,7 @@ void GraphicsManager::initOpenGLFunctions()
}
else
{
+ mSupportModernOpengl = false;
logger->log1("GL_ARB_vertex_attrib_binding not supported");
}
if (supportExtension("GL_ARB_invalidate_subdata"))
@@ -1081,6 +1088,7 @@ void GraphicsManager::initOpenGLFunctions()
}
else
{
+ mSupportModernOpengl = false;
logger->log1("shaders not supported");
}
diff --git a/src/graphicsmanager.h b/src/graphicsmanager.h
index a0af8c41b..d71fdc8a0 100644
--- a/src/graphicsmanager.h
+++ b/src/graphicsmanager.h
@@ -213,6 +213,8 @@ class GraphicsManager final
GLuint mTextureSampler;
int mSupportDebug;
+
+ bool mSupportModernOpengl;
#endif
bool mUseAtlases;
};