diff --git a/src/posix/cocoa/i_common.h b/src/posix/cocoa/i_common.h index 9cedb0262..0fc46e377 100644 --- a/src/posix/cocoa/i_common.h +++ b/src/posix/cocoa/i_common.h @@ -184,14 +184,19 @@ typedef NSInteger NSApplicationActivationPolicy; - (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag; @end +@interface NSView(Compatibility) +- (NSRect)convertRectToBacking:(NSRect)aRect; +@end + @interface NSScreen(HiDPIStubs) - (NSRect)convertRectToBacking:(NSRect)aRect; @end static const NSWindowCollectionBehavior NSWindowCollectionBehaviorFullScreenAuxiliary = NSWindowCollectionBehavior(1 << 8); -static const NSOpenGLPixelFormatAttribute NSOpenGLPFAOpenGLProfile(96); -static const NSOpenGLPixelFormatAttribute NSOpenGLProfileVersion3_2Core(0x3200); +static const auto NSOpenGLPFAOpenGLProfile = NSOpenGLPixelFormatAttribute(96); +static const auto NSOpenGLProfileVersionLegacy = NSOpenGLPixelFormatAttribute(0x1000); +static const auto NSOpenGLProfileVersion3_2Core = NSOpenGLPixelFormatAttribute(0x3200); #endif // prior to 10.7 diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 08a563b25..2ee7458a8 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -69,6 +69,19 @@ #undef Class +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 + +@implementation NSView(Compatibility) + +- (NSRect)convertRectToBacking:(NSRect)aRect +{ + return [self convertRect:aRect toView:[self superview]]; +} + +@end + +#endif // prior to 10.7 + @implementation NSWindow(ExitAppOnClose) - (void)exitAppOnClose