summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");