mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 19:52:25 +01:00
- bugfix for corrupted screenshots in g3d viewer reported by tomreyn
This commit is contained in:
parent
f3c11138db
commit
c0e4657f68
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user