summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-07-24 21:30:46 +0000
committerManolo Gouy <Manolo>2015-07-24 21:30:46 +0000
commit80402f622c06196c0cc27fb2e0f0d2b9bf275796 (patch)
tree2f4c18828da3421abefbf732b6f17ee3d15d59a7 /src
parentc788ca2285cb99516dc49f1a9b321e36bcf3e0c8 (diff)
Restore usability on Mac OS 10.3:
- do not use NSOpenGLPFAMultisample - do not use -[NSBitmapImageRep bitmapFormat] that require Mac OS 10.4 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10815 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index a44b081b5..b073ae0e9 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2714,9 +2714,9 @@ NSOpenGLPixelFormat* Fl_X::mode_to_NSOpenGLPixelFormat(int m, const int *alistp)
//list[n++] = AGL_STEREO;
attribs[n++] = NSOpenGLPFAStereo;
}
- if (m & FL_MULTISAMPLE) {
+ if ((m & FL_MULTISAMPLE) && fl_mac_os_version >= 100400) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- attribs[n++] = NSOpenGLPFAMultisample,
+ attribs[n++] = NSOpenGLPFAMultisample, // 10.4
#endif
attribs[n++] = NSOpenGLPFASampleBuffers; attribs[n++] = (NSOpenGLPixelFormatAttribute)1;
attribs[n++] = NSOpenGLPFASamples; attribs[n++] = (NSOpenGLPixelFormatAttribute)4;
@@ -4229,7 +4229,7 @@ static NSBitmapImageRep* rect_to_NSBitmapImageRep(Fl_Window *win, int x, int y,
// if bitmap is high res and childbitmap is not, childbitmap must be rescaled
if ([bitmap pixelsWide] > w && [childbitmap pixelsWide] == clip.size.width) childbitmap = scale_nsbitmapimagerep(childbitmap, 2);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if ( ([bitmap bitmapFormat] & NSAlphaFirstBitmapFormat) && !([childbitmap bitmapFormat] & NSAlphaFirstBitmapFormat) ) { // 10.4
+ if (fl_mac_os_version >= 100400 && ([bitmap bitmapFormat] & NSAlphaFirstBitmapFormat) && !([childbitmap bitmapFormat] & NSAlphaFirstBitmapFormat) ) { // 10.4
// bitmap is ARGB and childbitmap is RGBA --> convert childbitmap to ARGB too
uchar *b = [childbitmap bitmapData];
for (int i = 0; i < [childbitmap pixelsHigh]; i++) {
@@ -4266,7 +4266,7 @@ unsigned char *Fl_X::bitmap_from_window_rect(Fl_Window *win, int x, int y, int w
int hh = bpp/bpr; // sometimes hh = h-1 for unclear reason, and hh = 2*h with retina
int ww = bpr/(*bytesPerPixel); // sometimes ww = w-1, and ww = 2*w with retina
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if ([bitmap bitmapFormat] & NSAlphaFirstBitmapFormat) { // imagerep is ARGB --> convert it to RGBA
+ if (fl_mac_os_version >= 100400 && ([bitmap bitmapFormat] & NSAlphaFirstBitmapFormat)) { // imagerep is ARGB --> convert it to RGBA
uchar *b = [bitmap bitmapData];
for (int i = 0; i < hh; i++) {
for (int j = 0; j < ww; j++) {