diff options
| author | Manolo Gouy <Manolo> | 2015-09-07 09:26:19 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2015-09-07 09:26:19 +0000 |
| commit | 60ad983b4e129f92c21eccd7f27c8efcbdb1e75d (patch) | |
| tree | 07268a8418d3640284a7ed3287e613bb64e66d2c /src | |
| parent | 34beb4c4ddb7fcde83cfdc06148c56e59545e140 (diff) | |
Mac OS: properly handle OpenGL profile requests independently from what SDK version is used at compile time.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10855 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 2dbf302f1..61698dc5b 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2729,14 +2729,25 @@ NSOpenGLPixelFormat* Fl_X::mode_to_NSOpenGLPixelFormat(int m, const int *alistp) attribs[n++] = NSOpenGLPFASampleBuffers; attribs[n++] = (NSOpenGLPixelFormatAttribute)1; attribs[n++] = NSOpenGLPFASamples; attribs[n++] = (NSOpenGLPixelFormatAttribute)4; } -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 +#define NSOpenGLPFAOpenGLProfile 99 +#define kCGLPFAOpenGLProfile NSOpenGLPFAOpenGLProfile +#define NSOpenGLProfileVersionLegacy 0x1000 +#define kCGLOGLPVersion_Legacy NSOpenGLProfileVersionLegacy +#endif if (fl_mac_os_version >= 100700) { attribs[n++] = NSOpenGLPFAOpenGLProfile; - attribs[n++] = NSOpenGLProfileVersionLegacy; + attribs[n++] = NSOpenGLProfileVersionLegacy; // for now, no public FLTK API for OpenGL v3 profiles } -#endif } else { while (alistp[n] && n < 30) { + if (alistp[n] == kCGLPFAOpenGLProfile) { + if (fl_mac_os_version < 100700) { + if (alistp[n+1] != kCGLOGLPVersion_Legacy) return nil; + n += 2; + continue; + } + } attribs[n] = (NSOpenGLPixelFormatAttribute)alistp[n]; n++; } |
