summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-09-11 07:07:37 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 20:46:27 +0100
commitb6eb0e404e74bad6d522bac7e07990f0b10b2703 (patch)
tree9de345e8b4abeb700e7848238be9b584b268fb3e /src
parente7662dbaaa6178b9bbe6b5933538b0127810409f (diff)
downloadmana-client-b6eb0e404e74bad6d522bac7e07990f0b10b2703.tar.gz
mana-client-b6eb0e404e74bad6d522bac7e07990f0b10b2703.tar.bz2
mana-client-b6eb0e404e74bad6d522bac7e07990f0b10b2703.tar.xz
mana-client-b6eb0e404e74bad6d522bac7e07990f0b10b2703.zip
Only require a restart to switch to full screen with OpenGL on Windows, since
it works fine in Linux without having to reinitialize the OpenGL state. Adapted change by kraant from Aethyra. (cherry picked from eAthena client)
Diffstat (limited to 'src')
-rw-r--r--src/gui/setup_video.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 1b65cad6..d9d6f34a 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -253,9 +253,18 @@ void Setup_Video::apply()
bool fullscreen = mFsCheckBox->isSelected();
if (fullscreen != (config.getValue("screen", 0) == 1))
{
+ /* The OpenGL test is only necessary on Windows, since switching
+ * to/from full screen works fine on Linux. On Windows we'd have to
+ * reinitialize the OpenGL state and reload all textures.
+ *
+ * See http://libsdl.org/cgi/docwiki.cgi/SDL_SetVideoMode
+ */
+
+#ifdef WIN32
// checks for opengl usage
if (!(config.getValue("opengl", 0) == 1))
{
+#endif
if (!graphics->setFullscreen(fullscreen))
{
fullscreen = !fullscreen;
@@ -269,10 +278,12 @@ void Setup_Video::apply()
logger->error(error.str());
}
}
+#ifdef WIN32
} else {
new OkDialog(_("Switching to full screen"),
_("Restart needed for changes to take effect."));
}
+#endif
config.setValue("screen", fullscreen ? 1 : 0);
}