Fixed bug 2696 - Mac: fix display mode refresh rate calculation
authorSam Lantinga <slouken@libsdl.org>
Sat, 23 Aug 2014 10:47:50 -0700
changeset 9112345a7d41dda9
parent 9108 8200b1bdcf83
child 9113 9887ee47e143
Fixed bug 2696 - Mac: fix display mode refresh rate calculation

Alex Szpakowski

SDL's Cocoa backend uses the CGDisplayMode API to get refresh rate information about a display mode, but CGDisplayModeGetRefreshRate will return 0 on most non-CRT monitors.

The only way I know of to get correct refresh rate information in OS X is via the CoreVideo DisplayLink API.
I have attached a patch which tries to use the CVDisplayLinkGetNominalOutputVideoRefreshPeriod function if CGDisplayModeGetRefreshRate fails, which fixes display mode refresh rate information on the monitors I tested.

The CVDisplayLink API requires linking with the CoreVideo framework, and the patch updates the various build files to do so.
CMakeLists.txt
Xcode/SDL/SDL.xcodeproj/project.pbxproj
Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
configure
configure.in
premake/README-macosx.txt
premake/projects/SDL2.lua
src/video/cocoa/SDL_cocoamodes.m
     1.1 --- a/CMakeLists.txt	Thu Aug 21 23:22:46 2014 -0400
     1.2 +++ b/CMakeLists.txt	Sat Aug 23 10:47:50 2014 -0700
     1.3 @@ -970,6 +970,7 @@
     1.4      set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
     1.5      set(HAVE_SDL_FILE TRUE)
     1.6      set(SDL_FRAMEWORK_COCOA 1)
     1.7 +    set(SDL_FRAMEWORK_COREVIDEO 1)
     1.8    else()
     1.9      message_error("SDL_FILE must be enabled to build on MacOS X")
    1.10    endif()
    1.11 @@ -1029,6 +1030,10 @@
    1.12    endif()
    1.13  
    1.14    # Actually load the frameworks at the end so we don't duplicate include.
    1.15 +  if(SDL_FRAMEWORK_COREVIDEO)
    1.16 +    find_library(COREVIDEO CoreVideo)
    1.17 +    list(APPEND EXTRA_LIBS ${COREVIDEO})
    1.18 +  endif()
    1.19    if(SDL_FRAMEWORK_COCOA)
    1.20      find_library(COCOA_LIBRARY Cocoa)
    1.21      list(APPEND EXTRA_LIBS ${COCOA_LIBRARY})
     2.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Thu Aug 21 23:22:46 2014 -0400
     2.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Sat Aug 23 10:47:50 2014 -0700
     2.3 @@ -810,6 +810,9 @@
     2.4  		DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
     2.5  		DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
     2.6  		DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
     2.7 +		FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
     2.8 +		FA73671E19A54140004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
     2.9 +		FA73671F19A54144004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
    2.10  /* End PBXBuildFile section */
    2.11  
    2.12  /* Begin PBXContainerItemProxy section */
    2.13 @@ -1109,6 +1112,7 @@
    2.14  		F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; };
    2.15  		F5A2EF3A00C6A3C201000001 /* README-macosx.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "README-macosx.txt"; path = "../../README-macosx.txt"; sourceTree = SOURCE_ROOT; };
    2.16  		F5F81AD400D706B101000001 /* Readme SDL Developer.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "Readme SDL Developer.txt"; path = "pkg-support/Readme SDL Developer.txt"; sourceTree = SOURCE_ROOT; };
    2.17 +		FA73671C19A540EF004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; };
    2.18  /* End PBXFileReference section */
    2.19  
    2.20  /* Begin PBXFrameworksBuildPhase section */
    2.21 @@ -1116,6 +1120,7 @@
    2.22  			isa = PBXFrameworksBuildPhase;
    2.23  			buildActionMask = 2147483647;
    2.24  			files = (
    2.25 +				FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */,
    2.26  				007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
    2.27  				007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
    2.28  				007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
    2.29 @@ -1131,6 +1136,7 @@
    2.30  			isa = PBXFrameworksBuildPhase;
    2.31  			buildActionMask = 2147483647;
    2.32  			files = (
    2.33 +				FA73671E19A54140004122E4 /* CoreVideo.framework in Frameworks */,
    2.34  				007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
    2.35  				007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
    2.36  				007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
    2.37 @@ -1145,6 +1151,7 @@
    2.38  			isa = PBXFrameworksBuildPhase;
    2.39  			buildActionMask = 2147483647;
    2.40  			files = (
    2.41 +				FA73671F19A54144004122E4 /* CoreVideo.framework in Frameworks */,
    2.42  				DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */,
    2.43  				DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */,
    2.44  				DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */,
    2.45 @@ -1738,6 +1745,7 @@
    2.46  		BEC562FE0761C0E800A33029 /* Linked Frameworks */ = {
    2.47  			isa = PBXGroup;
    2.48  			children = (
    2.49 +				FA73671C19A540EF004122E4 /* CoreVideo.framework */,
    2.50  				00D0D08310675DD9004B05EF /* CoreFoundation.framework */,
    2.51  				007317C10858E15000B2BC32 /* Carbon.framework */,
    2.52  				0073179B0858DECD00B2BC32 /* AudioToolbox.framework */,
     3.1 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj	Thu Aug 21 23:22:46 2014 -0400
     3.2 +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj	Sat Aug 23 10:47:50 2014 -0700
     3.3 @@ -555,6 +555,51 @@
     3.4  		DB89957918A19ABA0092407C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
     3.5  		DB89957A18A19ABA0092407C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
     3.6  		DB89958418A19B130092407C /* testhotplug.c in Sources */ = {isa = PBXBuildFile; fileRef = DB89958318A19B130092407C /* testhotplug.c */; };
     3.7 +		FA73672319A54A90004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
     3.8 +		FA73672819A54AB6004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
     3.9 +		FA73672919A54AB9004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.10 +		FA73672A19A54AC0004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.11 +		FA73672B19A54AC2004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.12 +		FA73672C19A54AC5004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.13 +		FA73672D19A54AC7004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.14 +		FA73672E19A54ACA004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.15 +		FA73672F19A54ACC004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.16 +		FA73673019A54AD0004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.17 +		FA73673119A54AD3004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.18 +		FA73673219A54AD5004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.19 +		FA73673319A54AD8004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.20 +		FA73673419A54ADB004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.21 +		FA73673519A54ADE004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.22 +		FA73673619A54AE1004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.23 +		FA73673719A54AE3004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.24 +		FA73673819A54AE6004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.25 +		FA73673919A54AE8004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.26 +		FA73673A19A54AEB004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.27 +		FA73673B19A54AED004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.28 +		FA73673C19A54AF0004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.29 +		FA73673D19A54AF3004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.30 +		FA73673E19A54AF6004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.31 +		FA73673F19A54AF8004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.32 +		FA73674019A54AFB004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.33 +		FA73674119A54AFE004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.34 +		FA73674219A54B01004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.35 +		FA73674319A54B04004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.36 +		FA73674419A54B06004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.37 +		FA73674519A54B09004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.38 +		FA73674619A54B0B004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.39 +		FA73674719A54B0F004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.40 +		FA73674819A54B13004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.41 +		FA73674919A54B16004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.42 +		FA73674A19A54B19004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.43 +		FA73674B19A54B1B004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.44 +		FA73674C19A54B1F004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.45 +		FA73674D19A54B22004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.46 +		FA73674E19A54B25004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.47 +		FA73674F19A54B28004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.48 +		FA73675019A54B2B004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.49 +		FA73675119A54B2F004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.50 +		FA73675219A54B32004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.51 +		FA73675319A54B35004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    3.52  /* End PBXBuildFile section */
    3.53  
    3.54  /* Begin PBXContainerItemProxy section */
    3.55 @@ -1141,6 +1186,7 @@
    3.56  		DB89957E18A19ABA0092407C /* testhotplug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testhotplug; sourceTree = BUILT_PRODUCTS_DIR; };
    3.57  		DB89958318A19B130092407C /* testhotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testhotplug.c; path = ../../test/testhotplug.c; sourceTree = "<group>"; };
    3.58  		DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "TestDropFile-Info.plist"; sourceTree = "<group>"; };
    3.59 +		FA73672219A54A90004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; };
    3.60  /* End PBXFileReference section */
    3.61  
    3.62  /* Begin PBXFrameworksBuildPhase section */
    3.63 @@ -1148,6 +1194,7 @@
    3.64  			isa = PBXFrameworksBuildPhase;
    3.65  			buildActionMask = 2147483647;
    3.66  			files = (
    3.67 +				FA73672919A54AB9004122E4 /* CoreVideo.framework in Frameworks */,
    3.68  				0017957C10741F7900F5D044 /* Cocoa.framework in Frameworks */,
    3.69  				0017957D10741F7900F5D044 /* CoreAudio.framework in Frameworks */,
    3.70  				0017957E10741F7900F5D044 /* ForceFeedback.framework in Frameworks */,
    3.71 @@ -1164,6 +1211,7 @@
    3.72  			isa = PBXFrameworksBuildPhase;
    3.73  			buildActionMask = 2147483647;
    3.74  			files = (
    3.75 +				FA73672A19A54AC0004122E4 /* CoreVideo.framework in Frameworks */,
    3.76  				0017959D107421BF00F5D044 /* Cocoa.framework in Frameworks */,
    3.77  				0017959E107421BF00F5D044 /* CoreAudio.framework in Frameworks */,
    3.78  				0017959F107421BF00F5D044 /* ForceFeedback.framework in Frameworks */,
    3.79 @@ -1180,6 +1228,7 @@
    3.80  			isa = PBXFrameworksBuildPhase;
    3.81  			buildActionMask = 2147483647;
    3.82  			files = (
    3.83 +				FA73673319A54AD8004122E4 /* CoreVideo.framework in Frameworks */,
    3.84  				0017971110742F3200F5D044 /* Cocoa.framework in Frameworks */,
    3.85  				0017971210742F3200F5D044 /* CoreAudio.framework in Frameworks */,
    3.86  				0017971310742F3200F5D044 /* ForceFeedback.framework in Frameworks */,
    3.87 @@ -1197,6 +1246,7 @@
    3.88  			isa = PBXFrameworksBuildPhase;
    3.89  			buildActionMask = 2147483647;
    3.90  			files = (
    3.91 +				FA73673419A54ADB004122E4 /* CoreVideo.framework in Frameworks */,
    3.92  				00179738107430D600F5D044 /* Cocoa.framework in Frameworks */,
    3.93  				00179739107430D600F5D044 /* CoreAudio.framework in Frameworks */,
    3.94  				0017973A107430D600F5D044 /* ForceFeedback.framework in Frameworks */,
    3.95 @@ -1213,6 +1263,7 @@
    3.96  			isa = PBXFrameworksBuildPhase;
    3.97  			buildActionMask = 2147483647;
    3.98  			files = (
    3.99 +				FA73672B19A54AC2004122E4 /* CoreVideo.framework in Frameworks */,
   3.100  				0017975E107431B300F5D044 /* Cocoa.framework in Frameworks */,
   3.101  				0017975F107431B300F5D044 /* CoreAudio.framework in Frameworks */,
   3.102  				00179760107431B300F5D044 /* ForceFeedback.framework in Frameworks */,
   3.103 @@ -1230,6 +1281,7 @@
   3.104  			isa = PBXFrameworksBuildPhase;
   3.105  			buildActionMask = 2147483647;
   3.106  			files = (
   3.107 +				FA73673719A54AE3004122E4 /* CoreVideo.framework in Frameworks */,
   3.108  				0017977E107432AE00F5D044 /* Cocoa.framework in Frameworks */,
   3.109  				0017977F107432AE00F5D044 /* CoreAudio.framework in Frameworks */,
   3.110  				00179780107432AE00F5D044 /* ForceFeedback.framework in Frameworks */,
   3.111 @@ -1247,6 +1299,7 @@
   3.112  			isa = PBXFrameworksBuildPhase;
   3.113  			buildActionMask = 2147483647;
   3.114  			files = (
   3.115 +				FA73673819A54AE6004122E4 /* CoreVideo.framework in Frameworks */,
   3.116  				0017979E1074334C00F5D044 /* Cocoa.framework in Frameworks */,
   3.117  				0017979F1074334C00F5D044 /* CoreAudio.framework in Frameworks */,
   3.118  				001797A01074334C00F5D044 /* ForceFeedback.framework in Frameworks */,
   3.119 @@ -1264,6 +1317,7 @@
   3.120  			isa = PBXFrameworksBuildPhase;
   3.121  			buildActionMask = 2147483647;
   3.122  			files = (
   3.123 +				FA73673B19A54AED004122E4 /* CoreVideo.framework in Frameworks */,
   3.124  				001797C0107433C600F5D044 /* Cocoa.framework in Frameworks */,
   3.125  				001797C1107433C600F5D044 /* CoreAudio.framework in Frameworks */,
   3.126  				001797C2107433C600F5D044 /* ForceFeedback.framework in Frameworks */,
   3.127 @@ -1280,6 +1334,7 @@
   3.128  			isa = PBXFrameworksBuildPhase;
   3.129  			buildActionMask = 2147483647;
   3.130  			files = (
   3.131 +				FA73673E19A54AF6004122E4 /* CoreVideo.framework in Frameworks */,
   3.132  				001798021074355200F5D044 /* Cocoa.framework in Frameworks */,
   3.133  				001798031074355200F5D044 /* CoreAudio.framework in Frameworks */,
   3.134  				001798041074355200F5D044 /* ForceFeedback.framework in Frameworks */,
   3.135 @@ -1296,6 +1351,7 @@
   3.136  			isa = PBXFrameworksBuildPhase;
   3.137  			buildActionMask = 2147483647;
   3.138  			files = (
   3.139 +				FA73673F19A54AF8004122E4 /* CoreVideo.framework in Frameworks */,
   3.140  				001798841074392D00F5D044 /* Cocoa.framework in Frameworks */,
   3.141  				001798851074392D00F5D044 /* CoreAudio.framework in Frameworks */,
   3.142  				001798861074392D00F5D044 /* ForceFeedback.framework in Frameworks */,
   3.143 @@ -1312,6 +1368,7 @@
   3.144  			isa = PBXFrameworksBuildPhase;
   3.145  			buildActionMask = 2147483647;
   3.146  			files = (
   3.147 +				FA73674219A54B01004122E4 /* CoreVideo.framework in Frameworks */,
   3.148  				001798A5107439DF00F5D044 /* Cocoa.framework in Frameworks */,
   3.149  				001798A6107439DF00F5D044 /* CoreAudio.framework in Frameworks */,
   3.150  				001798A7107439DF00F5D044 /* ForceFeedback.framework in Frameworks */,
   3.151 @@ -1328,6 +1385,7 @@
   3.152  			isa = PBXFrameworksBuildPhase;
   3.153  			buildActionMask = 2147483647;
   3.154  			files = (
   3.155 +				FA73674619A54B0B004122E4 /* CoreVideo.framework in Frameworks */,
   3.156  				001798E210743BEC00F5D044 /* Cocoa.framework in Frameworks */,
   3.157  				001798E310743BEC00F5D044 /* CoreAudio.framework in Frameworks */,
   3.158  				001798E410743BEC00F5D044 /* ForceFeedback.framework in Frameworks */,
   3.159 @@ -1344,6 +1402,7 @@
   3.160  			isa = PBXFrameworksBuildPhase;
   3.161  			buildActionMask = 2147483647;
   3.162  			files = (
   3.163 +				FA73674C19A54B1F004122E4 /* CoreVideo.framework in Frameworks */,
   3.164  				0017990610743F1000F5D044 /* Cocoa.framework in Frameworks */,
   3.165  				0017990710743F1000F5D044 /* CoreAudio.framework in Frameworks */,
   3.166  				0017990810743F1000F5D044 /* ForceFeedback.framework in Frameworks */,
   3.167 @@ -1361,6 +1420,7 @@
   3.168  			isa = PBXFrameworksBuildPhase;
   3.169  			buildActionMask = 2147483647;
   3.170  			files = (
   3.171 +				FA73675219A54B32004122E4 /* CoreVideo.framework in Frameworks */,
   3.172  				0017992810743FB700F5D044 /* Cocoa.framework in Frameworks */,
   3.173  				0017992910743FB700F5D044 /* CoreAudio.framework in Frameworks */,
   3.174  				0017992A10743FB700F5D044 /* ForceFeedback.framework in Frameworks */,
   3.175 @@ -1378,6 +1438,7 @@
   3.176  			isa = PBXFrameworksBuildPhase;
   3.177  			buildActionMask = 2147483647;
   3.178  			files = (
   3.179 +				FA73672F19A54ACC004122E4 /* CoreVideo.framework in Frameworks */,
   3.180  				002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */,
   3.181  				002A866B10730548007319AE /* CoreAudio.framework in Frameworks */,
   3.182  				002A866C10730548007319AE /* ForceFeedback.framework in Frameworks */,
   3.183 @@ -1394,6 +1455,7 @@
   3.184  			isa = PBXFrameworksBuildPhase;
   3.185  			buildActionMask = 2147483647;
   3.186  			files = (
   3.187 +				FA73673619A54AE1004122E4 /* CoreVideo.framework in Frameworks */,
   3.188  				002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */,
   3.189  				002A866210730547007319AE /* CoreAudio.framework in Frameworks */,
   3.190  				002A866310730547007319AE /* ForceFeedback.framework in Frameworks */,
   3.191 @@ -1410,6 +1472,7 @@
   3.192  			isa = PBXFrameworksBuildPhase;
   3.193  			buildActionMask = 2147483647;
   3.194  			files = (
   3.195 +				FA73674019A54AFB004122E4 /* CoreVideo.framework in Frameworks */,
   3.196  				002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */,
   3.197  				002A868010730549007319AE /* CoreAudio.framework in Frameworks */,
   3.198  				002A868110730549007319AE /* ForceFeedback.framework in Frameworks */,
   3.199 @@ -1426,6 +1489,7 @@
   3.200  			isa = PBXFrameworksBuildPhase;
   3.201  			buildActionMask = 2147483647;
   3.202  			files = (
   3.203 +				FA73674119A54AFE004122E4 /* CoreVideo.framework in Frameworks */,
   3.204  				002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */,
   3.205  				002A868610730549007319AE /* CoreAudio.framework in Frameworks */,
   3.206  				002A868710730549007319AE /* ForceFeedback.framework in Frameworks */,
   3.207 @@ -1442,6 +1506,7 @@
   3.208  			isa = PBXFrameworksBuildPhase;
   3.209  			buildActionMask = 2147483647;
   3.210  			files = (
   3.211 +				FA73674B19A54B1B004122E4 /* CoreVideo.framework in Frameworks */,
   3.212  				DB166D7116A1CFB200A1396C /* AudioToolbox.framework in Frameworks */,
   3.213  				DB166D7216A1CFB200A1396C /* AudioUnit.framework in Frameworks */,
   3.214  				DB166D7316A1CFB200A1396C /* Carbon.framework in Frameworks */,
   3.215 @@ -1459,6 +1524,7 @@
   3.216  			isa = PBXFrameworksBuildPhase;
   3.217  			buildActionMask = 2147483647;
   3.218  			files = (
   3.219 +				FA73673119A54AD3004122E4 /* CoreVideo.framework in Frameworks */,
   3.220  				BBFC08C0164C6862003E6A99 /* Cocoa.framework in Frameworks */,
   3.221  				BBFC08C1164C6862003E6A99 /* CoreAudio.framework in Frameworks */,
   3.222  				BBFC08C2164C6862003E6A99 /* ForceFeedback.framework in Frameworks */,
   3.223 @@ -1475,6 +1541,7 @@
   3.224  			isa = PBXFrameworksBuildPhase;
   3.225  			buildActionMask = 2147483647;
   3.226  			files = (
   3.227 +				FA73672319A54A90004122E4 /* CoreVideo.framework in Frameworks */,
   3.228  				002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.229  				002A863010730405007319AE /* libSDL2.a in Frameworks */,
   3.230  				002A864D10730546007319AE /* CoreAudio.framework in Frameworks */,
   3.231 @@ -1491,6 +1558,7 @@
   3.232  			isa = PBXFrameworksBuildPhase;
   3.233  			buildActionMask = 2147483647;
   3.234  			files = (
   3.235 +				FA73672819A54AB6004122E4 /* CoreVideo.framework in Frameworks */,
   3.236  				002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.237  				002A865310730547007319AE /* CoreAudio.framework in Frameworks */,
   3.238  				002A865410730547007319AE /* ForceFeedback.framework in Frameworks */,
   3.239 @@ -1507,6 +1575,7 @@
   3.240  			isa = PBXFrameworksBuildPhase;
   3.241  			buildActionMask = 2147483647;
   3.242  			files = (
   3.243 +				FA73672E19A54ACA004122E4 /* CoreVideo.framework in Frameworks */,
   3.244  				002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.245  				002A866E10730548007319AE /* CoreAudio.framework in Frameworks */,
   3.246  				002A866F10730548007319AE /* ForceFeedback.framework in Frameworks */,
   3.247 @@ -1523,6 +1592,7 @@
   3.248  			isa = PBXFrameworksBuildPhase;
   3.249  			buildActionMask = 2147483647;
   3.250  			files = (
   3.251 +				FA73674F19A54B28004122E4 /* CoreVideo.framework in Frameworks */,
   3.252  				002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.253  				002A868F1073054A007319AE /* CoreAudio.framework in Frameworks */,
   3.254  				002A86901073054A007319AE /* ForceFeedback.framework in Frameworks */,
   3.255 @@ -1539,6 +1609,7 @@
   3.256  			isa = PBXFrameworksBuildPhase;
   3.257  			buildActionMask = 2147483647;
   3.258  			files = (
   3.259 +				FA73673919A54AE8004122E4 /* CoreVideo.framework in Frameworks */,
   3.260  				002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.261  				002A867410730548007319AE /* CoreAudio.framework in Frameworks */,
   3.262  				002A867510730548007319AE /* ForceFeedback.framework in Frameworks */,
   3.263 @@ -1555,6 +1626,7 @@
   3.264  			isa = PBXFrameworksBuildPhase;
   3.265  			buildActionMask = 2147483647;
   3.266  			files = (
   3.267 +				FA73673A19A54AEB004122E4 /* CoreVideo.framework in Frameworks */,
   3.268  				002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.269  				002A867710730548007319AE /* CoreAudio.framework in Frameworks */,
   3.270  				002A867810730548007319AE /* ForceFeedback.framework in Frameworks */,
   3.271 @@ -1571,6 +1643,7 @@
   3.272  			isa = PBXFrameworksBuildPhase;
   3.273  			buildActionMask = 2147483647;
   3.274  			files = (
   3.275 +				FA73673C19A54AF0004122E4 /* CoreVideo.framework in Frameworks */,
   3.276  				002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.277  				002A867A10730549007319AE /* CoreAudio.framework in Frameworks */,
   3.278  				002A867B10730549007319AE /* ForceFeedback.framework in Frameworks */,
   3.279 @@ -1587,6 +1660,7 @@
   3.280  			isa = PBXFrameworksBuildPhase;
   3.281  			buildActionMask = 2147483647;
   3.282  			files = (
   3.283 +				FA73674919A54B16004122E4 /* CoreVideo.framework in Frameworks */,
   3.284  				002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.285  				002A868910730549007319AE /* CoreAudio.framework in Frameworks */,
   3.286  				002A868A10730549007319AE /* ForceFeedback.framework in Frameworks */,
   3.287 @@ -1603,6 +1677,7 @@
   3.288  			isa = PBXFrameworksBuildPhase;
   3.289  			buildActionMask = 2147483647;
   3.290  			files = (
   3.291 +				FA73675019A54B2B004122E4 /* CoreVideo.framework in Frameworks */,
   3.292  				002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.293  				002A86981073054A007319AE /* CoreAudio.framework in Frameworks */,
   3.294  				002A86991073054A007319AE /* ForceFeedback.framework in Frameworks */,
   3.295 @@ -1619,6 +1694,7 @@
   3.296  			isa = PBXFrameworksBuildPhase;
   3.297  			buildActionMask = 2147483647;
   3.298  			files = (
   3.299 +				FA73675119A54B2F004122E4 /* CoreVideo.framework in Frameworks */,
   3.300  				002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.301  				002A86951073054A007319AE /* CoreAudio.framework in Frameworks */,
   3.302  				002A86961073054A007319AE /* ForceFeedback.framework in Frameworks */,
   3.303 @@ -1635,6 +1711,7 @@
   3.304  			isa = PBXFrameworksBuildPhase;
   3.305  			buildActionMask = 2147483647;
   3.306  			files = (
   3.307 +				FA73675319A54B35004122E4 /* CoreVideo.framework in Frameworks */,
   3.308  				002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   3.309  				002A864110730546007319AE /* CoreAudio.framework in Frameworks */,
   3.310  				002A864210730546007319AE /* ForceFeedback.framework in Frameworks */,
   3.311 @@ -1651,6 +1728,7 @@
   3.312  			isa = PBXFrameworksBuildPhase;
   3.313  			buildActionMask = 2147483647;
   3.314  			files = (
   3.315 +				FA73672C19A54AC5004122E4 /* CoreVideo.framework in Frameworks */,
   3.316  				DB0F48DD17CA51E5008798C5 /* Cocoa.framework in Frameworks */,
   3.317  				DB0F48DE17CA51E5008798C5 /* CoreAudio.framework in Frameworks */,
   3.318  				DB0F48DF17CA51E5008798C5 /* ForceFeedback.framework in Frameworks */,
   3.319 @@ -1667,6 +1745,7 @@
   3.320  			isa = PBXFrameworksBuildPhase;
   3.321  			buildActionMask = 2147483647;
   3.322  			files = (
   3.323 +				FA73673019A54AD0004122E4 /* CoreVideo.framework in Frameworks */,
   3.324  				DB0F48F317CA5212008798C5 /* Cocoa.framework in Frameworks */,
   3.325  				DB0F48F417CA5212008798C5 /* CoreAudio.framework in Frameworks */,
   3.326  				DB0F48F517CA5212008798C5 /* ForceFeedback.framework in Frameworks */,
   3.327 @@ -1690,6 +1769,7 @@
   3.328  			isa = PBXFrameworksBuildPhase;
   3.329  			buildActionMask = 2147483647;
   3.330  			files = (
   3.331 +				FA73673219A54AD5004122E4 /* CoreVideo.framework in Frameworks */,
   3.332  				DB166DB116A1D2F600A1396C /* Cocoa.framework in Frameworks */,
   3.333  				DB166DB216A1D2F600A1396C /* CoreAudio.framework in Frameworks */,
   3.334  				DB166DB316A1D2F600A1396C /* ForceFeedback.framework in Frameworks */,
   3.335 @@ -1706,6 +1786,7 @@
   3.336  			isa = PBXFrameworksBuildPhase;
   3.337  			buildActionMask = 2147483647;
   3.338  			files = (
   3.339 +				FA73673D19A54AF3004122E4 /* CoreVideo.framework in Frameworks */,
   3.340  				DB166DC816A1D36A00A1396C /* Cocoa.framework in Frameworks */,
   3.341  				DB166DC916A1D36A00A1396C /* CoreAudio.framework in Frameworks */,
   3.342  				DB166DCA16A1D36A00A1396C /* ForceFeedback.framework in Frameworks */,
   3.343 @@ -1722,6 +1803,7 @@
   3.344  			isa = PBXFrameworksBuildPhase;
   3.345  			buildActionMask = 2147483647;
   3.346  			files = (
   3.347 +				FA73674319A54B04004122E4 /* CoreVideo.framework in Frameworks */,
   3.348  				DB166DE016A1D50C00A1396C /* Cocoa.framework in Frameworks */,
   3.349  				DB166DE116A1D50C00A1396C /* CoreAudio.framework in Frameworks */,
   3.350  				DB166DE216A1D50C00A1396C /* ForceFeedback.framework in Frameworks */,
   3.351 @@ -1739,6 +1821,7 @@
   3.352  			isa = PBXFrameworksBuildPhase;
   3.353  			buildActionMask = 2147483647;
   3.354  			files = (
   3.355 +				FA73674419A54B06004122E4 /* CoreVideo.framework in Frameworks */,
   3.356  				DB166DF716A1D57C00A1396C /* Cocoa.framework in Frameworks */,
   3.357  				DB166DF816A1D57C00A1396C /* CoreAudio.framework in Frameworks */,
   3.358  				DB166DF916A1D57C00A1396C /* ForceFeedback.framework in Frameworks */,
   3.359 @@ -1756,6 +1839,7 @@
   3.360  			isa = PBXFrameworksBuildPhase;
   3.361  			buildActionMask = 2147483647;
   3.362  			files = (
   3.363 +				FA73674519A54B09004122E4 /* CoreVideo.framework in Frameworks */,
   3.364  				DB166E0E16A1D5AD00A1396C /* Cocoa.framework in Frameworks */,
   3.365  				DB166E0F16A1D5AD00A1396C /* CoreAudio.framework in Frameworks */,
   3.366  				DB166E1016A1D5AD00A1396C /* ForceFeedback.framework in Frameworks */,
   3.367 @@ -1773,6 +1857,7 @@
   3.368  			isa = PBXFrameworksBuildPhase;
   3.369  			buildActionMask = 2147483647;
   3.370  			files = (
   3.371 +				FA73674719A54B0F004122E4 /* CoreVideo.framework in Frameworks */,
   3.372  				DB166E2B16A1D64D00A1396C /* Cocoa.framework in Frameworks */,
   3.373  				DB166E2C16A1D64D00A1396C /* CoreAudio.framework in Frameworks */,
   3.374  				DB166E2D16A1D64D00A1396C /* ForceFeedback.framework in Frameworks */,
   3.375 @@ -1789,6 +1874,7 @@
   3.376  			isa = PBXFrameworksBuildPhase;
   3.377  			buildActionMask = 2147483647;
   3.378  			files = (
   3.379 +				FA73674819A54B13004122E4 /* CoreVideo.framework in Frameworks */,
   3.380  				DB166E4116A1D69000A1396C /* Cocoa.framework in Frameworks */,
   3.381  				DB166E4216A1D69000A1396C /* CoreAudio.framework in Frameworks */,
   3.382  				DB166E4316A1D69000A1396C /* ForceFeedback.framework in Frameworks */,
   3.383 @@ -1806,6 +1892,7 @@
   3.384  			isa = PBXFrameworksBuildPhase;
   3.385  			buildActionMask = 2147483647;
   3.386  			files = (
   3.387 +				FA73674A19A54B19004122E4 /* CoreVideo.framework in Frameworks */,
   3.388  				DB166E5B16A1D6F300A1396C /* Cocoa.framework in Frameworks */,
   3.389  				DB166E5C16A1D6F300A1396C /* CoreAudio.framework in Frameworks */,
   3.390  				DB166E5D16A1D6F300A1396C /* ForceFeedback.framework in Frameworks */,
   3.391 @@ -1822,6 +1909,7 @@
   3.392  			isa = PBXFrameworksBuildPhase;
   3.393  			buildActionMask = 2147483647;
   3.394  			files = (
   3.395 +				FA73674D19A54B22004122E4 /* CoreVideo.framework in Frameworks */,
   3.396  				DB166E7116A1D78400A1396C /* Cocoa.framework in Frameworks */,
   3.397  				DB166E7216A1D78400A1396C /* CoreAudio.framework in Frameworks */,
   3.398  				DB166E7316A1D78400A1396C /* ForceFeedback.framework in Frameworks */,
   3.399 @@ -1838,6 +1926,7 @@
   3.400  			isa = PBXFrameworksBuildPhase;
   3.401  			buildActionMask = 2147483647;
   3.402  			files = (
   3.403 +				FA73674E19A54B25004122E4 /* CoreVideo.framework in Frameworks */,
   3.404  				DB166E8416A1D78C00A1396C /* Cocoa.framework in Frameworks */,
   3.405  				DB166E8516A1D78C00A1396C /* CoreAudio.framework in Frameworks */,
   3.406  				DB166E8616A1D78C00A1396C /* ForceFeedback.framework in Frameworks */,
   3.407 @@ -1854,6 +1943,7 @@
   3.408  			isa = PBXFrameworksBuildPhase;
   3.409  			buildActionMask = 2147483647;
   3.410  			files = (
   3.411 +				FA73672D19A54AC7004122E4 /* CoreVideo.framework in Frameworks */,
   3.412  				DB445EEA18184B7000B306B0 /* Cocoa.framework in Frameworks */,
   3.413  				DB445EEB18184B7000B306B0 /* CoreAudio.framework in Frameworks */,
   3.414  				DB445EEC18184B7000B306B0 /* ForceFeedback.framework in Frameworks */,
   3.415 @@ -1871,6 +1961,7 @@
   3.416  			isa = PBXFrameworksBuildPhase;
   3.417  			buildActionMask = 2147483647;
   3.418  			files = (
   3.419 +				FA73673519A54ADE004122E4 /* CoreVideo.framework in Frameworks */,
   3.420  				DB89957118A19ABA0092407C /* Cocoa.framework in Frameworks */,
   3.421  				DB89957218A19ABA0092407C /* CoreAudio.framework in Frameworks */,
   3.422  				DB89957318A19ABA0092407C /* ForceFeedback.framework in Frameworks */,
   3.423 @@ -1889,6 +1980,7 @@
   3.424  		002F33A209CA183B00EBEB88 /* Linked Frameworks */ = {
   3.425  			isa = PBXGroup;
   3.426  			children = (
   3.427 +				FA73672219A54A90004122E4 /* CoreVideo.framework */,
   3.428  				002A869F10730593007319AE /* AudioToolbox.framework */,
   3.429  				002A871410730623007319AE /* AudioUnit.framework */,
   3.430  				002A873910730675007319AE /* Carbon.framework */,
     4.1 --- a/configure	Thu Aug 21 23:22:46 2014 -0400
     4.2 +++ b/configure	Sat Aug 23 10:47:50 2014 -0700
     4.3 @@ -23338,6 +23338,7 @@
     4.4          # The Mac OS X platform requires special setup.
     4.5          EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
     4.6          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
     4.7 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
     4.8          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
     4.9          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    4.10          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
     5.1 --- a/configure.in	Thu Aug 21 23:22:46 2014 -0400
     5.2 +++ b/configure.in	Sat Aug 23 10:47:50 2014 -0700
     5.3 @@ -3215,6 +3215,7 @@
     5.4          # The Mac OS X platform requires special setup.
     5.5          EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
     5.6          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
     5.7 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
     5.8          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
     5.9          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    5.10          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
     6.1 --- a/premake/README-macosx.txt	Thu Aug 21 23:22:46 2014 -0400
     6.2 +++ b/premake/README-macosx.txt	Sat Aug 23 10:47:50 2014 -0700
     6.3 @@ -17,6 +17,7 @@
     6.4  
     6.5  The Mac OS X projects currently have reliance on the following dependencies:
     6.6  
     6.7 +  -CoreVideo.framework
     6.8    -AudioToolbox.framework
     6.9    -AudioUnit.framework
    6.10    -Cocoa.framework
     7.1 --- a/premake/projects/SDL2.lua	Thu Aug 21 23:22:46 2014 -0400
     7.2 +++ b/premake/projects/SDL2.lua	Sat Aug 23 10:47:50 2014 -0700
     7.3 @@ -213,6 +213,7 @@
     7.4  		}
     7.5  		SDL_links
     7.6  		{
     7.7 +			"CoreVideo.framework",
     7.8  			"AudioToolbox.framework",
     7.9  			"AudioUnit.framework",
    7.10  			"Cocoa.framework",
     8.1 --- a/src/video/cocoa/SDL_cocoamodes.m	Thu Aug 21 23:22:46 2014 -0400
     8.2 +++ b/src/video/cocoa/SDL_cocoamodes.m	Sat Aug 23 10:47:50 2014 -0700
     8.3 @@ -27,6 +27,10 @@
     8.4  /* We need this for IODisplayCreateInfoDictionary and kIODisplayOnlyPreferredName */
     8.5  #include <IOKit/graphics/IOGraphicsLib.h>
     8.6  
     8.7 +/* We need this for CVDisplayLinkGetNominalOutputVideoRefreshPeriod */
     8.8 +#include <CoreVideo/CVBase.h>
     8.9 +#include <CoreVideo/CVDisplayLink.h>
    8.10 +
    8.11  /* we need this for ShowMenuBar() and HideMenuBar(). */
    8.12  #include <Carbon/Carbon.h>
    8.13  
    8.14 @@ -114,7 +118,7 @@
    8.15  }
    8.16  
    8.17  static SDL_bool
    8.18 -GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
    8.19 +GetDisplayMode(_THIS, const void *moderef, CVDisplayLinkRef link, SDL_DisplayMode *mode)
    8.20  {
    8.21      SDL_DisplayModeData *data;
    8.22      long width = 0;
    8.23 @@ -133,7 +137,7 @@
    8.24          CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
    8.25          width = (long) CGDisplayModeGetWidth(vidmode);
    8.26          height = (long) CGDisplayModeGetHeight(vidmode);
    8.27 -        refreshRate = (long) CGDisplayModeGetRefreshRate(vidmode);
    8.28 +        refreshRate = (long) (CGDisplayModeGetRefreshRate(vidmode) + 0.5);
    8.29  
    8.30          if (CFStringCompare(fmt, CFSTR(IO32BitDirectPixels),
    8.31                              kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
    8.32 @@ -141,6 +145,9 @@
    8.33          } else if (CFStringCompare(fmt, CFSTR(IO16BitDirectPixels),
    8.34                              kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
    8.35              bpp = 16;
    8.36 +        } else if (CFStringCompare(fmt, CFSTR(kIO30BitDirectPixels),
    8.37 +                            kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
    8.38 +            bpp = 30;
    8.39          } else {
    8.40              bpp = 0;  /* ignore 8-bit and such for now. */
    8.41          }
    8.42 @@ -151,6 +158,7 @@
    8.43      #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
    8.44      if (!IS_SNOW_LEOPARD_OR_LATER()) {
    8.45          CFNumberRef number;
    8.46 +        double refresh;
    8.47          CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
    8.48          number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
    8.49          CFNumberGetValue(number, kCFNumberLongType, &width);
    8.50 @@ -159,15 +167,27 @@
    8.51          number = CFDictionaryGetValue(vidmode, kCGDisplayBitsPerPixel);
    8.52          CFNumberGetValue(number, kCFNumberLongType, &bpp);
    8.53          number = CFDictionaryGetValue(vidmode, kCGDisplayRefreshRate);
    8.54 -        CFNumberGetValue(number, kCFNumberLongType, &refreshRate);
    8.55 +        CFNumberGetValue(number, kCFNumberDoubleType, &refresh);
    8.56 +        refreshRate = (long) (refresh + 0.5);
    8.57      }
    8.58      #endif
    8.59  
    8.60 +    /* CGDisplayModeGetRefreshRate returns 0 for many non-CRT displays. */
    8.61 +    if (refreshRate == 0 && link != NULL) {
    8.62 +        CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link);
    8.63 +        if ((time.flags & kCVTimeIsIndefinite) == 0 && time.timeValue != 0) {
    8.64 +            refreshRate = (long) ((time.timeScale / (double) time.timeValue) + 0.5);
    8.65 +        }
    8.66 +    }
    8.67 +
    8.68      mode->format = SDL_PIXELFORMAT_UNKNOWN;
    8.69      switch (bpp) {
    8.70      case 16:
    8.71          mode->format = SDL_PIXELFORMAT_ARGB1555;
    8.72          break;
    8.73 +    case 30:
    8.74 +        mode->format = SDL_PIXELFORMAT_ARGB2101010;
    8.75 +        break;
    8.76      case 32:
    8.77          mode->format = SDL_PIXELFORMAT_ARGB8888;
    8.78          break;
    8.79 @@ -241,6 +261,7 @@
    8.80              SDL_DisplayData *displaydata;
    8.81              SDL_DisplayMode mode;
    8.82              const void *moderef = NULL;
    8.83 +            CVDisplayLinkRef link = NULL;
    8.84  
    8.85              if (pass == 0) {
    8.86                  if (!CGDisplayIsMain(displays[i])) {
    8.87 @@ -277,16 +298,21 @@
    8.88              }
    8.89              displaydata->display = displays[i];
    8.90  
    8.91 +            CVDisplayLinkCreateWithCGDisplay(displays[i], &link);
    8.92 +
    8.93              SDL_zero(display);
    8.94              /* this returns a stddup'ed string */
    8.95              display.name = (char *)Cocoa_GetDisplayName(displays[i]);
    8.96 -            if (!GetDisplayMode (_this, moderef, &mode)) {
    8.97 +            if (!GetDisplayMode(_this, moderef, link, &mode)) {
    8.98 +                CVDisplayLinkRelease(link);
    8.99                  Cocoa_ReleaseDisplayMode(_this, moderef);
   8.100                  SDL_free(display.name);
   8.101                  SDL_free(displaydata);
   8.102                  continue;
   8.103              }
   8.104  
   8.105 +            CVDisplayLinkRelease(link);
   8.106 +
   8.107              display.desktop_mode = mode;
   8.108              display.current_mode = mode;
   8.109              display.driverdata = displaydata;
   8.110 @@ -328,13 +354,16 @@
   8.111      #endif
   8.112  
   8.113      if (modes) {
   8.114 +        CVDisplayLinkRef link = NULL;
   8.115          const CFIndex count = CFArrayGetCount(modes);
   8.116          CFIndex i;
   8.117  
   8.118 +        CVDisplayLinkCreateWithCGDisplay(data->display, &link);
   8.119 +
   8.120          for (i = 0; i < count; i++) {
   8.121              const void *moderef = CFArrayGetValueAtIndex(modes, i);
   8.122              SDL_DisplayMode mode;
   8.123 -            if (GetDisplayMode(_this, moderef, &mode)) {
   8.124 +            if (GetDisplayMode(_this, moderef, link, &mode)) {
   8.125                  if (IS_SNOW_LEOPARD_OR_LATER()) {
   8.126                      CGDisplayModeRetain((CGDisplayModeRef) moderef);
   8.127                  }
   8.128 @@ -342,6 +371,7 @@
   8.129              }
   8.130          }
   8.131  
   8.132 +        CVDisplayLinkRelease(link);
   8.133          Cocoa_ReleaseDisplayModeList(_this, modes);
   8.134      }
   8.135  }