summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-09 06:59:12 +0000
committerManolo Gouy <Manolo>2016-03-09 06:59:12 +0000
commit309213bfaeaff9b3beec9548aeb7762d7dbaa2f8 (patch)
tree23b425be0c937840e42d661571a2c18b841680ae /src/Fl_cocoa.mm
parent0b751e8175debe3fa2c7b1d80693d1178565e664 (diff)
Simpler code for capture of OpenGL windows: the pixel array is converted to top-to-bottom earlier.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11326 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 42e85fd69..bbd26c389 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4091,7 +4091,7 @@ static NSBitmapImageRep* GL_rect_to_nsbitmap(Fl_Window *win, int x, int y, int w
NSBitmapImageRep* bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:img->w() pixelsHigh:img->h() bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:4*img->w() bitsPerPixel:32];
memset([bitmap bitmapData], 0xFF, [bitmap bytesPerPlane]);
const uchar *from = img->array;
- for (int r = img->h() - 1; r >= 0; r--) {
+ for (int r = 0; r < img->h(); r++) {
uchar *to = [bitmap bitmapData] + r * [bitmap bytesPerRow];
for (int c = 0; c < img->w(); c++) {
memcpy(to, from, 3);