diff options
author | Stijn Buys <ingar@osirion.org> | 2015-01-06 22:14:10 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2015-01-06 22:14:10 +0000 |
commit | bae25b0b688e95f821d4c305a3a6e8e4a64e8c6e (patch) | |
tree | e6df92391a82339a1873f1e5eecc771bbf7b4542 /src | |
parent | 5f2455a23a4f94a5ac1d25d072279845060b2e3b (diff) |
Corrected savegame screenshots on win32.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/savegamemenu.cc | 13 |
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); } |