From 309213bfaeaff9b3beec9548aeb7762d7dbaa2f8 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 9 Mar 2016 06:59:12 +0000 Subject: 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 --- src/Fl_cocoa.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Fl_cocoa.mm') 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); -- cgit v1.2.3