1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 02:38:52 -05:00

Cocoa: Fix CGDisplayModeCopyPixelEncoding cutoff

This commit is contained in:
Camilla Löwy 2017-01-02 05:05:18 +01:00
parent 04f559e28d
commit 51e415a026

View File

@ -128,7 +128,7 @@ static GLFWbool modeIsGood(CGDisplayModeRef mode)
if (flags & kDisplayModeStretchedFlag) if (flags & kDisplayModeStretchedFlag)
return GLFW_FALSE; return GLFW_FALSE;
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101200 #if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode); CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) && if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0)) CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
@ -159,7 +159,7 @@ static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
result.refreshRate = (int) (time.timeScale / (double) time.timeValue); result.refreshRate = (int) (time.timeScale / (double) time.timeValue);
} }
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101200 #if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode); CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0) if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
{ {
@ -175,7 +175,7 @@ static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
result.blueBits = 8; result.blueBits = 8;
} }
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101200 #if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
CFRelease(format); CFRelease(format);
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */ #endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
return result; return result;