Fixed compilation with macOS SDK earlier than 10.7

This commit is contained in:
alexey.lysiuk 2017-01-13 10:52:35 +02:00
parent 7e0c870d0f
commit 4001e7e6bd
2 changed files with 20 additions and 2 deletions

View file

@ -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

View file

@ -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