X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.cpp;fp=src%2Fscreen.cpp;h=01e736470d0222fcf99ffb37c3ba76c463abb2d2;hp=59d4334ac89eb7ba4d1123531906b4e0e5916863;hb=029e93dad12c51c69e47aa74dcc39f84d315bca3;hpb=b1786b24148036a4d9402cc12ea97466072e988d diff --git a/src/screen.cpp b/src/screen.cpp index 59d4334..01e7364 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -139,6 +139,7 @@ void Screen::ScreenShot(const char * filename) const if (pixels == NULL) Fatal("Failed to allocate %d x %d x 4 = %d pixel array", w, h, w*h*4); + for (int y = 0; y < h; ++y) { glReadPixels(0,h-y-1,w, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[y*w*4]);