mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 07:31:21 +02:00
- bugfix for corrupted screenshots in g3d viewer reported by tomreyn
This commit is contained in:
@@ -473,8 +473,13 @@ void Renderer::setAlphaColor(float alpha) {
|
||||
void Renderer::saveScreen(const string &path) {
|
||||
Pixmap2D *pixmapScreenShot = new Pixmap2D(width, height, 4);
|
||||
glFinish();
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
|
||||
glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(),GL_RGBA, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
pixmapScreenShot->save(path);
|
||||
delete pixmapScreenShot;
|
||||
}
|
||||
|
Reference in New Issue
Block a user