Initial Apple TV / tvOS support.
authorAlex Szpakowski <slime73@gmail.com>
Tue, 13 Sep 2016 22:18:06 -0300
changeset 103405724f5087acd
parent 10339 826c707b4e7d
child 10341 75ac5b0ed013
Initial Apple TV / tvOS support.

The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.

A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
Xcode-iOS/Demos/src/common.h
Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
include/SDL_hints.h
include/SDL_platform.h
src/SDL.c
src/audio/coreaudio/SDL_coreaudio.c
src/joystick/iphoneos/SDL_sysjoystick.m
src/power/uikit/SDL_syspower.m
src/render/software/SDL_rotate.c
src/video/uikit/SDL_uikitappdelegate.h
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitclipboard.m
src/video/uikit/SDL_uikitmodes.m
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitview.m
src/video/uikit/SDL_uikitviewcontroller.h
src/video/uikit/SDL_uikitviewcontroller.m
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj	Tue Sep 13 19:51:10 2016 -0300
     1.2 +++ b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj	Tue Sep 13 22:18:06 2016 -0300
     1.3 @@ -10,6 +10,20 @@
     1.4  		1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
     1.5  		1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
     1.6  		1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
     1.7 +		FA30DEB01BBF5A8F009C397F /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; };
     1.8 +		FA30DEB11BBF5A93009C397F /* happy.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0080E26BC0500F39101 /* happy.c */; };
     1.9 +		FA30DEB31BBF5AD7009C397F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CC0E43D19800F688B5 /* icon.bmp */; };
    1.10 +		FA30DEB41BBF5ADD009C397F /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; };
    1.11 +		FA30DEB61BBF5AE6009C397F /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; };
    1.12 +		FA30DEB71BBF5BB8009C397F /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA30DEAC1BBF59D9009C397F /* libSDL2.a */; };
    1.13 +		FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
    1.14 +		FA30DEC91BBF5C14009C397F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; };
    1.15 +		FA30DECA1BBF5C14009C397F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; };
    1.16 +		FA30DECB1BBF5C14009C397F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; };
    1.17 +		FA30DECC1BBF5C14009C397F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
    1.18 +		FA30DECD1BBF5C14009C397F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
    1.19 +		FA30DECE1BBF5C14009C397F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
    1.20 +		FA30DECF1BBF5C14009C397F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; };
    1.21  		FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
    1.22  		FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
    1.23  		FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
    1.24 @@ -168,6 +182,20 @@
    1.25  			remoteGlobalIDString = FD6526620DE8FCCB002AD96B;
    1.26  			remoteInfo = libSDL;
    1.27  		};
    1.28 +		FA30DEAB1BBF59D9009C397F /* PBXContainerItemProxy */ = {
    1.29 +			isa = PBXContainerItemProxy;
    1.30 +			containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
    1.31 +			proxyType = 2;
    1.32 +			remoteGlobalIDString = FAB598141BB5C1B100BE72C5;
    1.33 +			remoteInfo = "libSDL-tv";
    1.34 +		};
    1.35 +		FA30DEAE1BBF5A69009C397F /* PBXContainerItemProxy */ = {
    1.36 +			isa = PBXContainerItemProxy;
    1.37 +			containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
    1.38 +			proxyType = 1;
    1.39 +			remoteGlobalIDString = FAB598131BB5C1B100BE72C5;
    1.40 +			remoteInfo = "libSDL-tv";
    1.41 +		};
    1.42  		FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = {
    1.43  			isa = PBXContainerItemProxy;
    1.44  			containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
    1.45 @@ -183,6 +211,7 @@
    1.46  		1D6058910D05DD3D006BFB54 /* Rectangles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Rectangles.app; sourceTree = BUILT_PRODUCTS_DIR; };
    1.47  		1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
    1.48  		8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
    1.49 +		FA30DE961BBF59D9009C397F /* Happy-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Happy-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
    1.50  		FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
    1.51  		FAE0E9691BAF96A00098DFA4 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
    1.52  		FD15FCB20E086866003BDF25 /* Happy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Happy.app; sourceTree = BUILT_PRODUCTS_DIR; };
    1.53 @@ -237,6 +266,22 @@
    1.54  			);
    1.55  			runOnlyForDeploymentPostprocessing = 0;
    1.56  		};
    1.57 +		FA30DE931BBF59D9009C397F /* Frameworks */ = {
    1.58 +			isa = PBXFrameworksBuildPhase;
    1.59 +			buildActionMask = 2147483647;
    1.60 +			files = (
    1.61 +				FA30DEB71BBF5BB8009C397F /* libSDL2.a in Frameworks */,
    1.62 +				FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */,
    1.63 +				FA30DEC91BBF5C14009C397F /* AudioToolbox.framework in Frameworks */,
    1.64 +				FA30DECA1BBF5C14009C397F /* QuartzCore.framework in Frameworks */,
    1.65 +				FA30DECB1BBF5C14009C397F /* OpenGLES.framework in Frameworks */,
    1.66 +				FA30DECC1BBF5C14009C397F /* CoreGraphics.framework in Frameworks */,
    1.67 +				FA30DECD1BBF5C14009C397F /* UIKit.framework in Frameworks */,
    1.68 +				FA30DECE1BBF5C14009C397F /* Foundation.framework in Frameworks */,
    1.69 +				FA30DECF1BBF5C14009C397F /* CoreAudio.framework in Frameworks */,
    1.70 +			);
    1.71 +			runOnlyForDeploymentPostprocessing = 0;
    1.72 +		};
    1.73  		FD15FCB00E086866003BDF25 /* Frameworks */ = {
    1.74  			isa = PBXFrameworksBuildPhase;
    1.75  			buildActionMask = 2147483647;
    1.76 @@ -352,6 +397,7 @@
    1.77  				FDF0D6A40E12D05400247964 /* Mixer.app */,
    1.78  				FDC52EDE0E2843D6008D768C /* Fireworks.app */,
    1.79  				FDB6520C0E43D1F300F688B5 /* Keyboard.app */,
    1.80 +				FA30DE961BBF59D9009C397F /* Happy-TV.app */,
    1.81  			);
    1.82  			name = Products;
    1.83  			sourceTree = "<group>";
    1.84 @@ -399,6 +445,7 @@
    1.85  			isa = PBXGroup;
    1.86  			children = (
    1.87  				FD1B489E0E313154007AB34E /* libSDL2.a */,
    1.88 +				FA30DEAC1BBF59D9009C397F /* libSDL2.a */,
    1.89  			);
    1.90  			name = Products;
    1.91  			sourceTree = "<group>";
    1.92 @@ -473,6 +520,24 @@
    1.93  			productReference = 1D6058910D05DD3D006BFB54 /* Rectangles.app */;
    1.94  			productType = "com.apple.product-type.application";
    1.95  		};
    1.96 +		FA30DE951BBF59D9009C397F /* Happy-TV */ = {
    1.97 +			isa = PBXNativeTarget;
    1.98 +			buildConfigurationList = FA30DEAD1BBF59D9009C397F /* Build configuration list for PBXNativeTarget "Happy-TV" */;
    1.99 +			buildPhases = (
   1.100 +				FA30DE921BBF59D9009C397F /* Sources */,
   1.101 +				FA30DE941BBF59D9009C397F /* Resources */,
   1.102 +				FA30DE931BBF59D9009C397F /* Frameworks */,
   1.103 +			);
   1.104 +			buildRules = (
   1.105 +			);
   1.106 +			dependencies = (
   1.107 +				FA30DEAF1BBF5A69009C397F /* PBXTargetDependency */,
   1.108 +			);
   1.109 +			name = "Happy-TV";
   1.110 +			productName = "Happy-TV";
   1.111 +			productReference = FA30DE961BBF59D9009C397F /* Happy-TV.app */;
   1.112 +			productType = "com.apple.product-type.application";
   1.113 +		};
   1.114  		FD15FCB10E086866003BDF25 /* Happy */ = {
   1.115  			isa = PBXNativeTarget;
   1.116  			buildConfigurationList = FD15FCB70E086867003BDF25 /* Build configuration list for PBXNativeTarget "Happy" */;
   1.117 @@ -588,6 +653,12 @@
   1.118  			isa = PBXProject;
   1.119  			attributes = {
   1.120  				LastUpgradeCheck = 0630;
   1.121 +				TargetAttributes = {
   1.122 +					FA30DE951BBF59D9009C397F = {
   1.123 +						CreatedOnToolsVersion = 7.1;
   1.124 +						DevelopmentTeam = DJN9C5VR5G;
   1.125 +					};
   1.126 +				};
   1.127  			};
   1.128  			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Demos" */;
   1.129  			compatibilityVersion = "Xcode 3.2";
   1.130 @@ -598,6 +669,7 @@
   1.131  				Japanese,
   1.132  				French,
   1.133  				German,
   1.134 +				Base,
   1.135  			);
   1.136  			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
   1.137  			projectDirPath = "";
   1.138 @@ -611,6 +683,7 @@
   1.139  			targets = (
   1.140  				1D6058900D05DD3D006BFB54 /* Rectangles */,
   1.141  				FD15FCB10E086866003BDF25 /* Happy */,
   1.142 +				FA30DE951BBF59D9009C397F /* Happy-TV */,
   1.143  				FD5F9BE30E0DEBEA008E885B /* Accel */,
   1.144  				FDC202DD0E107B1200ABAC90 /* Touch */,
   1.145  				FDF0D6920E12D05400247964 /* Mixer */,
   1.146 @@ -621,6 +694,13 @@
   1.147  /* End PBXProject section */
   1.148  
   1.149  /* Begin PBXReferenceProxy section */
   1.150 +		FA30DEAC1BBF59D9009C397F /* libSDL2.a */ = {
   1.151 +			isa = PBXReferenceProxy;
   1.152 +			fileType = archive.ar;
   1.153 +			path = libSDL2.a;
   1.154 +			remoteRef = FA30DEAB1BBF59D9009C397F /* PBXContainerItemProxy */;
   1.155 +			sourceTree = BUILT_PRODUCTS_DIR;
   1.156 +		};
   1.157  		FD1B489E0E313154007AB34E /* libSDL2.a */ = {
   1.158  			isa = PBXReferenceProxy;
   1.159  			fileType = archive.ar;
   1.160 @@ -640,6 +720,16 @@
   1.161  			);
   1.162  			runOnlyForDeploymentPostprocessing = 0;
   1.163  		};
   1.164 +		FA30DE941BBF59D9009C397F /* Resources */ = {
   1.165 +			isa = PBXResourcesBuildPhase;
   1.166 +			buildActionMask = 2147483647;
   1.167 +			files = (
   1.168 +				FA30DEB31BBF5AD7009C397F /* icon.bmp in Resources */,
   1.169 +				FA30DEB41BBF5ADD009C397F /* Icon.png in Resources */,
   1.170 +				FA30DEB61BBF5AE6009C397F /* Default.png in Resources */,
   1.171 +			);
   1.172 +			runOnlyForDeploymentPostprocessing = 0;
   1.173 +		};
   1.174  		FD15FCAE0E086866003BDF25 /* Resources */ = {
   1.175  			isa = PBXResourcesBuildPhase;
   1.176  			buildActionMask = 2147483647;
   1.177 @@ -717,6 +807,15 @@
   1.178  			);
   1.179  			runOnlyForDeploymentPostprocessing = 0;
   1.180  		};
   1.181 +		FA30DE921BBF59D9009C397F /* Sources */ = {
   1.182 +			isa = PBXSourcesBuildPhase;
   1.183 +			buildActionMask = 2147483647;
   1.184 +			files = (
   1.185 +				FA30DEB01BBF5A8F009C397F /* common.c in Sources */,
   1.186 +				FA30DEB11BBF5A93009C397F /* happy.c in Sources */,
   1.187 +			);
   1.188 +			runOnlyForDeploymentPostprocessing = 0;
   1.189 +		};
   1.190  		FD15FCAF0E086866003BDF25 /* Sources */ = {
   1.191  			isa = PBXSourcesBuildPhase;
   1.192  			buildActionMask = 2147483647;
   1.193 @@ -809,6 +908,11 @@
   1.194  			name = libSDL;
   1.195  			targetProxy = 049F36A0130CD8A000FF080F /* PBXContainerItemProxy */;
   1.196  		};
   1.197 +		FA30DEAF1BBF5A69009C397F /* PBXTargetDependency */ = {
   1.198 +			isa = PBXTargetDependency;
   1.199 +			name = "libSDL-tv";
   1.200 +			targetProxy = FA30DEAE1BBF5A69009C397F /* PBXContainerItemProxy */;
   1.201 +		};
   1.202  /* End PBXTargetDependency section */
   1.203  
   1.204  /* Begin XCBuildConfiguration section */
   1.205 @@ -852,6 +956,92 @@
   1.206  			};
   1.207  			name = Release;
   1.208  		};
   1.209 +		FA30DEA71BBF59D9009C397F /* Debug */ = {
   1.210 +			isa = XCBuildConfiguration;
   1.211 +			buildSettings = {
   1.212 +				ALWAYS_SEARCH_USER_PATHS = NO;
   1.213 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   1.214 +				CLANG_CXX_LIBRARY = "libc++";
   1.215 +				CLANG_ENABLE_MODULES = YES;
   1.216 +				CLANG_ENABLE_OBJC_ARC = YES;
   1.217 +				CLANG_WARN_BOOL_CONVERSION = YES;
   1.218 +				CLANG_WARN_CONSTANT_CONVERSION = YES;
   1.219 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   1.220 +				CLANG_WARN_EMPTY_BODY = YES;
   1.221 +				CLANG_WARN_ENUM_CONVERSION = YES;
   1.222 +				CLANG_WARN_INT_CONVERSION = YES;
   1.223 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   1.224 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   1.225 +				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   1.226 +				COPY_PHASE_STRIP = NO;
   1.227 +				DEBUG_INFORMATION_FORMAT = dwarf;
   1.228 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   1.229 +				ENABLE_TESTABILITY = YES;
   1.230 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   1.231 +				GCC_DYNAMIC_NO_PIC = NO;
   1.232 +				GCC_NO_COMMON_BLOCKS = YES;
   1.233 +				GCC_PREPROCESSOR_DEFINITIONS = (
   1.234 +					"DEBUG=1",
   1.235 +					"$(inherited)",
   1.236 +				);
   1.237 +				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   1.238 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   1.239 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   1.240 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   1.241 +				GCC_WARN_UNUSED_FUNCTION = YES;
   1.242 +				GCC_WARN_UNUSED_VARIABLE = YES;
   1.243 +				INFOPLIST_FILE = Info.plist;
   1.244 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
   1.245 +				MTL_ENABLE_DEBUG_INFO = YES;
   1.246 +				PRODUCT_BUNDLE_IDENTIFIER = "com.Happy-TV";
   1.247 +				PRODUCT_NAME = "$(TARGET_NAME)";
   1.248 +				SDKROOT = appletvos;
   1.249 +				TARGETED_DEVICE_FAMILY = 3;
   1.250 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   1.251 +			};
   1.252 +			name = Debug;
   1.253 +		};
   1.254 +		FA30DEA81BBF59D9009C397F /* Release */ = {
   1.255 +			isa = XCBuildConfiguration;
   1.256 +			buildSettings = {
   1.257 +				ALWAYS_SEARCH_USER_PATHS = NO;
   1.258 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   1.259 +				CLANG_CXX_LIBRARY = "libc++";
   1.260 +				CLANG_ENABLE_MODULES = YES;
   1.261 +				CLANG_ENABLE_OBJC_ARC = YES;
   1.262 +				CLANG_WARN_BOOL_CONVERSION = YES;
   1.263 +				CLANG_WARN_CONSTANT_CONVERSION = YES;
   1.264 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   1.265 +				CLANG_WARN_EMPTY_BODY = YES;
   1.266 +				CLANG_WARN_ENUM_CONVERSION = YES;
   1.267 +				CLANG_WARN_INT_CONVERSION = YES;
   1.268 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   1.269 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   1.270 +				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   1.271 +				COPY_PHASE_STRIP = NO;
   1.272 +				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
   1.273 +				ENABLE_NS_ASSERTIONS = NO;
   1.274 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   1.275 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   1.276 +				GCC_NO_COMMON_BLOCKS = YES;
   1.277 +				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   1.278 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   1.279 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   1.280 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   1.281 +				GCC_WARN_UNUSED_FUNCTION = YES;
   1.282 +				GCC_WARN_UNUSED_VARIABLE = YES;
   1.283 +				INFOPLIST_FILE = Info.plist;
   1.284 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
   1.285 +				MTL_ENABLE_DEBUG_INFO = NO;
   1.286 +				PRODUCT_BUNDLE_IDENTIFIER = "com.Happy-TV";
   1.287 +				PRODUCT_NAME = "$(TARGET_NAME)";
   1.288 +				SDKROOT = appletvos;
   1.289 +				TARGETED_DEVICE_FAMILY = 3;
   1.290 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   1.291 +				VALIDATE_PRODUCT = YES;
   1.292 +			};
   1.293 +			name = Release;
   1.294 +		};
   1.295  		FD15FCB50E086866003BDF25 /* Debug */ = {
   1.296  			isa = XCBuildConfiguration;
   1.297  			buildSettings = {
   1.298 @@ -982,6 +1172,15 @@
   1.299  			defaultConfigurationIsVisible = 0;
   1.300  			defaultConfigurationName = Release;
   1.301  		};
   1.302 +		FA30DEAD1BBF59D9009C397F /* Build configuration list for PBXNativeTarget "Happy-TV" */ = {
   1.303 +			isa = XCConfigurationList;
   1.304 +			buildConfigurations = (
   1.305 +				FA30DEA71BBF59D9009C397F /* Debug */,
   1.306 +				FA30DEA81BBF59D9009C397F /* Release */,
   1.307 +			);
   1.308 +			defaultConfigurationIsVisible = 0;
   1.309 +			defaultConfigurationName = Release;
   1.310 +		};
   1.311  		FD15FCB70E086867003BDF25 /* Build configuration list for PBXNativeTarget "Happy" */ = {
   1.312  			isa = XCConfigurationList;
   1.313  			buildConfigurations = (
     2.1 --- a/Xcode-iOS/Demos/src/common.h	Tue Sep 13 19:51:10 2016 -0300
     2.2 +++ b/Xcode-iOS/Demos/src/common.h	Tue Sep 13 22:18:06 2016 -0300
     2.3 @@ -4,8 +4,13 @@
     2.4   *  use however you want
     2.5   */
     2.6  
     2.7 +#if __TVOS__
     2.8 +#define SCREEN_WIDTH 1920
     2.9 +#define SCREEN_HEIGHT 1080
    2.10 +#else
    2.11  #define SCREEN_WIDTH 320
    2.12  #define SCREEN_HEIGHT 480
    2.13 +#endif
    2.14  
    2.15  extern int randomInt(int min, int max);
    2.16  extern float randomFloat(float min, float max);
     3.1 --- a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Tue Sep 13 19:51:10 2016 -0300
     3.2 +++ b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Tue Sep 13 22:18:06 2016 -0300
     3.3 @@ -145,7 +145,102 @@
     3.4  		AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */; };
     3.5  		FA1DC2721C62BE65008F99A0 /* SDL_uikitclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = FA1DC2701C62BE65008F99A0 /* SDL_uikitclipboard.h */; };
     3.6  		FA1DC2731C62BE65008F99A0 /* SDL_uikitclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */; };
     3.7 +		FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; };
     3.8 +		FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; };
     3.9 +		FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; };
    3.10 +		FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */; };
    3.11 +		FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */; };
    3.12 +		FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */; };
    3.13 +		FAB598271BB5C31500BE72C5 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */; };
    3.14 +		FAB598281BB5C31500BE72C5 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */; };
    3.15 +		FAB5982A1BB5C31500BE72C5 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */; };
    3.16 +		FAB5982C1BB5C31500BE72C5 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */; };
    3.17 +		FAB5982F1BB5C31500BE72C5 /* SDL_dynapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 56A6703318565E760007D20F /* SDL_dynapi.c */; };
    3.18 +		FAB598361BB5C31500BE72C5 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; };
    3.19 +		FAB598381BB5C31500BE72C5 /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */; };
    3.20 +		FAB5983A1BB5C31500BE72C5 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9930DD52EDC00FB1D6B /* SDL_events.c */; };
    3.21 +		FAB5983C1BB5C31500BE72C5 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */; };
    3.22 +		FAB5983E1BB5C31500BE72C5 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */; };
    3.23 +		FAB598401BB5C31500BE72C5 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */; };
    3.24 +		FAB598421BB5C31500BE72C5 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */; };
    3.25 +		FAB598441BB5C31500BE72C5 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; };
    3.26 +		FAB598461BB5C31500BE72C5 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */; };
    3.27 +		FAB598491BB5C31600BE72C5 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */; };
    3.28 +		FAB5984A1BB5C31600BE72C5 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */; };
    3.29 +		FAB5984B1BB5C31600BE72C5 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */; };
    3.30 +		FAB5984C1BB5C31600BE72C5 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */; };
    3.31 +		FAB5984D1BB5C31600BE72C5 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B90EA76A31008ABAF1 /* SDL_haptic.c */; };
    3.32 +		FAB598501BB5C31600BE72C5 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */; };
    3.33 +		FAB598511BB5C31600BE72C5 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */; };
    3.34 +		FAB598521BB5C31600BE72C5 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */; };
    3.35 +		FAB598551BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */; };
    3.36 +		FAB598561BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */; };
    3.37 +		FAB598571BB5C31600BE72C5 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; };
    3.38 +		FAB598581BB5C31600BE72C5 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
    3.39 +		FAB598591BB5C31600BE72C5 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5212FE1C28004C9285 /* SDL_render_gles.c */; };
    3.40 +		FAB5985A1BB5C31600BE72C5 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */; };
    3.41 +		FAB5985B1BB5C31600BE72C5 /* SDL_shaders_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */; };
    3.42 +		FAB5985D1BB5C31600BE72C5 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */; };
    3.43 +		FAB5985F1BB5C31600BE72C5 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806C12FB751400FC43C0 /* SDL_blendline.c */; };
    3.44 +		FAB598611BB5C31600BE72C5 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */; };
    3.45 +		FAB598641BB5C31600BE72C5 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807112FB751400FC43C0 /* SDL_drawline.c */; };
    3.46 +		FAB598661BB5C31600BE72C5 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */; };
    3.47 +		FAB598681BB5C31600BE72C5 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */; };
    3.48 +		FAB5986A1BB5C31600BE72C5 /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
    3.49 +		FAB5986D1BB5C31600BE72C5 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CEA12FA0F680087D585 /* SDL_render.c */; };
    3.50 +		FAB5986F1BB5C31600BE72C5 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; };
    3.51 +		FAB598711BB5C31600BE72C5 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; };
    3.52 +		FAB598721BB5C31600BE72C5 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; };
    3.53 +		FAB598731BB5C31600BE72C5 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; };
    3.54 +		FAB598741BB5C31600BE72C5 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; };
    3.55 +		FAB598751BB5C31600BE72C5 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A730DEA620800C5B771 /* SDL_qsort.c */; };
    3.56 +		FAB598761BB5C31600BE72C5 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */; };
    3.57 +		FAB598771BB5C31600BE72C5 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A750DEA620800C5B771 /* SDL_string.c */; };
    3.58 +		FAB598781BB5C31600BE72C5 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */; };
    3.59 +		FAB598791BB5C31600BE72C5 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */; };
    3.60 +		FAB5987B1BB5C31600BE72C5 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */; };
    3.61 +		FAB5987C1BB5C31600BE72C5 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */; };
    3.62 +		FAB5987E1BB5C31600BE72C5 /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8494178D5F1A00823F9D /* SDL_systls.c */; };
    3.63 +		FAB598801BB5C31600BE72C5 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */; };
    3.64 +		FAB598821BB5C31600BE72C5 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */; };
    3.65 +		FAB598831BB5C31600BE72C5 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */; };
    3.66 +		FAB598871BB5C31600BE72C5 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */; };
    3.67 +		FAB598891BB5C31600BE72C5 /* SDL_uikitevents.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */; };
    3.68 +		FAB5988B1BB5C31600BE72C5 /* SDL_uikitmessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */; };
    3.69 +		FAB5988D1BB5C31600BE72C5 /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; };
    3.70 +		FAB5988F1BB5C31600BE72C5 /* SDL_uikitopengles.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */; };
    3.71 +		FAB598911BB5C31600BE72C5 /* SDL_uikitopenglview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */; };
    3.72 +		FAB598931BB5C31600BE72C5 /* SDL_uikitvideo.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */; };
    3.73 +		FAB598951BB5C31600BE72C5 /* SDL_uikitview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F130E26E5D900F90B21 /* SDL_uikitview.m */; };
    3.74 +		FAB598971BB5C31600BE72C5 /* SDL_uikitviewcontroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */; };
    3.75 +		FAB598991BB5C31600BE72C5 /* SDL_uikitwindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */; };
    3.76 +		FAB5989A1BB5C31600BE72C5 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F50DF244C800F98A1A /* SDL_nullevents.c */; };
    3.77 +		FAB5989D1BB5C31600BE72C5 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */; };
    3.78 +		FAB5989E1BB5C31600BE72C5 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */; };
    3.79 +		FAB598A01BB5C31600BE72C5 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683000DF2374E00F98A1A /* SDL_blit.c */; };
    3.80 +		FAB598A21BB5C31600BE72C5 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683020DF2374E00F98A1A /* SDL_blit_0.c */; };
    3.81 +		FAB598A31BB5C31600BE72C5 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683030DF2374E00F98A1A /* SDL_blit_1.c */; };
    3.82 +		FAB598A41BB5C31600BE72C5 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683040DF2374E00F98A1A /* SDL_blit_A.c */; };
    3.83 +		FAB598A51BB5C31600BE72C5 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */; };
    3.84 +		FAB598A71BB5C31600BE72C5 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */; };
    3.85 +		FAB598A91BB5C31600BE72C5 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683090DF2374E00F98A1A /* SDL_blit_N.c */; };
    3.86 +		FAB598AA1BB5C31600BE72C5 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */; };
    3.87 +		FAB598AC1BB5C31600BE72C5 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */; };
    3.88 +		FAB598AD1BB5C31600BE72C5 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 044E5FB711E606EB0076F181 /* SDL_clipboard.c */; };
    3.89 +		FAB598AE1BB5C31600BE72C5 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */; };
    3.90 +		FAB598AF1BB5C31600BE72C5 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */; };
    3.91 +		FAB598B11BB5C31600BE72C5 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683110DF2374E00F98A1A /* SDL_rect.c */; };
    3.92 +		FAB598B21BB5C31600BE72C5 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */; };
    3.93 +		FAB598B41BB5C31600BE72C5 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683170DF2374E00F98A1A /* SDL_stretch.c */; };
    3.94 +		FAB598B51BB5C31600BE72C5 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683190DF2374E00F98A1A /* SDL_surface.c */; };
    3.95 +		FAB598B71BB5C31600BE72C5 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6831B0DF2374E00F98A1A /* SDL_video.c */; };
    3.96 +		FAB598B91BB5C31600BE72C5 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; };
    3.97 +		FAB598BC1BB5C31600BE72C5 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */; };
    3.98 +		FAB598BD1BB5C31600BE72C5 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5412FE1C3F004C9285 /* SDL_hints.c */; };
    3.99 +		FAB598BE1BB5C31600BE72C5 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC09B1300C1290055DE28 /* SDL_log.c */; };
   3.100 +		FAB598BF1BB5C31600BE72C5 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D80DD52EDC00FB1D6B /* SDL.c */; };
   3.101  		FAD4F7021BA3C4E8008346CE /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */; };
   3.102 +		FAFDF8C61D88D4530083E6F2 /* SDL_uikitclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */; };
   3.103  		FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; };
   3.104  		FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; };
   3.105  		FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; };
   3.106 @@ -344,6 +439,7 @@
   3.107  		AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = "<group>"; };
   3.108  		FA1DC2701C62BE65008F99A0 /* SDL_uikitclipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitclipboard.h; sourceTree = "<group>"; };
   3.109  		FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitclipboard.m; sourceTree = "<group>"; };
   3.110 +		FAB598141BB5C1B100BE72C5 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; };
   3.111  		FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick_c.h; sourceTree = "<group>"; };
   3.112  		FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitview.h; sourceTree = "<group>"; };
   3.113  		FD3F4A700DEA620800C5B771 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = "<group>"; };
   3.114 @@ -549,6 +645,7 @@
   3.115  			isa = PBXGroup;
   3.116  			children = (
   3.117  				FD6526630DE8FCCB002AD96B /* libSDL2.a */,
   3.118 +				FAB598141BB5C1B100BE72C5 /* libSDL2.a */,
   3.119  			);
   3.120  			name = Products;
   3.121  			sourceTree = "<group>";
   3.122 @@ -1069,6 +1166,21 @@
   3.123  /* End PBXHeadersBuildPhase section */
   3.124  
   3.125  /* Begin PBXNativeTarget section */
   3.126 +		FAB598131BB5C1B100BE72C5 /* libSDL-tv */ = {
   3.127 +			isa = PBXNativeTarget;
   3.128 +			buildConfigurationList = FAB5981A1BB5C1B100BE72C5 /* Build configuration list for PBXNativeTarget "libSDL-tv" */;
   3.129 +			buildPhases = (
   3.130 +				FAB598101BB5C1B100BE72C5 /* Sources */,
   3.131 +			);
   3.132 +			buildRules = (
   3.133 +			);
   3.134 +			dependencies = (
   3.135 +			);
   3.136 +			name = "libSDL-tv";
   3.137 +			productName = "libSDL-tv";
   3.138 +			productReference = FAB598141BB5C1B100BE72C5 /* libSDL2.a */;
   3.139 +			productType = "com.apple.product-type.library.static";
   3.140 +		};
   3.141  		FD6526620DE8FCCB002AD96B /* libSDL */ = {
   3.142  			isa = PBXNativeTarget;
   3.143  			buildConfigurationList = FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */;
   3.144 @@ -1092,6 +1204,11 @@
   3.145  			isa = PBXProject;
   3.146  			attributes = {
   3.147  				LastUpgradeCheck = 0800;
   3.148 +				TargetAttributes = {
   3.149 +					FAB598131BB5C1B100BE72C5 = {
   3.150 +						CreatedOnToolsVersion = 7.1;
   3.151 +					};
   3.152 +				};
   3.153  			};
   3.154  			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDL" */;
   3.155  			compatibilityVersion = "Xcode 3.2";
   3.156 @@ -1108,6 +1225,7 @@
   3.157  			projectRoot = ../..;
   3.158  			targets = (
   3.159  				FD6526620DE8FCCB002AD96B /* libSDL */,
   3.160 +				FAB598131BB5C1B100BE72C5 /* libSDL-tv */,
   3.161  				00B4F48B12F6A69C0084EC00 /* PrepareXcodeProjectTemplate */,
   3.162  			);
   3.163  		};
   3.164 @@ -1131,6 +1249,108 @@
   3.165  /* End PBXShellScriptBuildPhase section */
   3.166  
   3.167  /* Begin PBXSourcesBuildPhase section */
   3.168 +		FAB598101BB5C1B100BE72C5 /* Sources */ = {
   3.169 +			isa = PBXSourcesBuildPhase;
   3.170 +			buildActionMask = 2147483647;
   3.171 +			files = (
   3.172 +				FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */,
   3.173 +				FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */,
   3.174 +				FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.c in Sources */,
   3.175 +				FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */,
   3.176 +				FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */,
   3.177 +				FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */,
   3.178 +				FAB598271BB5C31500BE72C5 /* SDL_audiotypecvt.c in Sources */,
   3.179 +				FAB598281BB5C31500BE72C5 /* SDL_mixer.c in Sources */,
   3.180 +				FAB5982A1BB5C31500BE72C5 /* SDL_wave.c in Sources */,
   3.181 +				FAFDF8C61D88D4530083E6F2 /* SDL_uikitclipboard.m in Sources */,
   3.182 +				FAB5982C1BB5C31500BE72C5 /* SDL_cpuinfo.c in Sources */,
   3.183 +				FAB5982F1BB5C31500BE72C5 /* SDL_dynapi.c in Sources */,
   3.184 +				FAB598361BB5C31500BE72C5 /* SDL_clipboardevents.c in Sources */,
   3.185 +				FAB598381BB5C31500BE72C5 /* SDL_dropevents.c in Sources */,
   3.186 +				FAB5983A1BB5C31500BE72C5 /* SDL_events.c in Sources */,
   3.187 +				FAB5983C1BB5C31500BE72C5 /* SDL_gesture.c in Sources */,
   3.188 +				FAB5983E1BB5C31500BE72C5 /* SDL_keyboard.c in Sources */,
   3.189 +				FAB598401BB5C31500BE72C5 /* SDL_mouse.c in Sources */,
   3.190 +				FAB598421BB5C31500BE72C5 /* SDL_quit.c in Sources */,
   3.191 +				FAB598441BB5C31500BE72C5 /* SDL_touch.c in Sources */,
   3.192 +				FAB598461BB5C31500BE72C5 /* SDL_windowevents.c in Sources */,
   3.193 +				FAB598491BB5C31600BE72C5 /* SDL_rwopsbundlesupport.m in Sources */,
   3.194 +				FAB5984A1BB5C31600BE72C5 /* SDL_rwops.c in Sources */,
   3.195 +				FAB5984B1BB5C31600BE72C5 /* SDL_sysfilesystem.m in Sources */,
   3.196 +				FAB5984C1BB5C31600BE72C5 /* SDL_syshaptic.c in Sources */,
   3.197 +				FAB5984D1BB5C31600BE72C5 /* SDL_haptic.c in Sources */,
   3.198 +				FAB598501BB5C31600BE72C5 /* SDL_sysjoystick.m in Sources */,
   3.199 +				FAB598511BB5C31600BE72C5 /* SDL_gamecontroller.c in Sources */,
   3.200 +				FAB598521BB5C31600BE72C5 /* SDL_joystick.c in Sources */,
   3.201 +				FAB598551BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */,
   3.202 +				FAB598561BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */,
   3.203 +				FAB598571BB5C31600BE72C5 /* SDL_power.c in Sources */,
   3.204 +				FAB598581BB5C31600BE72C5 /* SDL_syspower.m in Sources */,
   3.205 +				FAB598591BB5C31600BE72C5 /* SDL_render_gles.c in Sources */,
   3.206 +				FAB5985A1BB5C31600BE72C5 /* SDL_render_gles2.c in Sources */,
   3.207 +				FAB5985B1BB5C31600BE72C5 /* SDL_shaders_gles2.c in Sources */,
   3.208 +				FAB5985D1BB5C31600BE72C5 /* SDL_blendfillrect.c in Sources */,
   3.209 +				FAB5985F1BB5C31600BE72C5 /* SDL_blendline.c in Sources */,
   3.210 +				FAB598611BB5C31600BE72C5 /* SDL_blendpoint.c in Sources */,
   3.211 +				FAB598641BB5C31600BE72C5 /* SDL_drawline.c in Sources */,
   3.212 +				FAB598661BB5C31600BE72C5 /* SDL_drawpoint.c in Sources */,
   3.213 +				FAB598681BB5C31600BE72C5 /* SDL_render_sw.c in Sources */,
   3.214 +				FAB5986A1BB5C31600BE72C5 /* SDL_rotate.c in Sources */,
   3.215 +				FAB5986D1BB5C31600BE72C5 /* SDL_render.c in Sources */,
   3.216 +				FAB5986F1BB5C31600BE72C5 /* SDL_yuv_mmx.c in Sources */,
   3.217 +				FAB598711BB5C31600BE72C5 /* SDL_yuv_sw.c in Sources */,
   3.218 +				FAB598721BB5C31600BE72C5 /* SDL_getenv.c in Sources */,
   3.219 +				FAB598731BB5C31600BE72C5 /* SDL_iconv.c in Sources */,
   3.220 +				FAB598741BB5C31600BE72C5 /* SDL_malloc.c in Sources */,
   3.221 +				FAB598751BB5C31600BE72C5 /* SDL_qsort.c in Sources */,
   3.222 +				FAB598761BB5C31600BE72C5 /* SDL_stdlib.c in Sources */,
   3.223 +				FAB598771BB5C31600BE72C5 /* SDL_string.c in Sources */,
   3.224 +				FAB598781BB5C31600BE72C5 /* SDL_syscond.c in Sources */,
   3.225 +				FAB598791BB5C31600BE72C5 /* SDL_sysmutex.c in Sources */,
   3.226 +				FAB5987B1BB5C31600BE72C5 /* SDL_syssem.c in Sources */,
   3.227 +				FAB5987C1BB5C31600BE72C5 /* SDL_systhread.c in Sources */,
   3.228 +				FAB5987E1BB5C31600BE72C5 /* SDL_systls.c in Sources */,
   3.229 +				FAB598801BB5C31600BE72C5 /* SDL_thread.c in Sources */,
   3.230 +				FAB598821BB5C31600BE72C5 /* SDL_systimer.c in Sources */,
   3.231 +				FAB598831BB5C31600BE72C5 /* SDL_timer.c in Sources */,
   3.232 +				FAB598871BB5C31600BE72C5 /* SDL_uikitappdelegate.m in Sources */,
   3.233 +				FAB598891BB5C31600BE72C5 /* SDL_uikitevents.m in Sources */,
   3.234 +				FAB5988B1BB5C31600BE72C5 /* SDL_uikitmessagebox.m in Sources */,
   3.235 +				FAB5988D1BB5C31600BE72C5 /* SDL_uikitmodes.m in Sources */,
   3.236 +				FAB5988F1BB5C31600BE72C5 /* SDL_uikitopengles.m in Sources */,
   3.237 +				FAB598911BB5C31600BE72C5 /* SDL_uikitopenglview.m in Sources */,
   3.238 +				FAB598931BB5C31600BE72C5 /* SDL_uikitvideo.m in Sources */,
   3.239 +				FAB598951BB5C31600BE72C5 /* SDL_uikitview.m in Sources */,
   3.240 +				FAB598971BB5C31600BE72C5 /* SDL_uikitviewcontroller.m in Sources */,
   3.241 +				FAB598991BB5C31600BE72C5 /* SDL_uikitwindow.m in Sources */,
   3.242 +				FAB5989A1BB5C31600BE72C5 /* SDL_nullevents.c in Sources */,
   3.243 +				FAB5989D1BB5C31600BE72C5 /* SDL_nullframebuffer.c in Sources */,
   3.244 +				FAB5989E1BB5C31600BE72C5 /* SDL_nullvideo.c in Sources */,
   3.245 +				FAB598A01BB5C31600BE72C5 /* SDL_blit.c in Sources */,
   3.246 +				FAB598A21BB5C31600BE72C5 /* SDL_blit_0.c in Sources */,
   3.247 +				FAB598A31BB5C31600BE72C5 /* SDL_blit_1.c in Sources */,
   3.248 +				FAB598A41BB5C31600BE72C5 /* SDL_blit_A.c in Sources */,
   3.249 +				FAB598A51BB5C31600BE72C5 /* SDL_blit_auto.c in Sources */,
   3.250 +				FAB598A71BB5C31600BE72C5 /* SDL_blit_copy.c in Sources */,
   3.251 +				FAB598A91BB5C31600BE72C5 /* SDL_blit_N.c in Sources */,
   3.252 +				FAB598AA1BB5C31600BE72C5 /* SDL_blit_slow.c in Sources */,
   3.253 +				FAB598AC1BB5C31600BE72C5 /* SDL_bmp.c in Sources */,
   3.254 +				FAB598AD1BB5C31600BE72C5 /* SDL_clipboard.c in Sources */,
   3.255 +				FAB598AE1BB5C31600BE72C5 /* SDL_fillrect.c in Sources */,
   3.256 +				FAB598AF1BB5C31600BE72C5 /* SDL_pixels.c in Sources */,
   3.257 +				FAB598B11BB5C31600BE72C5 /* SDL_rect.c in Sources */,
   3.258 +				FAB598B21BB5C31600BE72C5 /* SDL_RLEaccel.c in Sources */,
   3.259 +				FAB598B41BB5C31600BE72C5 /* SDL_stretch.c in Sources */,
   3.260 +				FAB598B51BB5C31600BE72C5 /* SDL_surface.c in Sources */,
   3.261 +				FAB598B71BB5C31600BE72C5 /* SDL_video.c in Sources */,
   3.262 +				FAB598B91BB5C31600BE72C5 /* SDL_assert.c in Sources */,
   3.263 +				FAB598BC1BB5C31600BE72C5 /* SDL_error.c in Sources */,
   3.264 +				FAB598BD1BB5C31600BE72C5 /* SDL_hints.c in Sources */,
   3.265 +				FAB598BE1BB5C31600BE72C5 /* SDL_log.c in Sources */,
   3.266 +				FAB598BF1BB5C31600BE72C5 /* SDL.c in Sources */,
   3.267 +			);
   3.268 +			runOnlyForDeploymentPostprocessing = 0;
   3.269 +		};
   3.270  		FD6526600DE8FCCB002AD96B /* Sources */ = {
   3.271  			isa = PBXSourcesBuildPhase;
   3.272  			buildActionMask = 2147483647;
   3.273 @@ -1259,27 +1479,12 @@
   3.274  		C01FCF4F08A954540054247B /* Debug */ = {
   3.275  			isa = XCBuildConfiguration;
   3.276  			buildSettings = {
   3.277 -				CLANG_WARN_BOOL_CONVERSION = YES;
   3.278 -				CLANG_WARN_CONSTANT_CONVERSION = YES;
   3.279 -				CLANG_WARN_EMPTY_BODY = YES;
   3.280 -				CLANG_WARN_ENUM_CONVERSION = YES;
   3.281 -				CLANG_WARN_INFINITE_RECURSION = YES;
   3.282 -				CLANG_WARN_INT_CONVERSION = YES;
   3.283 -				CLANG_WARN_SUSPICIOUS_MOVE = YES;
   3.284 -				CLANG_WARN_UNREACHABLE_CODE = YES;
   3.285 -				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   3.286 +				CLANG_ENABLE_OBJC_ARC = YES;
   3.287  				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
   3.288 -				ENABLE_STRICT_OBJC_MSGSEND = YES;
   3.289  				ENABLE_TESTABILITY = YES;
   3.290 -				GCC_NO_COMMON_BLOCKS = YES;
   3.291  				GCC_OPTIMIZATION_LEVEL = 0;
   3.292  				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
   3.293 -				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   3.294  				GCC_WARN_ABOUT_RETURN_TYPE = YES;
   3.295 -				GCC_WARN_UNDECLARED_SELECTOR = YES;
   3.296 -				GCC_WARN_UNINITIALIZED_AUTOS = YES;
   3.297 -				GCC_WARN_UNUSED_FUNCTION = YES;
   3.298 -				GCC_WARN_UNUSED_VARIABLE = YES;
   3.299  				IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
   3.300  				ONLY_ACTIVE_ARCH = YES;
   3.301  				SDKROOT = iphoneos;
   3.302 @@ -1290,28 +1495,103 @@
   3.303  		C01FCF5008A954540054247B /* Release */ = {
   3.304  			isa = XCBuildConfiguration;
   3.305  			buildSettings = {
   3.306 +				CLANG_ENABLE_OBJC_ARC = YES;
   3.307 +				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
   3.308 +				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
   3.309 +				GCC_WARN_ABOUT_RETURN_TYPE = YES;
   3.310 +				IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
   3.311 +				SDKROOT = iphoneos;
   3.312 +				TARGETED_DEVICE_FAMILY = "1,2";
   3.313 +			};
   3.314 +			name = Release;
   3.315 +		};
   3.316 +		FAB5981B1BB5C1B100BE72C5 /* Debug */ = {
   3.317 +			isa = XCBuildConfiguration;
   3.318 +			buildSettings = {
   3.319 +				ALWAYS_SEARCH_USER_PATHS = NO;
   3.320 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   3.321 +				CLANG_CXX_LIBRARY = "libc++";
   3.322 +				CLANG_ENABLE_MODULES = YES;
   3.323 +				CLANG_ENABLE_OBJC_ARC = YES;
   3.324  				CLANG_WARN_BOOL_CONVERSION = YES;
   3.325  				CLANG_WARN_CONSTANT_CONVERSION = YES;
   3.326 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   3.327  				CLANG_WARN_EMPTY_BODY = YES;
   3.328  				CLANG_WARN_ENUM_CONVERSION = YES;
   3.329  				CLANG_WARN_INFINITE_RECURSION = YES;
   3.330  				CLANG_WARN_INT_CONVERSION = YES;
   3.331 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   3.332  				CLANG_WARN_SUSPICIOUS_MOVE = YES;
   3.333  				CLANG_WARN_UNREACHABLE_CODE = YES;
   3.334  				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   3.335 -				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
   3.336 +				COPY_PHASE_STRIP = NO;
   3.337 +				DEBUG_INFORMATION_FORMAT = dwarf;
   3.338  				ENABLE_STRICT_OBJC_MSGSEND = YES;
   3.339 +				ENABLE_TESTABILITY = YES;
   3.340 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   3.341 +				GCC_DYNAMIC_NO_PIC = NO;
   3.342 +				GCC_NO_COMMON_BLOCKS = YES;
   3.343 +				GCC_PREPROCESSOR_DEFINITIONS = (
   3.344 +					"DEBUG=1",
   3.345 +					"$(inherited)",
   3.346 +				);
   3.347 +				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   3.348 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   3.349 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   3.350 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   3.351 +				GCC_WARN_UNUSED_FUNCTION = YES;
   3.352 +				GCC_WARN_UNUSED_VARIABLE = YES;
   3.353 +				MTL_ENABLE_DEBUG_INFO = YES;
   3.354 +				OTHER_LDFLAGS = "-ObjC";
   3.355 +				PRODUCT_NAME = SDL2;
   3.356 +				SDKROOT = appletvos;
   3.357 +				SKIP_INSTALL = YES;
   3.358 +				SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
   3.359 +				TARGETED_DEVICE_FAMILY = 3;
   3.360 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   3.361 +			};
   3.362 +			name = Debug;
   3.363 +		};
   3.364 +		FAB5981C1BB5C1B100BE72C5 /* Release */ = {
   3.365 +			isa = XCBuildConfiguration;
   3.366 +			buildSettings = {
   3.367 +				ALWAYS_SEARCH_USER_PATHS = NO;
   3.368 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   3.369 +				CLANG_CXX_LIBRARY = "libc++";
   3.370 +				CLANG_ENABLE_MODULES = YES;
   3.371 +				CLANG_ENABLE_OBJC_ARC = YES;
   3.372 +				CLANG_WARN_BOOL_CONVERSION = YES;
   3.373 +				CLANG_WARN_CONSTANT_CONVERSION = YES;
   3.374 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   3.375 +				CLANG_WARN_EMPTY_BODY = YES;
   3.376 +				CLANG_WARN_ENUM_CONVERSION = YES;
   3.377 +				CLANG_WARN_INFINITE_RECURSION = YES;
   3.378 +				CLANG_WARN_INT_CONVERSION = YES;
   3.379 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   3.380 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   3.381 +				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   3.382 +				COPY_PHASE_STRIP = NO;
   3.383 +				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
   3.384 +				ENABLE_NS_ASSERTIONS = NO;
   3.385 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   3.386 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   3.387  				GCC_NO_COMMON_BLOCKS = YES;
   3.388  				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
   3.389  				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   3.390 -				GCC_WARN_ABOUT_RETURN_TYPE = YES;
   3.391 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   3.392  				GCC_WARN_UNDECLARED_SELECTOR = YES;
   3.393 -				GCC_WARN_UNINITIALIZED_AUTOS = YES;
   3.394 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   3.395  				GCC_WARN_UNUSED_FUNCTION = YES;
   3.396  				GCC_WARN_UNUSED_VARIABLE = YES;
   3.397 -				IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
   3.398 -				SDKROOT = iphoneos;
   3.399 -				TARGETED_DEVICE_FAMILY = "1,2";
   3.400 +				MTL_ENABLE_DEBUG_INFO = NO;
   3.401 +				OTHER_LDFLAGS = "-ObjC";
   3.402 +				PRODUCT_NAME = SDL2;
   3.403 +				SDKROOT = appletvos;
   3.404 +				SKIP_INSTALL = YES;
   3.405 +				SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
   3.406 +				TARGETED_DEVICE_FAMILY = 3;
   3.407 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   3.408 +				VALIDATE_PRODUCT = YES;
   3.409  			};
   3.410  			name = Release;
   3.411  		};
   3.412 @@ -1366,6 +1646,15 @@
   3.413  			defaultConfigurationIsVisible = 0;
   3.414  			defaultConfigurationName = Release;
   3.415  		};
   3.416 +		FAB5981A1BB5C1B100BE72C5 /* Build configuration list for PBXNativeTarget "libSDL-tv" */ = {
   3.417 +			isa = XCConfigurationList;
   3.418 +			buildConfigurations = (
   3.419 +				FAB5981B1BB5C1B100BE72C5 /* Debug */,
   3.420 +				FAB5981C1BB5C1B100BE72C5 /* Release */,
   3.421 +			);
   3.422 +			defaultConfigurationIsVisible = 0;
   3.423 +			defaultConfigurationName = Release;
   3.424 +		};
   3.425  		FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */ = {
   3.426  			isa = XCConfigurationList;
   3.427  			buildConfigurations = (
     4.1 --- a/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj	Tue Sep 13 19:51:10 2016 -0300
     4.2 +++ b/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj	Tue Sep 13 22:18:06 2016 -0300
     4.3 @@ -21,8 +21,34 @@
     4.4  		AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */; };
     4.5  		AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */; };
     4.6  		AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE461176059AB0029C7A5 /* SDL_test_random.c */; };
     4.7 +		FA3D99011BC4E5BC002C96C8 /* SDL_test_common.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE454176059AB0029C7A5 /* SDL_test_common.c */; };
     4.8 +		FA3D99021BC4E5BC002C96C8 /* SDL_test_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */; };
     4.9 +		FA3D99031BC4E5BC002C96C8 /* SDL_test_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */; };
    4.10 +		FA3D99041BC4E5BC002C96C8 /* SDL_test_font.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE457176059AB0029C7A5 /* SDL_test_font.c */; };
    4.11 +		FA3D99051BC4E5BC002C96C8 /* SDL_test_fuzzer.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */; };
    4.12 +		FA3D99061BC4E5BC002C96C8 /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */; };
    4.13 +		FA3D99071BC4E5BC002C96C8 /* SDL_test_imageBlit.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */; };
    4.14 +		FA3D99081BC4E5BC002C96C8 /* SDL_test_imageBlitBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */; };
    4.15 +		FA3D99091BC4E5BC002C96C8 /* SDL_test_imageFace.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */; };
    4.16 +		FA3D990A1BC4E5BC002C96C8 /* SDL_test_imagePrimitives.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */; };
    4.17 +		FA3D990B1BC4E5BC002C96C8 /* SDL_test_imagePrimitivesBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */; };
    4.18 +		FA3D990C1BC4E5BC002C96C8 /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */; };
    4.19 +		FA3D990D1BC4E5BC002C96C8 /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */; };
    4.20 +		FA3D990E1BC4E5BC002C96C8 /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE461176059AB0029C7A5 /* SDL_test_random.c */; };
    4.21  /* End PBXBuildFile section */
    4.22  
    4.23 +/* Begin PBXCopyFilesBuildPhase section */
    4.24 +		FA3D98F61BC4E5A2002C96C8 /* CopyFiles */ = {
    4.25 +			isa = PBXCopyFilesBuildPhase;
    4.26 +			buildActionMask = 2147483647;
    4.27 +			dstPath = "include/$(PRODUCT_NAME)";
    4.28 +			dstSubfolderSpec = 16;
    4.29 +			files = (
    4.30 +			);
    4.31 +			runOnlyForDeploymentPostprocessing = 0;
    4.32 +		};
    4.33 +/* End PBXCopyFilesBuildPhase section */
    4.34 +
    4.35  /* Begin PBXFileReference section */
    4.36  		AA1EE4461760589B0029C7A5 /* libSDL2test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2test.a; sourceTree = BUILT_PRODUCTS_DIR; };
    4.37  		AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = "<group>"; };
    4.38 @@ -39,6 +65,7 @@
    4.39  		AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = "<group>"; };
    4.40  		AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = "<group>"; };
    4.41  		AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = "<group>"; };
    4.42 +		FA3D98F81BC4E5A2002C96C8 /* libSDL2test-TV.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libSDL2test-TV.a"; sourceTree = BUILT_PRODUCTS_DIR; };
    4.43  /* End PBXFileReference section */
    4.44  
    4.45  /* Begin PBXFrameworksBuildPhase section */
    4.46 @@ -49,6 +76,13 @@
    4.47  			);
    4.48  			runOnlyForDeploymentPostprocessing = 0;
    4.49  		};
    4.50 +		FA3D98F51BC4E5A2002C96C8 /* Frameworks */ = {
    4.51 +			isa = PBXFrameworksBuildPhase;
    4.52 +			buildActionMask = 2147483647;
    4.53 +			files = (
    4.54 +			);
    4.55 +			runOnlyForDeploymentPostprocessing = 0;
    4.56 +		};
    4.57  /* End PBXFrameworksBuildPhase section */
    4.58  
    4.59  /* Begin PBXGroup section */
    4.60 @@ -64,6 +98,7 @@
    4.61  			isa = PBXGroup;
    4.62  			children = (
    4.63  				AA1EE4461760589B0029C7A5 /* libSDL2test.a */,
    4.64 +				FA3D98F81BC4E5A2002C96C8 /* libSDL2test-TV.a */,
    4.65  			);
    4.66  			name = Products;
    4.67  			sourceTree = "<group>";
    4.68 @@ -119,6 +154,23 @@
    4.69  			productReference = AA1EE4461760589B0029C7A5 /* libSDL2test.a */;
    4.70  			productType = "com.apple.product-type.library.static";
    4.71  		};
    4.72 +		FA3D98F71BC4E5A2002C96C8 /* SDL2test-TV */ = {
    4.73 +			isa = PBXNativeTarget;
    4.74 +			buildConfigurationList = FA3D99001BC4E5A3002C96C8 /* Build configuration list for PBXNativeTarget "SDL2test-TV" */;
    4.75 +			buildPhases = (
    4.76 +				FA3D98F41BC4E5A2002C96C8 /* Sources */,
    4.77 +				FA3D98F51BC4E5A2002C96C8 /* Frameworks */,
    4.78 +				FA3D98F61BC4E5A2002C96C8 /* CopyFiles */,
    4.79 +			);
    4.80 +			buildRules = (
    4.81 +			);
    4.82 +			dependencies = (
    4.83 +			);
    4.84 +			name = "SDL2test-TV";
    4.85 +			productName = "SDL2test-TV";
    4.86 +			productReference = FA3D98F81BC4E5A2002C96C8 /* libSDL2test-TV.a */;
    4.87 +			productType = "com.apple.product-type.library.static";
    4.88 +		};
    4.89  /* End PBXNativeTarget section */
    4.90  
    4.91  /* Begin PBXProject section */
    4.92 @@ -127,6 +179,11 @@
    4.93  			attributes = {
    4.94  				LastUpgradeCheck = 0460;
    4.95  				ORGANIZATIONNAME = "Sam Lantinga";
    4.96 +				TargetAttributes = {
    4.97 +					FA3D98F71BC4E5A2002C96C8 = {
    4.98 +						CreatedOnToolsVersion = 7.1;
    4.99 +					};
   4.100 +				};
   4.101  			};
   4.102  			buildConfigurationList = AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */;
   4.103  			compatibilityVersion = "Xcode 3.2";
   4.104 @@ -141,6 +198,7 @@
   4.105  			projectRoot = "";
   4.106  			targets = (
   4.107  				AA1EE4451760589B0029C7A5 /* SDL2test */,
   4.108 +				FA3D98F71BC4E5A2002C96C8 /* SDL2test-TV */,
   4.109  			);
   4.110  		};
   4.111  /* End PBXProject section */
   4.112 @@ -167,6 +225,27 @@
   4.113  			);
   4.114  			runOnlyForDeploymentPostprocessing = 0;
   4.115  		};
   4.116 +		FA3D98F41BC4E5A2002C96C8 /* Sources */ = {
   4.117 +			isa = PBXSourcesBuildPhase;
   4.118 +			buildActionMask = 2147483647;
   4.119 +			files = (
   4.120 +				FA3D99011BC4E5BC002C96C8 /* SDL_test_common.c in Sources */,
   4.121 +				FA3D99021BC4E5BC002C96C8 /* SDL_test_compare.c in Sources */,
   4.122 +				FA3D99031BC4E5BC002C96C8 /* SDL_test_crc32.c in Sources */,
   4.123 +				FA3D99041BC4E5BC002C96C8 /* SDL_test_font.c in Sources */,
   4.124 +				FA3D99051BC4E5BC002C96C8 /* SDL_test_fuzzer.c in Sources */,
   4.125 +				FA3D99061BC4E5BC002C96C8 /* SDL_test_harness.c in Sources */,
   4.126 +				FA3D99071BC4E5BC002C96C8 /* SDL_test_imageBlit.c in Sources */,
   4.127 +				FA3D99081BC4E5BC002C96C8 /* SDL_test_imageBlitBlend.c in Sources */,
   4.128 +				FA3D99091BC4E5BC002C96C8 /* SDL_test_imageFace.c in Sources */,
   4.129 +				FA3D990A1BC4E5BC002C96C8 /* SDL_test_imagePrimitives.c in Sources */,
   4.130 +				FA3D990B1BC4E5BC002C96C8 /* SDL_test_imagePrimitivesBlend.c in Sources */,
   4.131 +				FA3D990C1BC4E5BC002C96C8 /* SDL_test_log.c in Sources */,
   4.132 +				FA3D990D1BC4E5BC002C96C8 /* SDL_test_md5.c in Sources */,
   4.133 +				FA3D990E1BC4E5BC002C96C8 /* SDL_test_random.c in Sources */,
   4.134 +			);
   4.135 +			runOnlyForDeploymentPostprocessing = 0;
   4.136 +		};
   4.137  /* End PBXSourcesBuildPhase section */
   4.138  
   4.139  /* Begin XCBuildConfiguration section */
   4.140 @@ -195,6 +274,7 @@
   4.141  				GCC_WARN_ABOUT_RETURN_TYPE = YES;
   4.142  				GCC_WARN_UNINITIALIZED_AUTOS = YES;
   4.143  				GCC_WARN_UNUSED_VARIABLE = YES;
   4.144 +				HEADER_SEARCH_PATHS = ../../include;
   4.145  				MACOSX_DEPLOYMENT_TARGET = 10.8;
   4.146  				ONLY_ACTIVE_ARCH = YES;
   4.147  				SDKROOT = iphoneos;
   4.148 @@ -220,6 +300,7 @@
   4.149  				GCC_WARN_ABOUT_RETURN_TYPE = YES;
   4.150  				GCC_WARN_UNINITIALIZED_AUTOS = YES;
   4.151  				GCC_WARN_UNUSED_VARIABLE = YES;
   4.152 +				HEADER_SEARCH_PATHS = ../../include;
   4.153  				MACOSX_DEPLOYMENT_TARGET = 10.8;
   4.154  				SDKROOT = iphoneos;
   4.155  			};
   4.156 @@ -229,7 +310,6 @@
   4.157  			isa = XCBuildConfiguration;
   4.158  			buildSettings = {
   4.159  				EXECUTABLE_PREFIX = lib;
   4.160 -				HEADER_SEARCH_PATHS = ../../include;
   4.161  				PRODUCT_NAME = "$(TARGET_NAME)";
   4.162  			};
   4.163  			name = Debug;
   4.164 @@ -238,11 +318,63 @@
   4.165  			isa = XCBuildConfiguration;
   4.166  			buildSettings = {
   4.167  				EXECUTABLE_PREFIX = lib;
   4.168 -				HEADER_SEARCH_PATHS = ../../include;
   4.169  				PRODUCT_NAME = "$(TARGET_NAME)";
   4.170  			};
   4.171  			name = Release;
   4.172  		};
   4.173 +		FA3D98FE1BC4E5A3002C96C8 /* Debug */ = {
   4.174 +			isa = XCBuildConfiguration;
   4.175 +			buildSettings = {
   4.176 +				CLANG_ENABLE_MODULES = YES;
   4.177 +				CLANG_ENABLE_OBJC_ARC = YES;
   4.178 +				CLANG_WARN_BOOL_CONVERSION = YES;
   4.179 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   4.180 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   4.181 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   4.182 +				DEBUG_INFORMATION_FORMAT = dwarf;
   4.183 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   4.184 +				ENABLE_TESTABILITY = YES;
   4.185 +				GCC_NO_COMMON_BLOCKS = YES;
   4.186 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   4.187 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   4.188 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   4.189 +				GCC_WARN_UNUSED_FUNCTION = YES;
   4.190 +				MTL_ENABLE_DEBUG_INFO = YES;
   4.191 +				OTHER_LDFLAGS = "-ObjC";
   4.192 +				PRODUCT_NAME = "$(TARGET_NAME)";
   4.193 +				SDKROOT = appletvos;
   4.194 +				SKIP_INSTALL = YES;
   4.195 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   4.196 +			};
   4.197 +			name = Debug;
   4.198 +		};
   4.199 +		FA3D98FF1BC4E5A3002C96C8 /* Release */ = {
   4.200 +			isa = XCBuildConfiguration;
   4.201 +			buildSettings = {
   4.202 +				CLANG_ENABLE_MODULES = YES;
   4.203 +				CLANG_ENABLE_OBJC_ARC = YES;
   4.204 +				CLANG_WARN_BOOL_CONVERSION = YES;
   4.205 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   4.206 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   4.207 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   4.208 +				COPY_PHASE_STRIP = NO;
   4.209 +				ENABLE_NS_ASSERTIONS = NO;
   4.210 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   4.211 +				GCC_NO_COMMON_BLOCKS = YES;
   4.212 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   4.213 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   4.214 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   4.215 +				GCC_WARN_UNUSED_FUNCTION = YES;
   4.216 +				MTL_ENABLE_DEBUG_INFO = NO;
   4.217 +				OTHER_LDFLAGS = "-ObjC";
   4.218 +				PRODUCT_NAME = "$(TARGET_NAME)";
   4.219 +				SDKROOT = appletvos;
   4.220 +				SKIP_INSTALL = YES;
   4.221 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   4.222 +				VALIDATE_PRODUCT = YES;
   4.223 +			};
   4.224 +			name = Release;
   4.225 +		};
   4.226  /* End XCBuildConfiguration section */
   4.227  
   4.228  /* Begin XCConfigurationList section */
   4.229 @@ -264,6 +396,15 @@
   4.230  			defaultConfigurationIsVisible = 0;
   4.231  			defaultConfigurationName = Release;
   4.232  		};
   4.233 +		FA3D99001BC4E5A3002C96C8 /* Build configuration list for PBXNativeTarget "SDL2test-TV" */ = {
   4.234 +			isa = XCConfigurationList;
   4.235 +			buildConfigurations = (
   4.236 +				FA3D98FE1BC4E5A3002C96C8 /* Debug */,
   4.237 +				FA3D98FF1BC4E5A3002C96C8 /* Release */,
   4.238 +			);
   4.239 +			defaultConfigurationIsVisible = 0;
   4.240 +			defaultConfigurationName = Release;
   4.241 +		};
   4.242  /* End XCConfigurationList section */
   4.243  	};
   4.244  	rootObject = AA1EE43E1760589B0029C7A5 /* Project object */;
     5.1 --- a/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj	Tue Sep 13 19:51:10 2016 -0300
     5.2 +++ b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj	Tue Sep 13 22:18:06 2016 -0300
     5.3 @@ -65,7 +65,20 @@
     5.4  		AAE7DFAC14CBB54E00DF1A0E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
     5.5  		AAE7DFAD14CBB54E00DF1A0E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
     5.6  		AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */; };
     5.7 -		FA0EF22E1BAF4654000E07A6 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; settings = {ASSET_TAGS = (); }; };
     5.8 +		FA0EF22E1BAF4654000E07A6 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; };
     5.9 +		FA3D99481BC4E6AD002C96C8 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
    5.10 +		FA3D994A1BC4E6AD002C96C8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
    5.11 +		FA3D994B1BC4E6AD002C96C8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
    5.12 +		FA3D994C1BC4E6AD002C96C8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
    5.13 +		FA3D994D1BC4E6AD002C96C8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
    5.14 +		FA3D994E1BC4E6AD002C96C8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
    5.15 +		FA3D994F1BC4E6AD002C96C8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
    5.16 +		FA3D99501BC4E6AD002C96C8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
    5.17 +		FA3D99521BC4E70C002C96C8 /* controllermap.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */; };
    5.18 +		FA3D99531BC4E70E002C96C8 /* axis.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2281BAF4487000E07A6 /* axis.bmp */; };
    5.19 +		FA3D99541BC4E70F002C96C8 /* button.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2291BAF4487000E07A6 /* button.bmp */; };
    5.20 +		FA3D99551BC4E712002C96C8 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
    5.21 +		FA3D99561BC4E719002C96C8 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */; };
    5.22  		FA684F7B1BAF1A4400DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
    5.23  		FA684F7F1BAF1A4D00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
    5.24  		FA684F801BAF1A5000DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
    5.25 @@ -112,6 +125,8 @@
    5.26  		FA8B4BDF196766F100F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
    5.27  		FA8B4BE0196766F400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
    5.28  		FA8B4BE1196766F600F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
    5.29 +		FAA8CEE31BDF057F00D3BD45 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAA8CEE21BDF057F00D3BD45 /* GameController.framework */; };
    5.30 +		FAA8CEE41BDF06D600D3BD45 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA3D992B1BC4E619002C96C8 /* libSDL2.a */; };
    5.31  		FAE0E9821BAF9B230098DFA4 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
    5.32  		FAE0E9861BAF9B230098DFA4 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
    5.33  		FAE0E9871BAF9B230098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
    5.34 @@ -123,10 +138,10 @@
    5.35  		FAE0E98D1BAF9B230098DFA4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
    5.36  		FAE0E98E1BAF9B230098DFA4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
    5.37  		FAE0E98F1BAF9B230098DFA4 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
    5.38 -		FAE0E9951BAF9B510098DFA4 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */; settings = {ASSET_TAGS = (); }; };
    5.39 -		FAE0E9961BAF9B650098DFA4 /* controllermap.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */; settings = {ASSET_TAGS = (); }; };
    5.40 -		FAE0E9971BAF9B6A0098DFA4 /* button.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2291BAF4487000E07A6 /* button.bmp */; settings = {ASSET_TAGS = (); }; };
    5.41 -		FAE0E9981BAF9B6E0098DFA4 /* axis.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2281BAF4487000E07A6 /* axis.bmp */; settings = {ASSET_TAGS = (); }; };
    5.42 +		FAE0E9951BAF9B510098DFA4 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */; };
    5.43 +		FAE0E9961BAF9B650098DFA4 /* controllermap.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */; };
    5.44 +		FAE0E9971BAF9B6A0098DFA4 /* button.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2291BAF4487000E07A6 /* button.bmp */; };
    5.45 +		FAE0E9981BAF9B6E0098DFA4 /* axis.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2281BAF4487000E07A6 /* axis.bmp */; };
    5.46  		FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75F0E2D0F1600EA573E /* testwm2.c */; };
    5.47  		FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
    5.48  		FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
    5.49 @@ -304,6 +319,27 @@
    5.50  			remoteGlobalIDString = AA1EE4461760589B0029C7A5;
    5.51  			remoteInfo = SDL2test;
    5.52  		};
    5.53 +		FA3D992A1BC4E619002C96C8 /* PBXContainerItemProxy */ = {
    5.54 +			isa = PBXContainerItemProxy;
    5.55 +			containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
    5.56 +			proxyType = 2;
    5.57 +			remoteGlobalIDString = FAB598141BB5C1B100BE72C5;
    5.58 +			remoteInfo = "libSDL-tv";
    5.59 +		};
    5.60 +		FA3D992E1BC4E619002C96C8 /* PBXContainerItemProxy */ = {
    5.61 +			isa = PBXContainerItemProxy;
    5.62 +			containerPortal = AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */;
    5.63 +			proxyType = 2;
    5.64 +			remoteGlobalIDString = FA3D98F81BC4E5A2002C96C8;
    5.65 +			remoteInfo = "SDL2test-TV";
    5.66 +		};
    5.67 +		FAA8CEE51BDF06DC00D3BD45 /* PBXContainerItemProxy */ = {
    5.68 +			isa = PBXContainerItemProxy;
    5.69 +			containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
    5.70 +			proxyType = 1;
    5.71 +			remoteGlobalIDString = FAB598131BB5C1B100BE72C5;
    5.72 +			remoteInfo = "libSDL-tv";
    5.73 +		};
    5.74  		FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */ = {
    5.75  			isa = PBXContainerItemProxy;
    5.76  			containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
    5.77 @@ -330,8 +366,10 @@
    5.78  		FA0EF2281BAF4487000E07A6 /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = axis.bmp; path = ../../test/axis.bmp; sourceTree = "<group>"; };
    5.79  		FA0EF2291BAF4487000E07A6 /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = button.bmp; path = ../../test/button.bmp; sourceTree = "<group>"; };
    5.80  		FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = controllermap.bmp; path = ../../test/controllermap.bmp; sourceTree = "<group>"; };
    5.81 +		FA3D99341BC4E644002C96C8 /* testgamecontroller-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "testgamecontroller-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
    5.82  		FA684F7A1BAF1A4400DCFD1A /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
    5.83  		FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
    5.84 +		FAA8CEE21BDF057F00D3BD45 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/GameController.framework; sourceTree = DEVELOPER_DIR; };
    5.85  		FAE0E9931BAF9B230098DFA4 /* testgamecontroller.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgamecontroller.app; sourceTree = BUILT_PRODUCTS_DIR; };
    5.86  		FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
    5.87  		FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; };
    5.88 @@ -492,6 +530,23 @@
    5.89  			);
    5.90  			runOnlyForDeploymentPostprocessing = 0;
    5.91  		};
    5.92 +		FA3D99311BC4E644002C96C8 /* Frameworks */ = {
    5.93 +			isa = PBXFrameworksBuildPhase;
    5.94 +			buildActionMask = 2147483647;
    5.95 +			files = (
    5.96 +				FAA8CEE41BDF06D600D3BD45 /* libSDL2.a in Frameworks */,
    5.97 +				FAA8CEE31BDF057F00D3BD45 /* GameController.framework in Frameworks */,
    5.98 +				FA3D99481BC4E6AD002C96C8 /* GameController.framework in Frameworks */,
    5.99 +				FA3D994A1BC4E6AD002C96C8 /* AudioToolbox.framework in Frameworks */,
   5.100 +				FA3D994B1BC4E6AD002C96C8 /* QuartzCore.framework in Frameworks */,
   5.101 +				FA3D994C1BC4E6AD002C96C8 /* OpenGLES.framework in Frameworks */,
   5.102 +				FA3D994D1BC4E6AD002C96C8 /* CoreGraphics.framework in Frameworks */,
   5.103 +				FA3D994E1BC4E6AD002C96C8 /* UIKit.framework in Frameworks */,
   5.104 +				FA3D994F1BC4E6AD002C96C8 /* Foundation.framework in Frameworks */,
   5.105 +				FA3D99501BC4E6AD002C96C8 /* CoreAudio.framework in Frameworks */,
   5.106 +			);
   5.107 +			runOnlyForDeploymentPostprocessing = 0;
   5.108 +		};
   5.109  		FAE0E9851BAF9B230098DFA4 /* Frameworks */ = {
   5.110  			isa = PBXFrameworksBuildPhase;
   5.111  			buildActionMask = 2147483647;
   5.112 @@ -831,6 +886,7 @@
   5.113  				AAE7DEEC14CBB1E100DF1A0E /* testscale.app */,
   5.114  				AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */,
   5.115  				FAE0E9931BAF9B230098DFA4 /* testgamecontroller.app */,
   5.116 +				FA3D99341BC4E644002C96C8 /* testgamecontroller-TV.app */,
   5.117  			);
   5.118  			name = Products;
   5.119  			sourceTree = "<group>";
   5.120 @@ -838,6 +894,7 @@
   5.121  		29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
   5.122  			isa = PBXGroup;
   5.123  			children = (
   5.124 +				FAA8CEE21BDF057F00D3BD45 /* GameController.framework */,
   5.125  				AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */,
   5.126  				FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */,
   5.127  				FDA8AAD60E2D339A00EA573E /* Resources */,
   5.128 @@ -852,6 +909,7 @@
   5.129  			isa = PBXGroup;
   5.130  			children = (
   5.131  				AA1EE452176059230029C7A5 /* libSDL2test.a */,
   5.132 +				FA3D992F1BC4E619002C96C8 /* libSDL2test-TV.a */,
   5.133  			);
   5.134  			name = Products;
   5.135  			sourceTree = "<group>";
   5.136 @@ -860,6 +918,7 @@
   5.137  			isa = PBXGroup;
   5.138  			children = (
   5.139  				FD1B48B80E3131CA007AB34E /* libSDL2.a */,
   5.140 +				FA3D992B1BC4E619002C96C8 /* libSDL2.a */,
   5.141  			);
   5.142  			name = Products;
   5.143  			sourceTree = "<group>";
   5.144 @@ -1033,6 +1092,24 @@
   5.145  			productReference = AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */;
   5.146  			productType = "com.apple.product-type.application";
   5.147  		};
   5.148 +		FA3D99331BC4E644002C96C8 /* testgamecontroller-TV */ = {
   5.149 +			isa = PBXNativeTarget;
   5.150 +			buildConfigurationList = FA3D99451BC4E645002C96C8 /* Build configuration list for PBXNativeTarget "testgamecontroller-TV" */;
   5.151 +			buildPhases = (
   5.152 +				FA3D99301BC4E644002C96C8 /* Sources */,
   5.153 +				FA3D99311BC4E644002C96C8 /* Frameworks */,
   5.154 +				FA3D99321BC4E644002C96C8 /* Resources */,
   5.155 +			);
   5.156 +			buildRules = (
   5.157 +			);
   5.158 +			dependencies = (
   5.159 +				FAA8CEE61BDF06DC00D3BD45 /* PBXTargetDependency */,
   5.160 +			);
   5.161 +			name = "testgamecontroller-TV";
   5.162 +			productName = "testgamecontroller-TV";
   5.163 +			productReference = FA3D99341BC4E644002C96C8 /* testgamecontroller-TV.app */;
   5.164 +			productType = "com.apple.product-type.application";
   5.165 +		};
   5.166  		FAE0E9801BAF9B230098DFA4 /* testgamecontroller */ = {
   5.167  			isa = PBXNativeTarget;
   5.168  			buildConfigurationList = FAE0E9901BAF9B230098DFA4 /* Build configuration list for PBXNativeTarget "testgamecontroller" */;
   5.169 @@ -1346,6 +1423,11 @@
   5.170  			isa = PBXProject;
   5.171  			attributes = {
   5.172  				LastUpgradeCheck = 0630;
   5.173 +				TargetAttributes = {
   5.174 +					FA3D99331BC4E644002C96C8 = {
   5.175 +						CreatedOnToolsVersion = 7.1;
   5.176 +					};
   5.177 +				};
   5.178  			};
   5.179  			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestiPhoneOS" */;
   5.180  			compatibilityVersion = "Xcode 3.2";
   5.181 @@ -1356,6 +1438,7 @@
   5.182  				Japanese,
   5.183  				French,
   5.184  				German,
   5.185 +				Base,
   5.186  			);
   5.187  			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
   5.188  			projectDirPath = "";
   5.189 @@ -1378,6 +1461,7 @@
   5.190  				FDAAC58A0E2D5429001DB1D8 /* testerror */,
   5.191  				FDAAC5B80E2D55B5001DB1D8 /* testfile */,
   5.192  				FAE0E9801BAF9B230098DFA4 /* testgamecontroller */,
   5.193 +				FA3D99331BC4E644002C96C8 /* testgamecontroller-TV */,
   5.194  				046CEF7513254F23007AD51D /* testgesture */,
   5.195  				FDAAC6150E2D5914001DB1D8 /* testgles */,
   5.196  				FDD2C1700E2E52C000B7A85F /* testiconv */,
   5.197 @@ -1407,6 +1491,20 @@
   5.198  			remoteRef = AA1EE451176059230029C7A5 /* PBXContainerItemProxy */;
   5.199  			sourceTree = BUILT_PRODUCTS_DIR;
   5.200  		};
   5.201 +		FA3D992B1BC4E619002C96C8 /* libSDL2.a */ = {
   5.202 +			isa = PBXReferenceProxy;
   5.203 +			fileType = archive.ar;
   5.204 +			path = libSDL2.a;
   5.205 +			remoteRef = FA3D992A1BC4E619002C96C8 /* PBXContainerItemProxy */;
   5.206 +			sourceTree = BUILT_PRODUCTS_DIR;
   5.207 +		};
   5.208 +		FA3D992F1BC4E619002C96C8 /* libSDL2test-TV.a */ = {
   5.209 +			isa = PBXReferenceProxy;
   5.210 +			fileType = archive.ar;
   5.211 +			path = "libSDL2test-TV.a";
   5.212 +			remoteRef = FA3D992E1BC4E619002C96C8 /* PBXContainerItemProxy */;
   5.213 +			sourceTree = BUILT_PRODUCTS_DIR;
   5.214 +		};
   5.215  		FD1B48B80E3131CA007AB34E /* libSDL2.a */ = {
   5.216  			isa = PBXReferenceProxy;
   5.217  			fileType = archive.ar;
   5.218 @@ -1465,6 +1563,17 @@
   5.219  			);
   5.220  			runOnlyForDeploymentPostprocessing = 0;
   5.221  		};
   5.222 +		FA3D99321BC4E644002C96C8 /* Resources */ = {
   5.223 +			isa = PBXResourcesBuildPhase;
   5.224 +			buildActionMask = 2147483647;
   5.225 +			files = (
   5.226 +				FA3D99521BC4E70C002C96C8 /* controllermap.bmp in Resources */,
   5.227 +				FA3D99541BC4E70F002C96C8 /* button.bmp in Resources */,
   5.228 +				FA3D99531BC4E70E002C96C8 /* axis.bmp in Resources */,
   5.229 +				FA3D99551BC4E712002C96C8 /* icon.bmp in Resources */,
   5.230 +			);
   5.231 +			runOnlyForDeploymentPostprocessing = 0;
   5.232 +		};
   5.233  		FAE0E9811BAF9B230098DFA4 /* Resources */ = {
   5.234  			isa = PBXResourcesBuildPhase;
   5.235  			buildActionMask = 2147483647;
   5.236 @@ -1652,6 +1761,14 @@
   5.237  			);
   5.238  			runOnlyForDeploymentPostprocessing = 0;
   5.239  		};
   5.240 +		FA3D99301BC4E644002C96C8 /* Sources */ = {
   5.241 +			isa = PBXSourcesBuildPhase;
   5.242 +			buildActionMask = 2147483647;
   5.243 +			files = (
   5.244 +				FA3D99561BC4E719002C96C8 /* testgamecontroller.c in Sources */,
   5.245 +			);
   5.246 +			runOnlyForDeploymentPostprocessing = 0;
   5.247 +		};
   5.248  		FAE0E9831BAF9B230098DFA4 /* Sources */ = {
   5.249  			isa = PBXSourcesBuildPhase;
   5.250  			buildActionMask = 2147483647;
   5.251 @@ -1798,6 +1915,14 @@
   5.252  		};
   5.253  /* End PBXSourcesBuildPhase section */
   5.254  
   5.255 +/* Begin PBXTargetDependency section */
   5.256 +		FAA8CEE61BDF06DC00D3BD45 /* PBXTargetDependency */ = {
   5.257 +			isa = PBXTargetDependency;
   5.258 +			name = "libSDL-tv";
   5.259 +			targetProxy = FAA8CEE51BDF06DC00D3BD45 /* PBXContainerItemProxy */;
   5.260 +		};
   5.261 +/* End PBXTargetDependency section */
   5.262 +
   5.263  /* Begin XCBuildConfiguration section */
   5.264  		046CEF8413254F23007AD51D /* Debug */ = {
   5.265  			isa = XCBuildConfiguration;
   5.266 @@ -1921,6 +2046,90 @@
   5.267  			};
   5.268  			name = Release;
   5.269  		};
   5.270 +		FA3D99461BC4E645002C96C8 /* Debug */ = {
   5.271 +			isa = XCBuildConfiguration;
   5.272 +			buildSettings = {
   5.273 +				ALWAYS_SEARCH_USER_PATHS = NO;
   5.274 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   5.275 +				CLANG_CXX_LIBRARY = "libc++";
   5.276 +				CLANG_ENABLE_MODULES = YES;
   5.277 +				CLANG_ENABLE_OBJC_ARC = YES;
   5.278 +				CLANG_WARN_BOOL_CONVERSION = YES;
   5.279 +				CLANG_WARN_CONSTANT_CONVERSION = YES;
   5.280 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   5.281 +				CLANG_WARN_EMPTY_BODY = YES;
   5.282 +				CLANG_WARN_ENUM_CONVERSION = YES;
   5.283 +				CLANG_WARN_INT_CONVERSION = YES;
   5.284 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   5.285 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   5.286 +				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   5.287 +				COPY_PHASE_STRIP = NO;
   5.288 +				DEBUG_INFORMATION_FORMAT = dwarf;
   5.289 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   5.290 +				ENABLE_TESTABILITY = YES;
   5.291 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   5.292 +				GCC_DYNAMIC_NO_PIC = NO;
   5.293 +				GCC_NO_COMMON_BLOCKS = YES;
   5.294 +				GCC_PREPROCESSOR_DEFINITIONS = (
   5.295 +					"DEBUG=1",
   5.296 +					"$(inherited)",
   5.297 +				);
   5.298 +				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   5.299 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   5.300 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   5.301 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   5.302 +				GCC_WARN_UNUSED_FUNCTION = YES;
   5.303 +				GCC_WARN_UNUSED_VARIABLE = YES;
   5.304 +				INFOPLIST_FILE = Info.plist;
   5.305 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
   5.306 +				MTL_ENABLE_DEBUG_INFO = YES;
   5.307 +				PRODUCT_NAME = "$(TARGET_NAME)";
   5.308 +				SDKROOT = appletvos;
   5.309 +				TARGETED_DEVICE_FAMILY = 3;
   5.310 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   5.311 +			};
   5.312 +			name = Debug;
   5.313 +		};
   5.314 +		FA3D99471BC4E645002C96C8 /* Release */ = {
   5.315 +			isa = XCBuildConfiguration;
   5.316 +			buildSettings = {
   5.317 +				ALWAYS_SEARCH_USER_PATHS = NO;
   5.318 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   5.319 +				CLANG_CXX_LIBRARY = "libc++";
   5.320 +				CLANG_ENABLE_MODULES = YES;
   5.321 +				CLANG_ENABLE_OBJC_ARC = YES;
   5.322 +				CLANG_WARN_BOOL_CONVERSION = YES;
   5.323 +				CLANG_WARN_CONSTANT_CONVERSION = YES;
   5.324 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   5.325 +				CLANG_WARN_EMPTY_BODY = YES;
   5.326 +				CLANG_WARN_ENUM_CONVERSION = YES;
   5.327 +				CLANG_WARN_INT_CONVERSION = YES;
   5.328 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   5.329 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   5.330 +				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   5.331 +				COPY_PHASE_STRIP = NO;
   5.332 +				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
   5.333 +				ENABLE_NS_ASSERTIONS = NO;
   5.334 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   5.335 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   5.336 +				GCC_NO_COMMON_BLOCKS = YES;
   5.337 +				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   5.338 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   5.339 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   5.340 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   5.341 +				GCC_WARN_UNUSED_FUNCTION = YES;
   5.342 +				GCC_WARN_UNUSED_VARIABLE = YES;
   5.343 +				INFOPLIST_FILE = Info.plist;
   5.344 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
   5.345 +				MTL_ENABLE_DEBUG_INFO = NO;
   5.346 +				PRODUCT_NAME = "$(TARGET_NAME)";
   5.347 +				SDKROOT = appletvos;
   5.348 +				TARGETED_DEVICE_FAMILY = 3;
   5.349 +				TVOS_DEPLOYMENT_TARGET = 9.0;
   5.350 +				VALIDATE_PRODUCT = YES;
   5.351 +			};
   5.352 +			name = Release;
   5.353 +		};
   5.354  		FAE0E9911BAF9B230098DFA4 /* Debug */ = {
   5.355  			isa = XCBuildConfiguration;
   5.356  			buildSettings = {
   5.357 @@ -2275,6 +2484,15 @@
   5.358  			defaultConfigurationIsVisible = 0;
   5.359  			defaultConfigurationName = Release;
   5.360  		};
   5.361 +		FA3D99451BC4E645002C96C8 /* Build configuration list for PBXNativeTarget "testgamecontroller-TV" */ = {
   5.362 +			isa = XCConfigurationList;
   5.363 +			buildConfigurations = (
   5.364 +				FA3D99461BC4E645002C96C8 /* Debug */,
   5.365 +				FA3D99471BC4E645002C96C8 /* Release */,
   5.366 +			);
   5.367 +			defaultConfigurationIsVisible = 0;
   5.368 +			defaultConfigurationName = Release;
   5.369 +		};
   5.370  		FAE0E9901BAF9B230098DFA4 /* Build configuration list for PBXNativeTarget "testgamecontroller" */ = {
   5.371  			isa = XCConfigurationList;
   5.372  			buildConfigurations = (
     6.1 --- a/include/SDL_hints.h	Tue Sep 13 19:51:10 2016 -0300
     6.2 +++ b/include/SDL_hints.h	Tue Sep 13 22:18:06 2016 -0300
     6.3 @@ -276,7 +276,25 @@
     6.4   *    "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
     6.5   */
     6.6  #define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
     6.7 -    
     6.8 +
     6.9 +/**
    6.10 + *  \brief  A variable controlling whether controllers used with the Apple TV
    6.11 + *  generate UI events.
    6.12 + *
    6.13 + * When UI events are generated by controller input, the app will be
    6.14 + * backgrounded when the Apple TV remote's menu button is pressed, and when the
    6.15 + * pause or B buttons on gamepads are pressed.
    6.16 + *
    6.17 + * More information about properly making use of controllers for the Apple TV
    6.18 + * can be found here:
    6.19 + * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-interaction/
    6.20 + *
    6.21 + *  This variable can be set to the following values:
    6.22 + *    "0"       - Controller input does not generate UI events (the default).
    6.23 + *    "1"       - Controller input generates UI events.
    6.24 + */
    6.25 +#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
    6.26 +
    6.27  /**
    6.28   *  \brief  A variable controlling whether the Android / iOS built-in
    6.29   *  accelerometer should be listed as a joystick device, rather than listing
     7.1 --- a/include/SDL_platform.h	Tue Sep 13 19:51:10 2016 -0300
     7.2 +++ b/include/SDL_platform.h	Tue Sep 13 22:18:06 2016 -0300
     7.3 @@ -70,13 +70,17 @@
     7.4  /* lets us know what version of Mac OS X we're compiling on */
     7.5  #include "AvailabilityMacros.h"
     7.6  #include "TargetConditionals.h"
     7.7 +#if TARGET_OS_TV
     7.8 +#undef __TVOS__
     7.9 +#define __TVOS__ 1
    7.10 +#endif
    7.11  #if TARGET_OS_IPHONE
    7.12 -/* if compiling for iPhone */
    7.13 +/* if compiling for iOS */
    7.14  #undef __IPHONEOS__
    7.15  #define __IPHONEOS__ 1
    7.16  #undef __MACOSX__
    7.17  #else
    7.18 -/* if not compiling for iPhone */
    7.19 +/* if not compiling for iOS */
    7.20  #undef __MACOSX__
    7.21  #define __MACOSX__  1
    7.22  #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
     8.1 --- a/src/SDL.c	Tue Sep 13 19:51:10 2016 -0300
     8.2 +++ b/src/SDL.c	Tue Sep 13 22:18:06 2016 -0300
     8.3 @@ -443,6 +443,8 @@
     8.4      return "Windows";
     8.5  #elif __WINRT__
     8.6      return "WinRT";
     8.7 +#elif __TVOS__
     8.8 +    return "tvOS";
     8.9  #elif __IPHONEOS__
    8.10      return "iOS";
    8.11  #elif __PSP__
     9.1 --- a/src/audio/coreaudio/SDL_coreaudio.c	Tue Sep 13 19:51:10 2016 -0300
     9.2 +++ b/src/audio/coreaudio/SDL_coreaudio.c	Tue Sep 13 22:18:06 2016 -0300
     9.3 @@ -274,7 +274,7 @@
     9.4  
     9.5  static void update_audio_session()
     9.6  {
     9.7 -#if !MACOSX_COREAUDIO
     9.8 +#if !MACOSX_COREAUDIO && !TARGET_OS_TV
     9.9      /* !!! FIXME: move this to AVAudioSession. This is deprecated, and the new version is available as of (ancient!) iOS 3.0 */
    9.10      UInt32 category;
    9.11      if (open_playback_devices && open_capture_devices) {
    9.12 @@ -569,8 +569,8 @@
    9.13      /* We're running! */
    9.14      return 1;
    9.15  }
    9.16 +static int
    9.17  
    9.18 -static int
    9.19  audioqueue_thread(void *arg)
    9.20  {
    9.21      SDL_AudioDevice *this = (SDL_AudioDevice *) arg;
    9.22 @@ -725,9 +725,11 @@
    9.23         !!! FIXME: do this when a device is opened, and deinitialize when all devices close.
    9.24      */
    9.25      /* !!! FIXME: move this to AVAudioSession. This is deprecated, and the new version is available as of (ancient!) iOS 3.0 */
    9.26 +#if !TARGET_OS_TV
    9.27      AudioSessionInitialize(NULL, NULL, NULL, nil);
    9.28      UInt32 category = kAudioSessionCategory_AmbientSound;
    9.29      AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(UInt32), &category);
    9.30 +#endif /* !TARGET_OS_TV */
    9.31  #endif
    9.32  
    9.33      impl->ProvidesOwnCallbackThread = 1;
    10.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m	Tue Sep 13 19:51:10 2016 -0300
    10.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Tue Sep 13 22:18:06 2016 -0300
    10.3 @@ -33,7 +33,13 @@
    10.4  #include "../SDL_sysjoystick.h"
    10.5  #include "../SDL_joystick_c.h"
    10.6  
    10.7 +#if !SDL_EVENTS_DISABLED
    10.8 +#include "../../events/SDL_events_c.h"
    10.9 +#endif
   10.10 +
   10.11 +#if !TARGET_OS_TV
   10.12  #import <CoreMotion/CoreMotion.h>
   10.13 +#endif
   10.14  
   10.15  #ifdef SDL_JOYSTICK_MFI
   10.16  #import <GameController/GameController.h>
   10.17 @@ -42,8 +48,10 @@
   10.18  static id disconnectObserver = nil;
   10.19  #endif /* SDL_JOYSTICK_MFI */
   10.20  
   10.21 +#if !TARGET_OS_TV
   10.22  static const char *accelerometerName = "iOS Accelerometer";
   10.23  static CMMotionManager *motionManager = nil;
   10.24 +#endif /* !TARGET_OS_TV */
   10.25  
   10.26  static SDL_JoystickDeviceItem *deviceList = NULL;
   10.27  
   10.28 @@ -102,6 +110,11 @@
   10.29      } else if (controller.gamepad) {
   10.30          device->guid.data[10] = 2;
   10.31      }
   10.32 +#if TARGET_OS_TV
   10.33 +    else if (controller.microGamepad) {
   10.34 +        device->guid.data[10] = 3;
   10.35 +    }
   10.36 +#endif /* TARGET_OS_TV */
   10.37  
   10.38      if (controller.extendedGamepad) {
   10.39          device->naxes = 6; /* 2 thumbsticks and 2 triggers */
   10.40 @@ -112,12 +125,19 @@
   10.41          device->nhats = 1; /* d-pad */
   10.42          device->nbuttons = 7; /* ABXY, shoulder buttons, pause button */
   10.43      }
   10.44 -    /* TODO: Handle micro profiles on tvOS. */
   10.45 +#if TARGET_OS_TV
   10.46 +    else if (controller.microGamepad) {
   10.47 +        device->naxes = 2; /* treat the touch surface as two axes */
   10.48 +        device->nhats = 0; /* apparently the touch surface-as-dpad is buggy */
   10.49 +        device->nbuttons = 3; /* AX, pause button */
   10.50 +    }
   10.51 +#endif /* TARGET_OS_TV */
   10.52  
   10.53      /* This will be set when the first button press of the controller is
   10.54       * detected. */
   10.55      controller.playerIndex = -1;
   10.56 -#endif
   10.57 +
   10.58 +#endif /* SDL_JOYSTICK_MFI */
   10.59  }
   10.60  
   10.61  static void
   10.62 @@ -143,6 +163,10 @@
   10.63      device->instance_id = instancecounter++;
   10.64  
   10.65      if (accelerometer) {
   10.66 +#if TARGET_OS_TV
   10.67 +        SDL_free(device);
   10.68 +        return;
   10.69 +#else
   10.70          device->name = SDL_strdup(accelerometerName);
   10.71          device->naxes = 3; /* Device acceleration in the x, y, and z axes. */
   10.72          device->nhats = 0;
   10.73 @@ -150,6 +174,7 @@
   10.74  
   10.75          /* Use the accelerometer name as a GUID. */
   10.76          SDL_memcpy(&device->guid.data, device->name, SDL_min(sizeof(SDL_JoystickGUID), SDL_strlen(device->name)));
   10.77 +#endif /* TARGET_OS_TV */
   10.78      } else if (controller) {
   10.79          SDL_SYS_AddMFIJoystickDevice(device, controller);
   10.80      }
   10.81 @@ -232,12 +257,14 @@
   10.82  {
   10.83      @autoreleasepool {
   10.84          NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
   10.85 +
   10.86 +#if !TARGET_OS_TV
   10.87          const char *hint = SDL_GetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK);
   10.88 -
   10.89          if (!hint || SDL_atoi(hint)) {
   10.90              /* Default behavior, accelerometer as joystick */
   10.91              SDL_SYS_AddJoystickDevice(nil, SDL_TRUE);
   10.92          }
   10.93 +#endif /* !TARGET_OS_TV */
   10.94  
   10.95  #ifdef SDL_JOYSTICK_MFI
   10.96          /* GameController.framework was added in iOS 7. */
   10.97 @@ -326,6 +353,7 @@
   10.98  
   10.99      @autoreleasepool {
  10.100          if (device->accelerometer) {
  10.101 +#if !TARGET_OS_TV
  10.102              if (motionManager == nil) {
  10.103                  motionManager = [[CMMotionManager alloc] init];
  10.104              }
  10.105 @@ -333,6 +361,7 @@
  10.106              /* Shorter times between updates can significantly increase CPU usage. */
  10.107              motionManager.accelerometerUpdateInterval = 0.1;
  10.108              [motionManager startAccelerometerUpdates];
  10.109 +#endif /* !TARGET_OS_TV */
  10.110          } else {
  10.111  #ifdef SDL_JOYSTICK_MFI
  10.112              GCController *controller = device->controller;
  10.113 @@ -358,6 +387,7 @@
  10.114  static void
  10.115  SDL_SYS_AccelerometerUpdate(SDL_Joystick * joystick)
  10.116  {
  10.117 +#if !TARGET_OS_TV
  10.118      const float maxgforce = SDL_IPHONE_MAX_GFORCE;
  10.119      const SInt16 maxsint16 = 0x7FFF;
  10.120      CMAcceleration accel;
  10.121 @@ -395,6 +425,7 @@
  10.122      SDL_PrivateJoystickAxis(joystick, 0,  (accel.x / maxgforce) * maxsint16);
  10.123      SDL_PrivateJoystickAxis(joystick, 1, -(accel.y / maxgforce) * maxsint16);
  10.124      SDL_PrivateJoystickAxis(joystick, 2,  (accel.z / maxgforce) * maxsint16);
  10.125 +#endif /* !TARGET_OS_TV */
  10.126  }
  10.127  
  10.128  #ifdef SDL_JOYSTICK_MFI
  10.129 @@ -426,7 +457,7 @@
  10.130  static void
  10.131  SDL_SYS_MFIJoystickUpdate(SDL_Joystick * joystick)
  10.132  {
  10.133 -#ifdef SDL_JOYSTICK_MFI
  10.134 +#if SDL_JOYSTICK_MFI
  10.135      @autoreleasepool {
  10.136          GCController *controller = joystick->hwdata->controller;
  10.137          Uint8 hatstate = SDL_HAT_CENTERED;
  10.138 @@ -482,13 +513,43 @@
  10.139              };
  10.140  
  10.141              hatstate = SDL_SYS_MFIJoystickHatStateForDPad(gamepad.dpad);
  10.142 +            SDL_PrivateJoystickHat(joystick, 0, hatstate);
  10.143  
  10.144              for (i = 0; i < SDL_arraysize(buttons); i++) {
  10.145                  updateplayerindex |= (joystick->buttons[i] != buttons[i]);
  10.146                  SDL_PrivateJoystickButton(joystick, i, buttons[i]);
  10.147              }
  10.148          }
  10.149 -        /* TODO: Handle micro profiles on tvOS. */
  10.150 +#if TARGET_OS_TV
  10.151 +        else if (controller.microGamepad) {
  10.152 +            GCMicroGamepad *gamepad = controller.microGamepad;
  10.153 +
  10.154 +            Sint16 axes[] = {
  10.155 +                (Sint16) (gamepad.dpad.xAxis.value * 32767),
  10.156 +                (Sint16) (gamepad.dpad.yAxis.value * -32767),
  10.157 +            };
  10.158 +
  10.159 +            for (i = 0; i < SDL_arraysize(axes); i++) {
  10.160 +                updateplayerindex |= (joystick->axes[i] != axes[i]);
  10.161 +                SDL_PrivateJoystickAxis(joystick, i, axes[i]);
  10.162 +            }
  10.163 +
  10.164 +            /* Apparently the dpad values are not accurate enough to be useful. */
  10.165 +            /* hatstate = SDL_SYS_MFIJoystickHatStateForDPad(gamepad.dpad); */
  10.166 +
  10.167 +            Uint8 buttons[] = {
  10.168 +                gamepad.buttonA.isPressed,
  10.169 +                gamepad.buttonX.isPressed,
  10.170 +            };
  10.171 +
  10.172 +            for (i = 0; i < SDL_arraysize(buttons); i++) {
  10.173 +                updateplayerindex |= (joystick->buttons[i] != buttons[i]);
  10.174 +                SDL_PrivateJoystickButton(joystick, i, buttons[i]);
  10.175 +            }
  10.176 +
  10.177 +            /* TODO: Figure out what to do with reportsAbsoluteDpadValues */
  10.178 +        }
  10.179 +#endif /* TARGET_OS_TV */
  10.180  
  10.181          if (joystick->nhats > 0) {
  10.182              updateplayerindex |= (joystick->hats[0] != hatstate);
  10.183 @@ -528,7 +589,7 @@
  10.184              }
  10.185          }
  10.186      }
  10.187 -#endif
  10.188 +#endif /* SDL_JOYSTICK_MFI */
  10.189  }
  10.190  
  10.191  /* Function to update the state of a joystick - called as a device poll.
  10.192 @@ -566,7 +627,9 @@
  10.193  
  10.194      @autoreleasepool {
  10.195          if (device->accelerometer) {
  10.196 +#if !TARGET_OS_TV
  10.197              [motionManager stopAccelerometerUpdates];
  10.198 +#endif /* !TARGET_OS_TV */
  10.199          } else if (device->controller) {
  10.200  #ifdef SDL_JOYSTICK_MFI
  10.201              GCController *controller = device->controller;
  10.202 @@ -600,7 +663,9 @@
  10.203              SDL_SYS_RemoveJoystickDevice(deviceList);
  10.204          }
  10.205  
  10.206 +#if !TARGET_OS_TV
  10.207          motionManager = nil;
  10.208 +#endif /* !TARGET_OS_TV */
  10.209      }
  10.210  
  10.211      numjoysticks = 0;
    11.1 --- a/src/power/uikit/SDL_syspower.m	Tue Sep 13 19:51:10 2016 -0300
    11.2 +++ b/src/power/uikit/SDL_syspower.m	Tue Sep 13 22:18:06 2016 -0300
    11.3 @@ -30,6 +30,7 @@
    11.4  #include "SDL_assert.h"
    11.5  #include "SDL_syspower.h"
    11.6  
    11.7 +#if !TARGET_OS_TV
    11.8  /* turn off the battery monitor if it's been more than X ms since last check. */
    11.9  static const int BATTERY_MONITORING_TIMEOUT = 3000;
   11.10  static Uint32 SDL_UIKitLastPowerInfoQuery = 0;
   11.11 @@ -46,10 +47,22 @@
   11.12          }
   11.13      }
   11.14  }
   11.15 +#else
   11.16 +void
   11.17 +SDL_UIKit_UpdateBatteryMonitoring(void)
   11.18 +{
   11.19 +    /* Do nothing. */
   11.20 +}
   11.21 +#endif /* !TARGET_OS_TV */
   11.22  
   11.23  SDL_bool
   11.24  SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent)
   11.25  {
   11.26 +#if TARGET_OS_TV
   11.27 +    *state = SDL_POWERSTATE_NO_BATTERY;
   11.28 +    *seconds = -1;
   11.29 +    *percent = -1;
   11.30 +#else /* TARGET_OS_TV */
   11.31      @autoreleasepool {
   11.32          UIDevice *uidev = [UIDevice currentDevice];
   11.33  
   11.34 @@ -88,8 +101,10 @@
   11.35  
   11.36          const float level = uidev.batteryLevel;
   11.37          *percent = ( (level < 0.0f) ? -1 : ((int) ((level * 100) + 0.5f)) );
   11.38 -        return SDL_TRUE; /* always the definitive answer on iOS. */
   11.39      }
   11.40 +#endif /* TARGET_OS_TV */
   11.41 +
   11.42 +    return SDL_TRUE; /* always the definitive answer on iOS. */
   11.43  }
   11.44  
   11.45  #endif /* SDL_POWER_UIKIT */
    12.1 --- a/src/render/software/SDL_rotate.c	Tue Sep 13 19:51:10 2016 -0300
    12.2 +++ b/src/render/software/SDL_rotate.c	Tue Sep 13 22:18:06 2016 -0300
    12.3 @@ -343,7 +343,7 @@
    12.4      SDL_Surface *rz_dst;
    12.5      int is32bit;
    12.6      int i;
    12.7 -    Uint8 r,g,b;
    12.8 +    Uint8 r = 0,g = 0,b = 0;
    12.9      Uint32 colorkey = 0;
   12.10      int colorKeyAvailable = 0;
   12.11      double sangleinv, cangleinv;
    13.1 --- a/src/video/uikit/SDL_uikitappdelegate.h	Tue Sep 13 19:51:10 2016 -0300
    13.2 +++ b/src/video/uikit/SDL_uikitappdelegate.h	Tue Sep 13 22:18:06 2016 -0300
    13.3 @@ -25,7 +25,6 @@
    13.4  
    13.5  - (instancetype)init;
    13.6  - (void)loadView;
    13.7 -- (NSUInteger)supportedInterfaceOrientations;
    13.8  
    13.9  @end
   13.10  
    14.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Tue Sep 13 19:51:10 2016 -0300
    14.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Tue Sep 13 22:18:06 2016 -0300
    14.3 @@ -76,6 +76,7 @@
    14.4      [UIApplication sharedApplication].idleTimerDisabled = disable;
    14.5  }
    14.6  
    14.7 +#if !TARGET_OS_TV
    14.8  /* Load a launch image using the old UILaunchImageFile-era naming rules. */
    14.9  static UIImage *
   14.10  SDL_LoadLaunchImageNamed(NSString *name, int screenh)
   14.11 @@ -114,6 +115,15 @@
   14.12  
   14.13      return image;
   14.14  }
   14.15 +#endif /* !TARGET_OS_TV */
   14.16 +
   14.17 +@interface SDLLaunchScreenController ()
   14.18 +
   14.19 +#if !TARGET_OS_TV
   14.20 +- (NSUInteger)supportedInterfaceOrientations;
   14.21 +#endif
   14.22 +
   14.23 +@end
   14.24  
   14.25  @implementation SDLLaunchScreenController
   14.26  
   14.27 @@ -140,6 +150,7 @@
   14.28      }
   14.29  
   14.30      if (!self.view) {
   14.31 +#if !TARGET_OS_TV
   14.32          NSArray *launchimages = [bundle objectForInfoDictionaryKey:@"UILaunchImages"];
   14.33          UIInterfaceOrientation curorient = [UIApplication sharedApplication].statusBarOrientation;
   14.34          NSString *imagename = nil;
   14.35 @@ -244,6 +255,9 @@
   14.36  
   14.37              self.view = view;
   14.38          }
   14.39 +#else /* !TARGET_OS_TV */
   14.40 +        return nil;
   14.41 +#endif
   14.42      }
   14.43  
   14.44      return self;
   14.45 @@ -254,6 +268,7 @@
   14.46      /* Do nothing. */
   14.47  }
   14.48  
   14.49 +#if !TARGET_OS_TV
   14.50  - (BOOL)shouldAutorotate
   14.51  {
   14.52      /* If YES, the launch image will be incorrectly rotated in some cases. */
   14.53 @@ -267,6 +282,7 @@
   14.54       * the ones set here (it will cause an exception in that case.) */
   14.55      return UIInterfaceOrientationMaskAll;
   14.56  }
   14.57 +#endif /* !TARGET_OS_TV */
   14.58  
   14.59  @end
   14.60  
   14.61 @@ -381,6 +397,7 @@
   14.62      SDL_SendAppEvent(SDL_APP_LOWMEMORY);
   14.63  }
   14.64  
   14.65 +#if !TARGET_OS_TV
   14.66  - (void)application:(UIApplication *)application didChangeStatusBarOrientation:(UIInterfaceOrientation)oldStatusBarOrientation
   14.67  {
   14.68      BOOL isLandscape = UIInterfaceOrientationIsLandscape(application.statusBarOrientation);
   14.69 @@ -408,6 +425,7 @@
   14.70          }
   14.71      }
   14.72  }
   14.73 +#endif
   14.74  
   14.75  - (void)applicationWillResignActive:(UIApplication*)application
   14.76  {
    15.1 --- a/src/video/uikit/SDL_uikitclipboard.m	Tue Sep 13 19:51:10 2016 -0300
    15.2 +++ b/src/video/uikit/SDL_uikitclipboard.m	Tue Sep 13 22:18:06 2016 -0300
    15.3 @@ -30,15 +30,22 @@
    15.4  int
    15.5  UIKit_SetClipboardText(_THIS, const char *text)
    15.6  {
    15.7 +#if TARGET_OS_TV
    15.8 +    return SDL_SetError("The clipboard is not available on tvOS");
    15.9 +#else
   15.10      @autoreleasepool {
   15.11          [UIPasteboard generalPasteboard].string = @(text);
   15.12          return 0;
   15.13      }
   15.14 +#endif
   15.15  }
   15.16  
   15.17  char *
   15.18  UIKit_GetClipboardText(_THIS)
   15.19  {
   15.20 +#if TARGET_OS_TV
   15.21 +    return SDL_strdup(""); // Unsupported.
   15.22 +#else
   15.23      @autoreleasepool {
   15.24          UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
   15.25          NSString *string = pasteboard.string;
   15.26 @@ -49,15 +56,18 @@
   15.27              return SDL_strdup("");
   15.28          }
   15.29      }
   15.30 +#endif
   15.31  }
   15.32  
   15.33  SDL_bool
   15.34  UIKit_HasClipboardText(_THIS)
   15.35  {
   15.36      @autoreleasepool {
   15.37 +#if !TARGET_OS_TV
   15.38          if ([UIPasteboard generalPasteboard].string != nil) {
   15.39              return SDL_TRUE;
   15.40          }
   15.41 +#endif
   15.42          return SDL_FALSE;
   15.43      }
   15.44  }
   15.45 @@ -65,6 +75,7 @@
   15.46  void
   15.47  UIKit_InitClipboard(_THIS)
   15.48  {
   15.49 +#if !TARGET_OS_TV
   15.50      @autoreleasepool {
   15.51          SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata;
   15.52          NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
   15.53 @@ -78,6 +89,7 @@
   15.54  
   15.55          data.pasteboardObserver = observer;
   15.56      }
   15.57 +#endif
   15.58  }
   15.59  
   15.60  void
    16.1 --- a/src/video/uikit/SDL_uikitmodes.m	Tue Sep 13 19:51:10 2016 -0300
    16.2 +++ b/src/video/uikit/SDL_uikitmodes.m	Tue Sep 13 22:18:06 2016 -0300
    16.3 @@ -156,9 +156,12 @@
    16.4  SDL_bool
    16.5  UIKit_IsDisplayLandscape(UIScreen *uiscreen)
    16.6  {
    16.7 +#if !TARGET_OS_TV
    16.8      if (uiscreen == [UIScreen mainScreen]) {
    16.9          return UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation);
   16.10 -    } else {
   16.11 +    } else
   16.12 +#endif /* !TARGET_OS_TV */
   16.13 +    {
   16.14          CGSize size = uiscreen.bounds.size;
   16.15          return (size.width > size.height);
   16.16      }
   16.17 @@ -187,6 +190,14 @@
   16.18          SDL_bool isLandscape = UIKit_IsDisplayLandscape(data.uiscreen);
   16.19          SDL_bool addRotation = (data.uiscreen == [UIScreen mainScreen]);
   16.20          CGFloat scale = data.uiscreen.scale;
   16.21 +        NSArray *availableModes = nil;
   16.22 +
   16.23 +#if TARGET_OS_TV
   16.24 +        addRotation = SDL_FALSE;
   16.25 +        availableModes = @[data.uiscreen.currentMode];
   16.26 +#else
   16.27 +        availableModes = data.uiscreen.availableModes;
   16.28 +#endif
   16.29  
   16.30  #ifdef __IPHONE_8_0
   16.31          /* The UIScreenMode of an iPhone 6 Plus should be 1080x1920 rather than
   16.32 @@ -196,7 +207,7 @@
   16.33          }
   16.34  #endif
   16.35  
   16.36 -        for (UIScreenMode *uimode in data.uiscreen.availableModes) {
   16.37 +        for (UIScreenMode *uimode in availableModes) {
   16.38              /* The size of a UIScreenMode is in pixels, but we deal exclusively
   16.39               * in points (except in SDL_GL_GetDrawableSize.) */
   16.40              int w = (int)(uimode.size.width / scale);
   16.41 @@ -219,9 +230,11 @@
   16.42  {
   16.43      @autoreleasepool {
   16.44          SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
   16.45 +
   16.46 +#if !TARGET_OS_TV
   16.47          SDL_DisplayModeData *modedata = (__bridge SDL_DisplayModeData *)mode->driverdata;
   16.48 -
   16.49          [data.uiscreen setCurrentMode:modedata.uiscreenmode];
   16.50 +#endif
   16.51  
   16.52          if (data.uiscreen == [UIScreen mainScreen]) {
   16.53              /* [UIApplication setStatusBarOrientation:] no longer works reliably
   16.54 @@ -245,20 +258,30 @@
   16.55  int
   16.56  UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect)
   16.57  {
   16.58 -    /* the default function iterates displays to make a fake offset,
   16.59 -       as if all the displays were side-by-side, which is fine for iOS. */
   16.60 -    const int displayIndex = (int) (display - _this->displays);
   16.61 -    if (SDL_GetDisplayBounds(displayIndex, rect) < 0) {
   16.62 -        return -1;
   16.63 +    @autoreleasepool {
   16.64 +        int displayIndex = (int) (display - _this->displays);
   16.65 +        SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
   16.66 +
   16.67 +        /* the default function iterates displays to make a fake offset,
   16.68 +         as if all the displays were side-by-side, which is fine for iOS. */
   16.69 +        if (SDL_GetDisplayBounds(displayIndex, rect) < 0) {
   16.70 +            return -1;
   16.71 +        }
   16.72 +
   16.73 +        CGRect frame = data.uiscreen.bounds;
   16.74 +
   16.75 +#if !TARGET_OS_TV
   16.76 +        if (!UIKit_IsSystemVersionAtLeast(7.0)) {
   16.77 +            frame = [data.uiscreen applicationFrame];
   16.78 +        }
   16.79 +#endif
   16.80 +
   16.81 +        rect->x += frame.origin.x;
   16.82 +        rect->y += frame.origin.y;
   16.83 +        rect->w = frame.size.width;
   16.84 +        rect->h = frame.size.height;
   16.85      }
   16.86  
   16.87 -    SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
   16.88 -    const CGRect frame = [data.uiscreen applicationFrame];
   16.89 -    const float scale = (float) data.uiscreen.scale;
   16.90 -    rect->x += (int) (frame.origin.x * scale);
   16.91 -    rect->y += (int) (frame.origin.y * scale);
   16.92 -    rect->w = (int) (frame.size.width * scale);
   16.93 -    rect->h = (int) (frame.size.height * scale);
   16.94      return 0;
   16.95  }
   16.96  
    17.1 --- a/src/video/uikit/SDL_uikitvideo.m	Tue Sep 13 19:51:10 2016 -0300
    17.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Tue Sep 13 22:18:06 2016 -0300
    17.3 @@ -176,6 +176,7 @@
    17.4  CGRect
    17.5  UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen)
    17.6  {
    17.7 +#if !TARGET_OS_TV && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0)
    17.8      BOOL hasiOS7 = UIKit_IsSystemVersionAtLeast(7.0);
    17.9  
   17.10      if (hasiOS7 || (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN))) {
   17.11 @@ -184,6 +185,9 @@
   17.12      } else {
   17.13          return screen.applicationFrame;
   17.14      }
   17.15 +#else
   17.16 +    return screen.bounds;
   17.17 +#endif
   17.18  }
   17.19  
   17.20  /*
    18.1 --- a/src/video/uikit/SDL_uikitview.m	Tue Sep 13 19:51:10 2016 -0300
    18.2 +++ b/src/video/uikit/SDL_uikitview.m	Tue Sep 13 22:18:06 2016 -0300
    18.3 @@ -45,7 +45,9 @@
    18.4          self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    18.5          self.autoresizesSubviews = YES;
    18.6  
    18.7 +#if !TARGET_OS_TV
    18.8          self.multipleTouchEnabled = YES;
    18.9 +#endif
   18.10  
   18.11          touchId = 1;
   18.12          SDL_AddTouch(touchId, "");
   18.13 @@ -197,6 +199,69 @@
   18.14      }
   18.15  }
   18.16  
   18.17 +#if TARGET_OS_TV || defined(__IPHONE_9_1)
   18.18 +- (SDL_Scancode)scancodeFromPressType:(UIPressType)presstype
   18.19 +{
   18.20 +    switch (presstype) {
   18.21 +    case UIPressTypeUpArrow:
   18.22 +        return SDL_SCANCODE_UP;
   18.23 +    case UIPressTypeDownArrow:
   18.24 +        return SDL_SCANCODE_DOWN;
   18.25 +    case UIPressTypeLeftArrow:
   18.26 +        return SDL_SCANCODE_LEFT;
   18.27 +    case UIPressTypeRightArrow:
   18.28 +        return SDL_SCANCODE_RIGHT;
   18.29 +    case UIPressTypeSelect:
   18.30 +        /* HIG says: "primary button behavior" */
   18.31 +        return SDL_SCANCODE_SELECT;
   18.32 +    case UIPressTypeMenu:
   18.33 +        /* HIG says: "returns to previous screen" */
   18.34 +        return SDL_SCANCODE_MENU;
   18.35 +    case UIPressTypePlayPause:
   18.36 +        /* HIG says: "secondary button behavior" */
   18.37 +        return SDL_SCANCODE_PAUSE;
   18.38 +    default:
   18.39 +        return SDL_SCANCODE_UNKNOWN;
   18.40 +    }
   18.41 +}
   18.42 +
   18.43 +- (void)pressesBegan:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
   18.44 +{
   18.45 +    for (UIPress *press in presses) {
   18.46 +        SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   18.47 +        SDL_SendKeyboardKey(SDL_PRESSED, scancode);
   18.48 +    }
   18.49 +
   18.50 +    [super pressesBegan:presses withEvent:event];
   18.51 +}
   18.52 +
   18.53 +- (void)pressesEnded:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
   18.54 +{
   18.55 +    for (UIPress *press in presses) {
   18.56 +        SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   18.57 +        SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   18.58 +    }
   18.59 +
   18.60 +    [super pressesEnded:presses withEvent:event];
   18.61 +}
   18.62 +
   18.63 +- (void)pressesCancelled:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
   18.64 +{
   18.65 +    for (UIPress *press in presses) {
   18.66 +        SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   18.67 +        SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   18.68 +    }
   18.69 +
   18.70 +    [super pressesCancelled:presses withEvent:event];
   18.71 +}
   18.72 +
   18.73 +- (void)pressesChanged:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
   18.74 +{
   18.75 +    /* This is only called when the force of a press changes. */
   18.76 +    [super pressesChanged:presses withEvent:event];
   18.77 +}
   18.78 +#endif /* TARGET_OS_TV || defined(__IPHONE_9_1) */
   18.79 +
   18.80  @end
   18.81  
   18.82  #endif /* SDL_VIDEO_DRIVER_UIKIT */
    19.1 --- a/src/video/uikit/SDL_uikitviewcontroller.h	Tue Sep 13 19:51:10 2016 -0300
    19.2 +++ b/src/video/uikit/SDL_uikitviewcontroller.h	Tue Sep 13 22:18:06 2016 -0300
    19.3 @@ -18,6 +18,7 @@
    19.4       misrepresented as being the original software.
    19.5    3. This notice may not be removed or altered from any source distribution.
    19.6  */
    19.7 +#include "../../SDL_internal.h"
    19.8  
    19.9  #import <UIKit/UIKit.h>
   19.10  
   19.11 @@ -25,10 +26,17 @@
   19.12  
   19.13  #include "SDL_touch.h"
   19.14  
   19.15 +#if TARGET_OS_TV
   19.16 +#import <GameController/GameController.h>
   19.17 +#define SDLRootViewController GCEventViewController
   19.18 +#else
   19.19 +#define SDLRootViewController UIViewController
   19.20 +#endif
   19.21 +
   19.22  #if SDL_IPHONE_KEYBOARD
   19.23 -@interface SDL_uikitviewcontroller : UIViewController <UITextFieldDelegate>
   19.24 +@interface SDL_uikitviewcontroller : SDLRootViewController <UITextFieldDelegate>
   19.25  #else
   19.26 -@interface SDL_uikitviewcontroller : UIViewController
   19.27 +@interface SDL_uikitviewcontroller : SDLRootViewController
   19.28  #endif
   19.29  
   19.30  @property (nonatomic, assign) SDL_Window *window;
   19.31 @@ -46,8 +54,11 @@
   19.32  
   19.33  - (void)loadView;
   19.34  - (void)viewDidLayoutSubviews;
   19.35 +
   19.36 +#if !TARGET_OS_TV
   19.37  - (NSUInteger)supportedInterfaceOrientations;
   19.38  - (BOOL)prefersStatusBarHidden;
   19.39 +#endif
   19.40  
   19.41  #if SDL_IPHONE_KEYBOARD
   19.42  - (void)showKeyboard;
    20.1 --- a/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 13 19:51:10 2016 -0300
    20.2 +++ b/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 13 22:18:06 2016 -0300
    20.3 @@ -39,6 +39,17 @@
    20.4  #include "keyinfotable.h"
    20.5  #endif
    20.6  
    20.7 +#if TARGET_OS_TV
    20.8 +static void
    20.9 +SDL_AppleTVControllerUIHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
   20.10 +{
   20.11 +    @autoreleasepool {
   20.12 +        SDL_uikitviewcontroller *viewcontroller = (__bridge SDL_uikitviewcontroller *) userdata;
   20.13 +        viewcontroller.controllerUserInteractionEnabled = hint && (*hint != '0');
   20.14 +    }
   20.15 +}
   20.16 +#endif
   20.17 +
   20.18  @implementation SDL_uikitviewcontroller {
   20.19      CADisplayLink *displayLink;
   20.20      int animationInterval;
   20.21 @@ -60,6 +71,12 @@
   20.22  #if SDL_IPHONE_KEYBOARD
   20.23          [self initKeyboard];
   20.24  #endif
   20.25 +
   20.26 +#if TARGET_OS_TV
   20.27 +        SDL_AddHintCallback(SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS,
   20.28 +                            SDL_AppleTVControllerUIHintChanged,
   20.29 +                            (__bridge void *) self);
   20.30 +#endif
   20.31      }
   20.32      return self;
   20.33  }
   20.34 @@ -69,6 +86,12 @@
   20.35  #if SDL_IPHONE_KEYBOARD
   20.36      [self deinitKeyboard];
   20.37  #endif
   20.38 +
   20.39 +#if TARGET_OS_TV
   20.40 +    SDL_DelHintCallback(SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS,
   20.41 +                        SDL_AppleTVControllerUIHintChanged,
   20.42 +                        (__bridge void *) self);
   20.43 +#endif
   20.44  }
   20.45  
   20.46  - (void)setAnimationCallback:(int)interval
   20.47 @@ -124,6 +147,7 @@
   20.48      SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h);
   20.49  }
   20.50  
   20.51 +#if !TARGET_OS_TV
   20.52  - (NSUInteger)supportedInterfaceOrientations
   20.53  {
   20.54      return UIKit_GetSupportedOrientations(window);
   20.55 @@ -138,6 +162,7 @@
   20.56  {
   20.57      return (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) != 0;
   20.58  }
   20.59 +#endif
   20.60  
   20.61  /*
   20.62   ---- Keyboard related functionality below this line ----
   20.63 @@ -168,9 +193,11 @@
   20.64      textField.hidden = YES;
   20.65      keyboardVisible = NO;
   20.66  
   20.67 +#if !TARGET_OS_TV
   20.68      NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
   20.69      [center addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
   20.70      [center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
   20.71 +#endif
   20.72  }
   20.73  
   20.74  - (void)setView:(UIView *)view
   20.75 @@ -186,9 +213,11 @@
   20.76  
   20.77  - (void)deinitKeyboard
   20.78  {
   20.79 +#if !TARGET_OS_TV
   20.80      NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
   20.81      [center removeObserver:self name:UIKeyboardWillShowNotification object:nil];
   20.82      [center removeObserver:self name:UIKeyboardWillHideNotification object:nil];
   20.83 +#endif
   20.84  }
   20.85  
   20.86  /* reveal onscreen virtual keyboard */
   20.87 @@ -209,6 +238,7 @@
   20.88  
   20.89  - (void)keyboardWillShow:(NSNotification *)notification
   20.90  {
   20.91 +#if !TARGET_OS_TV
   20.92      CGRect kbrect = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue];
   20.93  
   20.94      /* The keyboard rect is in the coordinate space of the screen/window, but we
   20.95 @@ -216,6 +246,7 @@
   20.96      kbrect = [self.view convertRect:kbrect fromView:nil];
   20.97  
   20.98      [self setKeyboardHeight:(int)kbrect.size.height];
   20.99 +#endif
  20.100  }
  20.101  
  20.102  - (void)keyboardWillHide:(NSNotification *)notification
    21.1 --- a/src/video/uikit/SDL_uikitwindow.m	Tue Sep 13 19:51:10 2016 -0300
    21.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Tue Sep 13 22:18:06 2016 -0300
    21.3 @@ -107,6 +107,7 @@
    21.4          window->flags |= SDL_WINDOW_BORDERLESS;  /* never has a status bar. */
    21.5      }
    21.6  
    21.7 +#if !TARGET_OS_TV
    21.8      if (displaydata.uiscreen == [UIScreen mainScreen]) {
    21.9          NSUInteger orients = UIKit_GetSupportedOrientations(window);
   21.10          BOOL supportsLandscape = (orients & UIInterfaceOrientationMaskLandscape) != 0;
   21.11 @@ -119,6 +120,7 @@
   21.12              height = temp;
   21.13          }
   21.14      }
   21.15 +#endif /* !TARGET_OS_TV */
   21.16  
   21.17      window->x = 0;
   21.18      window->y = 0;
   21.19 @@ -152,7 +154,6 @@
   21.20      @autoreleasepool {
   21.21          SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
   21.22          SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
   21.23 -        const CGSize origsize = data.uiscreen.currentMode.size;
   21.24  
   21.25          /* SDL currently puts this window at the start of display's linked list. We rely on this. */
   21.26          SDL_assert(_this->windows == window);
   21.27 @@ -165,6 +166,8 @@
   21.28          /* If monitor has a resolution of 0x0 (hasn't been explicitly set by the
   21.29           * user, so it's in standby), try to force the display to a resolution
   21.30           * that most closely matches the desired window size. */
   21.31 +#if !TARGET_OS_TV
   21.32 +        const CGSize origsize = data.uiscreen.currentMode.size;
   21.33          if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) {
   21.34              if (display->num_display_modes == 0) {
   21.35                  _this->GetDisplayModes(_this, display);
   21.36 @@ -197,6 +200,7 @@
   21.37                  [UIApplication sharedApplication].statusBarHidden = NO;
   21.38              }
   21.39          }
   21.40 +#endif /* !TARGET_OS_TV */
   21.41  
   21.42          /* ignore the size user requested, and make a fullscreen window */
   21.43          /* !!! FIXME: can we have a smaller view? */
   21.44 @@ -258,6 +262,7 @@
   21.45      SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
   21.46      SDL_uikitviewcontroller *viewcontroller = data.viewcontroller;
   21.47  
   21.48 +#if !TARGET_OS_TV
   21.49      if (data.uiwindow.screen == [UIScreen mainScreen]) {
   21.50          if (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS)) {
   21.51              [UIApplication sharedApplication].statusBarHidden = YES;
   21.52 @@ -273,6 +278,7 @@
   21.53  
   21.54      /* Update the view's frame to account for the status bar change. */
   21.55      viewcontroller.view.frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen);
   21.56 +#endif /* !TARGET_OS_TV */
   21.57  
   21.58  #ifdef SDL_IPHONE_KEYBOARD
   21.59      /* Make sure the view is offset correctly when the keyboard is visible. */
   21.60 @@ -363,6 +369,7 @@
   21.61      }
   21.62  }
   21.63  
   21.64 +#if !TARGET_OS_TV
   21.65  NSUInteger
   21.66  UIKit_GetSupportedOrientations(SDL_Window * window)
   21.67  {
   21.68 @@ -428,6 +435,7 @@
   21.69  
   21.70      return orientationMask;
   21.71  }
   21.72 +#endif /* !TARGET_OS_TV */
   21.73  
   21.74  int
   21.75  SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam)