From b7ec26335f8c8fd0e223e3f268c2b7d2258e5b07 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 29 Aug 2016 22:03:25 +0300 Subject: [PATCH] Enabled OpenGL Core Profile on macOS --- src/posix/cocoa/i_common.h | 3 +++ src/posix/cocoa/i_video.mm | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/posix/cocoa/i_common.h b/src/posix/cocoa/i_common.h index 4a558cf24..9cedb0262 100644 --- a/src/posix/cocoa/i_common.h +++ b/src/posix/cocoa/i_common.h @@ -190,6 +190,9 @@ typedef NSInteger NSApplicationActivationPolicy; static const NSWindowCollectionBehavior NSWindowCollectionBehaviorFullScreenAuxiliary = NSWindowCollectionBehavior(1 << 8); +static const NSOpenGLPixelFormatAttribute NSOpenGLPFAOpenGLProfile(96); +static const NSOpenGLPixelFormatAttribute NSOpenGLProfileVersion3_2Core(0x3200); + #endif // prior to 10.7 #endif // COCOA_I_COMMON_INCLUDED diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index e2b59449d..b026fa9b9 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -501,6 +501,12 @@ CocoaVideo::CocoaVideo(const int multisample) attributes[i++] = NSOpenGLPixelFormatAttribute(multisample); } + if (NSAppKitVersionNumber >= AppKit10_7) + { + attributes[i++] = NSOpenGLPFAOpenGLProfile; + attributes[i++] = NSOpenGLProfileVersion3_2Core; + } + attributes[i] = NSOpenGLPixelFormatAttribute(0); // Create OpenGL context and view