summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp9
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/graphicsmanager.cpp4
3 files changed, 14 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 383a40da1..e7083f943 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -508,6 +508,15 @@ void Client::gameInit()
}
#endif
+#ifdef WIN32
+ if (mOptions.test.empty() && !config.getBoolValue("videodetected"))
+ {
+ int val = graphicsManager.startDetection();
+ if (val >= 0 && val <= 2)
+ config.setValue("opengl", val);
+ config.setValue("videodetected", true);
+ }
+#endif
graphicsManager.initGraphics(mOptions.noOpenGL);
runCounters = config.getBoolValue("packetcounters");
diff --git a/src/defaults.cpp b/src/defaults.cpp
index fda474fb1..4d760441a 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -257,6 +257,7 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "rectangulartextures", true);
AddDEF(configData, "networksleep", 0);
AddDEF(configData, "newtextures", true);
+ AddDEF(configData, "videodetected", false);
return configData;
}
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index f1e13b74b..36ccdc045 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -48,9 +48,13 @@ GraphicsManager::~GraphicsManager()
bool GraphicsManager::startDetection()
{
+#ifdef USE_OPENGL
TestMain *test = new TestMain();
test->exec(false);
return test->getConfig().getValueInt("opengl", -1);
+#else
+ return 0;
+#endif
}
bool GraphicsManager::detectGraphics()