summaryrefslogtreecommitdiff
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
parent05eaa7f08da97a2e6944ec64fbf0b32d0b835e24 (diff)
downloadmv-769194a9741c085a61716e43d3e2944c9573ce65.tar.gz
mv-769194a9741c085a61716e43d3e2944c9573ce65.tar.bz2
mv-769194a9741c085a61716e43d3e2944c9573ce65.tar.xz
mv-769194a9741c085a61716e43d3e2944c9573ce65.zip
Add option for disable OpenGL version check and rollback to other renderer.
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/graphicsmanager.cpp69
-rw-r--r--src/gui/widgets/tabs/setup_other.cpp5
3 files changed, 42 insertions, 33 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index f8005b29c..f4c7763f1 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -385,6 +385,7 @@ DefaultsData* getConfigDefaults()
AddDEF("enableGuiOpacity", true);
AddDEF("enableTradeFilter", true);
AddDEF("enableIdCollecting", false);
+ AddDEF("checkOpenGLVersion", true);
return configData;
}
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");
diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp
index 8d9ab24f4..6b9137dad 100644
--- a/src/gui/widgets/tabs/setup_other.cpp
+++ b/src/gui/widgets/tabs/setup_other.cpp
@@ -374,6 +374,11 @@ Setup_Other::Setup_Other(const Widget2 *const widget) :
MainConfig_false);
// TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Enable OpenGL version check "
+ "(do not disable)"), "", "checkOpenGLVersion", this,
+ "checkOpenGLVersionEvent");
+
+ // TRANSLATORS: settings option
new SetupItemCheckBox(_("Enable debug log"), "",
"debugLog", this, "debugLogEvent");