From 056c5d3f9067d59e69e23465ee9924f6ffe26e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 27 Mar 2019 01:26:39 +0100 Subject: [PATCH] Cleanup --- src/cocoa_init.m | 7 ------- src/cocoa_platform.h | 18 ++++++++++++++++++ src/cocoa_window.m | 17 ----------------- src/nsgl_context.h | 5 +++++ src/nsgl_context.m | 5 ----- 5 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 30dd1f56..2575f8e1 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -30,13 +30,6 @@ // Needed for _NSGetProgname #include -#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200 - #define NSEventMaskKeyUp NSKeyUpMask - #define NSEventModifierFlagCommand NSCommandKeyMask - #define NSEventModifierFlagControl NSControlKeyMask - #define NSEventModifierFlagOption NSAlternateKeyMask -#endif - // Change to our application bundle's resources directory, if present // static void changeToResourcesDirectory(void) diff --git a/src/cocoa_platform.h b/src/cocoa_platform.h index d3d82b70..71f3d704 100644 --- a/src/cocoa_platform.h +++ b/src/cocoa_platform.h @@ -41,6 +41,24 @@ typedef void* id; #endif +#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200 + #define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat + #define NSEventMaskAny NSAnyEventMask + #define NSEventMaskKeyUp NSKeyUpMask + #define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask + #define NSEventModifierFlagCommand NSCommandKeyMask + #define NSEventModifierFlagControl NSControlKeyMask + #define NSEventModifierFlagDeviceIndependentFlagsMask NSDeviceIndependentModifierFlagsMask + #define NSEventModifierFlagOption NSAlternateKeyMask + #define NSEventModifierFlagShift NSShiftKeyMask + #define NSEventTypeApplicationDefined NSApplicationDefined + #define NSWindowStyleMaskBorderless NSBorderlessWindowMask + #define NSWindowStyleMaskClosable NSClosableWindowMask + #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask + #define NSWindowStyleMaskResizable NSResizableWindowMask + #define NSWindowStyleMaskTitled NSTitledWindowMask +#endif + typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; typedef struct VkMacOSSurfaceCreateInfoMVK diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 888edc9a..8c4fa4f1 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -29,23 +29,6 @@ #include #include -#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200 - #define NSWindowStyleMaskBorderless NSBorderlessWindowMask - #define NSWindowStyleMaskClosable NSClosableWindowMask - #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask - #define NSWindowStyleMaskResizable NSResizableWindowMask - #define NSWindowStyleMaskTitled NSTitledWindowMask - #define NSEventModifierFlagCommand NSCommandKeyMask - #define NSEventModifierFlagControl NSControlKeyMask - #define NSEventModifierFlagOption NSAlternateKeyMask - #define NSEventModifierFlagShift NSShiftKeyMask - #define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask - #define NSEventModifierFlagDeviceIndependentFlagsMask NSDeviceIndependentModifierFlagsMask - #define NSEventMaskAny NSAnyEventMask - #define NSEventTypeApplicationDefined NSApplicationDefined - #define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat -#endif - // Returns the style mask corresponding to the window settings // static NSUInteger getStyleMask(_GLFWwindow* window) diff --git a/src/nsgl_context.h b/src/nsgl_context.h index 27af3335..3c0d4e66 100755 --- a/src/nsgl_context.h +++ b/src/nsgl_context.h @@ -24,6 +24,11 @@ // //======================================================================== +#if MAC_OS_X_VERSION_MAX_ALLOWED < 101400 + #define NSOpenGLContextParameterSwapInterval NSOpenGLCPSwapInterval + #define NSOpenGLContextParameterSurfaceOpacity NSOpenGLCPSurfaceOpacity +#endif + #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL nsgl #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl diff --git a/src/nsgl_context.m b/src/nsgl_context.m index 72ed3597..109dad75 100755 --- a/src/nsgl_context.m +++ b/src/nsgl_context.m @@ -26,11 +26,6 @@ #include "internal.h" -#if MAC_OS_X_VERSION_MAX_ALLOWED < 101400 - #define NSOpenGLContextParameterSwapInterval NSOpenGLCPSwapInterval - #define NSOpenGLContextParameterSurfaceOpacity NSOpenGLCPSurfaceOpacity -#endif - static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime,