diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-09-11 07:07:37 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-09-11 07:07:37 +0000 |
commit | c09905825a62274a210d618a6388b0601ac23657 (patch) | |
tree | 71aa26f196f79ac13ac0365248c8badb4a9025d3 | |
parent | 970b31227bde94f92af392870fc91844f063f167 (diff) | |
download | mana-c09905825a62274a210d618a6388b0601ac23657.tar.gz mana-c09905825a62274a210d618a6388b0601ac23657.tar.bz2 mana-c09905825a62274a210d618a6388b0601ac23657.tar.xz mana-c09905825a62274a210d618a6388b0601ac23657.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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 11 |
2 files changed, 18 insertions, 0 deletions
@@ -1,3 +1,10 @@ +2008-09-11 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/gui/setup_video.cpp: 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. + 2008-08-29 David Athay <ko2fan@gmail.com> * src/monster.cpp, src/resources/monsterinfo.h, diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 5044bbb6..ae15c7ef 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -280,9 +280,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; @@ -296,10 +305,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); } |