summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-21 01:59:00 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-21 01:59:00 +0300
commit769194a9741c085a61716e43d3e2944c9573ce65 (patch)
treefb2bcdf1adca371e53d28450502de45439c52f91 /src/graphicsmanager.cpp
parent05eaa7f08da97a2e6944ec64fbf0b32d0b835e24 (diff)
downloadManaVerse-769194a9741c085a61716e43d3e2944c9573ce65.tar.gz
ManaVerse-769194a9741c085a61716e43d3e2944c9573ce65.tar.bz2
ManaVerse-769194a9741c085a61716e43d3e2944c9573ce65.tar.xz
ManaVerse-769194a9741c085a61716e43d3e2944c9573ce65.zip
Add option for disable OpenGL version check and rollback to other renderer.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp69
1 files changed, 36 insertions, 33 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 51a0538f2..2c494a85a 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -532,49 +532,52 @@ void GraphicsManager::initGraphics()
detectPixelSize();
setVideoMode();
#ifdef USE_OPENGL
- const RenderType oldOpenGLMode = openGLMode;
- if (openGLMode == RENDER_MODERN_OPENGL)
+ if (config.getBoolValue("checkOpenGLVersion") == true)
{
- if (!mSupportModernOpengl || !checkGLVersion(3, 0))
+ const RenderType oldOpenGLMode = openGLMode;
+ if (openGLMode == RENDER_MODERN_OPENGL)
{
- logger->log("Fallback to normal OpenGL mode");
- openGLMode = RENDER_NORMAL_OPENGL;
+ if (!mSupportModernOpengl || !checkGLVersion(3, 0))
+ {
+ logger->log("Fallback to normal OpenGL mode");
+ openGLMode = RENDER_NORMAL_OPENGL;
+ }
}
- }
- if (openGLMode == RENDER_NORMAL_OPENGL)
- {
- if (!checkGLVersion(2, 0))
+ if (openGLMode == RENDER_NORMAL_OPENGL)
{
- logger->log("Fallback to safe OpenGL mode");
- openGLMode = RENDER_SAFE_OPENGL;
+ if (!checkGLVersion(2, 0))
+ {
+ logger->log("Fallback to safe OpenGL mode");
+ openGLMode = RENDER_SAFE_OPENGL;
+ }
}
- }
- if (openGLMode == RENDER_GLES_OPENGL)
- {
- if (!checkGLVersion(2, 0) && !checkGLesVersion(1, 0))
+ if (openGLMode == RENDER_GLES_OPENGL)
{
- logger->log("Fallback to safe OpenGL mode");
- openGLMode = RENDER_SAFE_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
- if (!checkGLVersion(2, 0))
+ if (openGLMode == RENDER_GLES2_OPENGL)
{
- logger->log("Fallback to software mode");
- openGLMode = RENDER_SOFTWARE;
+ // +++ here need check also not implimented gles flag
+ if (!checkGLVersion(2, 0))
+ {
+ logger->log("Fallback to software mode");
+ openGLMode = RENDER_SOFTWARE;
+ }
}
- }
- if (openGLMode != oldOpenGLMode)
- {
- deleteRenderers();
- settings.options.renderer = CAST_S32(openGLMode);
- config.setValue("opengl", settings.options.renderer);
- createRenderers();
- detectPixelSize();
- setVideoMode();
+ if (openGLMode != oldOpenGLMode)
+ {
+ deleteRenderers();
+ settings.options.renderer = CAST_S32(openGLMode);
+ config.setValue("opengl", settings.options.renderer);
+ createRenderers();
+ detectPixelSize();
+ setVideoMode();
+ }
}
#if !defined(ANDROID) && !defined(__APPLE__)
const std::string str = config.getStringValue("textureSize");