- bugfix on windows for autoscreenshots in g3d viewer

This commit is contained in:
Mark Vejvoda
2012-01-04 21:43:34 +00:00
parent 43c9d44bd6
commit 7b69d3040f
3 changed files with 9 additions and 6 deletions

View File

@@ -485,11 +485,12 @@ void Renderer::setAlphaColor(float alpha) {
void Renderer::saveScreen(const string &path) {
Pixmap2D *pixmapScreenShot = new Pixmap2D(width, height, 4);
glFinish();
//glFinish();
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(),GL_RGBA, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(),
GL_RGBA, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);