Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2015-01-06 22:14:10 +0000
committerStijn Buys <ingar@osirion.org>2015-01-06 22:14:10 +0000
commitbae25b0b688e95f821d4c305a3a6e8e4a64e8c6e (patch)
treee6df92391a82339a1873f1e5eecc771bbf7b4542
parent5f2455a23a4f94a5ac1d25d072279845060b2e3b (diff)
Corrected savegame screenshots on win32.
-rw-r--r--src/client/savegamemenu.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/savegamemenu.cc b/src/client/savegamemenu.cc
index c2601a5..d002b54 100644
--- a/src/client/savegamemenu.cc
+++ b/src/client/savegamemenu.cc
@@ -555,7 +555,14 @@ void SaveGameMenu::savescreenshot(std::string savename)
std::string filename(filesystem::writedir() + "savegames/" + savename + ".jpg");
// redraw the world without ui
-
+ /*
+ hack: win32 seems to have triple buffering or reads pixels from the wrong buffer
+ the workaround is to render the world twice
+ */
+
+#ifdef __WIN32
+ for (size_t i = 0; i < 2; ++i) {
+#endif
// Clear the color and depth buffers.
gl::clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -571,7 +578,9 @@ void SaveGameMenu::savescreenshot(std::string savename)
gl::disable(GL_BLEND);
video::swap_buffers();
-
+#ifdef __WIN32
+ }
+#endif
render::Screenshot::savegameshot(filename);
}