istereo2

changeset 0:7841e9365065

new istereo done right
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 16 Sep 2015 07:10:02 +0300
parents
children 2d5abf441307
files .hgignore ios/Info.plist istereo.xcodeproj/project.pbxproj src/ios/app_delegate.h src/ios/app_delegate.m src/ios/main.m src/ios/viewctl.h src/ios/viewctl.m
diffstat 8 files changed, 512 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/.hgignore	Wed Sep 16 07:10:02 2015 +0300
     1.3 @@ -0,0 +1,7 @@
     1.4 +\.o$
     1.5 +\.swp$
     1.6 +\.d$
     1.7 +\.xcuserstate$
     1.8 +\.xcworkspace
     1.9 +xcuserdata/
    1.10 +^build/
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/ios/Info.plist	Wed Sep 16 07:10:02 2015 +0300
     2.3 @@ -0,0 +1,45 @@
     2.4 +<?xml version="1.0" encoding="UTF-8"?>
     2.5 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     2.6 +<plist version="1.0">
     2.7 +<dict>
     2.8 +	<key>CFBundleDevelopmentRegion</key>
     2.9 +	<string>en</string>
    2.10 +	<key>CFBundleExecutable</key>
    2.11 +	<string>$(EXECUTABLE_NAME)</string>
    2.12 +	<key>CFBundleIdentifier</key>
    2.13 +	<string>com.mutantstargoat.$(PRODUCT_NAME:rfc1034identifier)</string>
    2.14 +	<key>CFBundleInfoDictionaryVersion</key>
    2.15 +	<string>6.0</string>
    2.16 +	<key>CFBundleName</key>
    2.17 +	<string>$(PRODUCT_NAME)</string>
    2.18 +	<key>CFBundlePackageType</key>
    2.19 +	<string>APPL</string>
    2.20 +	<key>CFBundleShortVersionString</key>
    2.21 +	<string>2.0</string>
    2.22 +	<key>CFBundleSignature</key>
    2.23 +	<string>????</string>
    2.24 +	<key>CFBundleVersion</key>
    2.25 +	<string>1</string>
    2.26 +	<key>LSRequiresIPhoneOS</key>
    2.27 +	<true/>
    2.28 +	<key>UIRequiredDeviceCapabilities</key>
    2.29 +	<array>
    2.30 +		<string>armv7</string>
    2.31 +	</array>
    2.32 +	<key>UIStatusBarHidden</key>
    2.33 +	<true/>
    2.34 +	<key>UISupportedInterfaceOrientations</key>
    2.35 +	<array>
    2.36 +		<string>UIInterfaceOrientationPortrait</string>
    2.37 +		<string>UIInterfaceOrientationLandscapeLeft</string>
    2.38 +		<string>UIInterfaceOrientationLandscapeRight</string>
    2.39 +	</array>
    2.40 +	<key>UISupportedInterfaceOrientations~ipad</key>
    2.41 +	<array>
    2.42 +		<string>UIInterfaceOrientationPortrait</string>
    2.43 +		<string>UIInterfaceOrientationPortraitUpsideDown</string>
    2.44 +		<string>UIInterfaceOrientationLandscapeLeft</string>
    2.45 +		<string>UIInterfaceOrientationLandscapeRight</string>
    2.46 +	</array>
    2.47 +</dict>
    2.48 +</plist>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/istereo.xcodeproj/project.pbxproj	Wed Sep 16 07:10:02 2015 +0300
     3.3 @@ -0,0 +1,282 @@
     3.4 +// !$*UTF8*$!
     3.5 +{
     3.6 +	archiveVersion = 1;
     3.7 +	classes = {
     3.8 +	};
     3.9 +	objectVersion = 46;
    3.10 +	objects = {
    3.11 +
    3.12 +/* Begin PBXBuildFile section */
    3.13 +		0669D6751BA858BF00611CFA /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0669D6741BA858BF00611CFA /* Info.plist */; };
    3.14 +		0669D67F1BA85DDE00611CFA /* app_delegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0669D67B1BA85DDE00611CFA /* app_delegate.m */; };
    3.15 +		0669D6801BA85DDE00611CFA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0669D67C1BA85DDE00611CFA /* main.m */; };
    3.16 +		0669D6811BA85DDE00611CFA /* viewctl.m in Sources */ = {isa = PBXBuildFile; fileRef = 0669D67E1BA85DDE00611CFA /* viewctl.m */; };
    3.17 +/* End PBXBuildFile section */
    3.18 +
    3.19 +/* Begin PBXFileReference section */
    3.20 +		0669D6471BA851BE00611CFA /* istereo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = istereo.app; sourceTree = BUILT_PRODUCTS_DIR; };
    3.21 +		0669D6741BA858BF00611CFA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ios/Info.plist; sourceTree = "<group>"; };
    3.22 +		0669D67A1BA85DDE00611CFA /* app_delegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = app_delegate.h; path = src/ios/app_delegate.h; sourceTree = "<group>"; };
    3.23 +		0669D67B1BA85DDE00611CFA /* app_delegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = app_delegate.m; path = src/ios/app_delegate.m; sourceTree = "<group>"; };
    3.24 +		0669D67C1BA85DDE00611CFA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/ios/main.m; sourceTree = "<group>"; };
    3.25 +		0669D67D1BA85DDE00611CFA /* viewctl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = viewctl.h; path = src/ios/viewctl.h; sourceTree = "<group>"; };
    3.26 +		0669D67E1BA85DDE00611CFA /* viewctl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = viewctl.m; path = src/ios/viewctl.m; sourceTree = "<group>"; };
    3.27 +/* End PBXFileReference section */
    3.28 +
    3.29 +/* Begin PBXFrameworksBuildPhase section */
    3.30 +		0669D6441BA851BE00611CFA /* Frameworks */ = {
    3.31 +			isa = PBXFrameworksBuildPhase;
    3.32 +			buildActionMask = 2147483647;
    3.33 +			files = (
    3.34 +			);
    3.35 +			runOnlyForDeploymentPostprocessing = 0;
    3.36 +		};
    3.37 +/* End PBXFrameworksBuildPhase section */
    3.38 +
    3.39 +/* Begin PBXGroup section */
    3.40 +		0669D63E1BA851BE00611CFA = {
    3.41 +			isa = PBXGroup;
    3.42 +			children = (
    3.43 +				0669D6761BA858D600611CFA /* src */,
    3.44 +				0669D6741BA858BF00611CFA /* Info.plist */,
    3.45 +				0669D6481BA851BE00611CFA /* Products */,
    3.46 +			);
    3.47 +			sourceTree = "<group>";
    3.48 +		};
    3.49 +		0669D6481BA851BE00611CFA /* Products */ = {
    3.50 +			isa = PBXGroup;
    3.51 +			children = (
    3.52 +				0669D6471BA851BE00611CFA /* istereo.app */,
    3.53 +			);
    3.54 +			name = Products;
    3.55 +			sourceTree = "<group>";
    3.56 +		};
    3.57 +		0669D6761BA858D600611CFA /* src */ = {
    3.58 +			isa = PBXGroup;
    3.59 +			children = (
    3.60 +				0669D6791BA85DCC00611CFA /* ios */,
    3.61 +			);
    3.62 +			name = src;
    3.63 +			sourceTree = "<group>";
    3.64 +		};
    3.65 +		0669D6791BA85DCC00611CFA /* ios */ = {
    3.66 +			isa = PBXGroup;
    3.67 +			children = (
    3.68 +				0669D67A1BA85DDE00611CFA /* app_delegate.h */,
    3.69 +				0669D67B1BA85DDE00611CFA /* app_delegate.m */,
    3.70 +				0669D67C1BA85DDE00611CFA /* main.m */,
    3.71 +				0669D67D1BA85DDE00611CFA /* viewctl.h */,
    3.72 +				0669D67E1BA85DDE00611CFA /* viewctl.m */,
    3.73 +			);
    3.74 +			name = ios;
    3.75 +			sourceTree = "<group>";
    3.76 +		};
    3.77 +/* End PBXGroup section */
    3.78 +
    3.79 +/* Begin PBXNativeTarget section */
    3.80 +		0669D6461BA851BE00611CFA /* istereo */ = {
    3.81 +			isa = PBXNativeTarget;
    3.82 +			buildConfigurationList = 0669D66E1BA851BE00611CFA /* Build configuration list for PBXNativeTarget "istereo" */;
    3.83 +			buildPhases = (
    3.84 +				0669D6431BA851BE00611CFA /* Sources */,
    3.85 +				0669D6441BA851BE00611CFA /* Frameworks */,
    3.86 +				0669D6451BA851BE00611CFA /* Resources */,
    3.87 +			);
    3.88 +			buildRules = (
    3.89 +			);
    3.90 +			dependencies = (
    3.91 +			);
    3.92 +			name = istereo;
    3.93 +			productName = istereo;
    3.94 +			productReference = 0669D6471BA851BE00611CFA /* istereo.app */;
    3.95 +			productType = "com.apple.product-type.application";
    3.96 +		};
    3.97 +/* End PBXNativeTarget section */
    3.98 +
    3.99 +/* Begin PBXProject section */
   3.100 +		0669D63F1BA851BE00611CFA /* Project object */ = {
   3.101 +			isa = PBXProject;
   3.102 +			attributes = {
   3.103 +				LastUpgradeCheck = 0640;
   3.104 +				ORGANIZATIONNAME = "Mutant Stargoat";
   3.105 +				TargetAttributes = {
   3.106 +					0669D6461BA851BE00611CFA = {
   3.107 +						CreatedOnToolsVersion = 6.4;
   3.108 +						DevelopmentTeam = RGR8XFZ5JC;
   3.109 +					};
   3.110 +				};
   3.111 +			};
   3.112 +			buildConfigurationList = 0669D6421BA851BE00611CFA /* Build configuration list for PBXProject "istereo" */;
   3.113 +			compatibilityVersion = "Xcode 3.2";
   3.114 +			developmentRegion = English;
   3.115 +			hasScannedForEncodings = 0;
   3.116 +			knownRegions = (
   3.117 +				en,
   3.118 +				Base,
   3.119 +			);
   3.120 +			mainGroup = 0669D63E1BA851BE00611CFA;
   3.121 +			productRefGroup = 0669D6481BA851BE00611CFA /* Products */;
   3.122 +			projectDirPath = "";
   3.123 +			projectRoot = "";
   3.124 +			targets = (
   3.125 +				0669D6461BA851BE00611CFA /* istereo */,
   3.126 +			);
   3.127 +		};
   3.128 +/* End PBXProject section */
   3.129 +
   3.130 +/* Begin PBXResourcesBuildPhase section */
   3.131 +		0669D6451BA851BE00611CFA /* Resources */ = {
   3.132 +			isa = PBXResourcesBuildPhase;
   3.133 +			buildActionMask = 2147483647;
   3.134 +			files = (
   3.135 +				0669D6751BA858BF00611CFA /* Info.plist in Resources */,
   3.136 +			);
   3.137 +			runOnlyForDeploymentPostprocessing = 0;
   3.138 +		};
   3.139 +/* End PBXResourcesBuildPhase section */
   3.140 +
   3.141 +/* Begin PBXSourcesBuildPhase section */
   3.142 +		0669D6431BA851BE00611CFA /* Sources */ = {
   3.143 +			isa = PBXSourcesBuildPhase;
   3.144 +			buildActionMask = 2147483647;
   3.145 +			files = (
   3.146 +				0669D6801BA85DDE00611CFA /* main.m in Sources */,
   3.147 +				0669D6811BA85DDE00611CFA /* viewctl.m in Sources */,
   3.148 +				0669D67F1BA85DDE00611CFA /* app_delegate.m in Sources */,
   3.149 +			);
   3.150 +			runOnlyForDeploymentPostprocessing = 0;
   3.151 +		};
   3.152 +/* End PBXSourcesBuildPhase section */
   3.153 +
   3.154 +/* Begin XCBuildConfiguration section */
   3.155 +		0669D66C1BA851BE00611CFA /* Debug */ = {
   3.156 +			isa = XCBuildConfiguration;
   3.157 +			buildSettings = {
   3.158 +				ALWAYS_SEARCH_USER_PATHS = NO;
   3.159 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   3.160 +				CLANG_CXX_LIBRARY = "libc++";
   3.161 +				CLANG_ENABLE_MODULES = YES;
   3.162 +				CLANG_ENABLE_OBJC_ARC = YES;
   3.163 +				CLANG_WARN_BOOL_CONVERSION = YES;
   3.164 +				CLANG_WARN_CONSTANT_CONVERSION = YES;
   3.165 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   3.166 +				CLANG_WARN_EMPTY_BODY = YES;
   3.167 +				CLANG_WARN_ENUM_CONVERSION = YES;
   3.168 +				CLANG_WARN_INT_CONVERSION = YES;
   3.169 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   3.170 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   3.171 +				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   3.172 +				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
   3.173 +				COPY_PHASE_STRIP = NO;
   3.174 +				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
   3.175 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   3.176 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   3.177 +				GCC_DYNAMIC_NO_PIC = NO;
   3.178 +				GCC_NO_COMMON_BLOCKS = YES;
   3.179 +				GCC_OPTIMIZATION_LEVEL = 0;
   3.180 +				GCC_PREPROCESSOR_DEFINITIONS = (
   3.181 +					"DEBUG=1",
   3.182 +					"$(inherited)",
   3.183 +				);
   3.184 +				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
   3.185 +				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   3.186 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   3.187 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   3.188 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   3.189 +				GCC_WARN_UNUSED_FUNCTION = YES;
   3.190 +				GCC_WARN_UNUSED_VARIABLE = YES;
   3.191 +				IPHONEOS_DEPLOYMENT_TARGET = 6.0;
   3.192 +				MTL_ENABLE_DEBUG_INFO = YES;
   3.193 +				ONLY_ACTIVE_ARCH = YES;
   3.194 +				SDKROOT = iphoneos;
   3.195 +				TARGETED_DEVICE_FAMILY = "1,2";
   3.196 +			};
   3.197 +			name = Debug;
   3.198 +		};
   3.199 +		0669D66D1BA851BE00611CFA /* Release */ = {
   3.200 +			isa = XCBuildConfiguration;
   3.201 +			buildSettings = {
   3.202 +				ALWAYS_SEARCH_USER_PATHS = NO;
   3.203 +				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
   3.204 +				CLANG_CXX_LIBRARY = "libc++";
   3.205 +				CLANG_ENABLE_MODULES = YES;
   3.206 +				CLANG_ENABLE_OBJC_ARC = YES;
   3.207 +				CLANG_WARN_BOOL_CONVERSION = YES;
   3.208 +				CLANG_WARN_CONSTANT_CONVERSION = YES;
   3.209 +				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
   3.210 +				CLANG_WARN_EMPTY_BODY = YES;
   3.211 +				CLANG_WARN_ENUM_CONVERSION = YES;
   3.212 +				CLANG_WARN_INT_CONVERSION = YES;
   3.213 +				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
   3.214 +				CLANG_WARN_UNREACHABLE_CODE = YES;
   3.215 +				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
   3.216 +				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
   3.217 +				COPY_PHASE_STRIP = NO;
   3.218 +				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
   3.219 +				ENABLE_NS_ASSERTIONS = NO;
   3.220 +				ENABLE_STRICT_OBJC_MSGSEND = YES;
   3.221 +				GCC_C_LANGUAGE_STANDARD = gnu99;
   3.222 +				GCC_NO_COMMON_BLOCKS = YES;
   3.223 +				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
   3.224 +				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
   3.225 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
   3.226 +				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
   3.227 +				GCC_WARN_UNUSED_FUNCTION = YES;
   3.228 +				GCC_WARN_UNUSED_VARIABLE = YES;
   3.229 +				IPHONEOS_DEPLOYMENT_TARGET = 6.0;
   3.230 +				MTL_ENABLE_DEBUG_INFO = NO;
   3.231 +				SDKROOT = iphoneos;
   3.232 +				TARGETED_DEVICE_FAMILY = "1,2";
   3.233 +				VALIDATE_PRODUCT = YES;
   3.234 +			};
   3.235 +			name = Release;
   3.236 +		};
   3.237 +		0669D66F1BA851BE00611CFA /* Debug */ = {
   3.238 +			isa = XCBuildConfiguration;
   3.239 +			buildSettings = {
   3.240 +				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
   3.241 +				CODE_SIGN_IDENTITY = "iPhone Developer";
   3.242 +				INFOPLIST_FILE = "$(SRCROOT)/ios/Info.plist";
   3.243 +				IPHONEOS_DEPLOYMENT_TARGET = 6.0;
   3.244 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
   3.245 +				PRODUCT_NAME = "$(TARGET_NAME)";
   3.246 +			};
   3.247 +			name = Debug;
   3.248 +		};
   3.249 +		0669D6701BA851BE00611CFA /* Release */ = {
   3.250 +			isa = XCBuildConfiguration;
   3.251 +			buildSettings = {
   3.252 +				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
   3.253 +				CODE_SIGN_IDENTITY = "iPhone Developer";
   3.254 +				INFOPLIST_FILE = "$(SRCROOT)/ios/Info.plist";
   3.255 +				IPHONEOS_DEPLOYMENT_TARGET = 6.0;
   3.256 +				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
   3.257 +				PRODUCT_NAME = "$(TARGET_NAME)";
   3.258 +			};
   3.259 +			name = Release;
   3.260 +		};
   3.261 +/* End XCBuildConfiguration section */
   3.262 +
   3.263 +/* Begin XCConfigurationList section */
   3.264 +		0669D6421BA851BE00611CFA /* Build configuration list for PBXProject "istereo" */ = {
   3.265 +			isa = XCConfigurationList;
   3.266 +			buildConfigurations = (
   3.267 +				0669D66C1BA851BE00611CFA /* Debug */,
   3.268 +				0669D66D1BA851BE00611CFA /* Release */,
   3.269 +			);
   3.270 +			defaultConfigurationIsVisible = 0;
   3.271 +			defaultConfigurationName = Release;
   3.272 +		};
   3.273 +		0669D66E1BA851BE00611CFA /* Build configuration list for PBXNativeTarget "istereo" */ = {
   3.274 +			isa = XCConfigurationList;
   3.275 +			buildConfigurations = (
   3.276 +				0669D66F1BA851BE00611CFA /* Debug */,
   3.277 +				0669D6701BA851BE00611CFA /* Release */,
   3.278 +			);
   3.279 +			defaultConfigurationIsVisible = 0;
   3.280 +			defaultConfigurationName = Release;
   3.281 +		};
   3.282 +/* End XCConfigurationList section */
   3.283 +	};
   3.284 +	rootObject = 0669D63F1BA851BE00611CFA /* Project object */;
   3.285 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/ios/app_delegate.h	Wed Sep 16 07:10:02 2015 +0300
     4.3 @@ -0,0 +1,13 @@
     4.4 +#ifndef APP_DELEGATE_H_
     4.5 +#define APP_DELEGATE_H_
     4.6 +
     4.7 +#import <UIKit/UIKit.h>
     4.8 +
     4.9 +@interface AppDelegate : UIResponder <UIApplicationDelegate> {
    4.10 +}
    4.11 +
    4.12 +@property (nonatomic, retain) UIWindow *window;
    4.13 +
    4.14 +@end	/* AppDelegate */
    4.15 +
    4.16 +#endif	/* APP_DELEGATE_H_ */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/src/ios/app_delegate.m	Wed Sep 16 07:10:02 2015 +0300
     5.3 @@ -0,0 +1,63 @@
     5.4 +#import "app_delegate.h"
     5.5 +#import "viewctl.h"
     5.6 +
     5.7 +@implementation AppDelegate
     5.8 +
     5.9 +- (BOOL)application: (UIApplication*)app didFinishLaunchingWithOptions: (NSDictionary*)opt
    5.10 +{
    5.11 +	/* Override point for customization after application launch. */
    5.12 +	self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
    5.13 +	self.window.backgroundColor = [UIColor whiteColor];
    5.14 +	[self.window makeKeyAndVisible];
    5.15 +
    5.16 +	ViewController *vctl = [[ViewController alloc] initWithNibName: nil bundle: nil];
    5.17 +	self.window.rootViewController = vctl;
    5.18 +
    5.19 +	return YES;
    5.20 +}
    5.21 +
    5.22 +- (void)applicationWillResignActive: (UIApplication*)app
    5.23 +{
    5.24 +	/* Sent when the application is about to move from active to inactive
    5.25 +	 * state. This can occur for certain types of temporary interruptions (such
    5.26 +	 * as an incoming phone call or SMS message) or when the user quits the
    5.27 +	 * application and it begins the transition to the background state.  Use
    5.28 +	 * this method to pause ongoing tasks, disable timers, and throttle down
    5.29 +	 * OpenGL ES frame rates. Games should use this method to pause the game.
    5.30 +	 */
    5.31 +}
    5.32 +
    5.33 +- (void)applicationDidEnterBackground: (UIApplication*)app
    5.34 +{
    5.35 +	/* Use this method to release shared resources, save user data, invalidate
    5.36 +	 * timers, and store enough application state information to restore your
    5.37 +	 * application to its current state in case it is terminated later.  If
    5.38 +	 * your application supports background execution, this method is called
    5.39 +	 * instead of applicationWillTerminate:  when the user quits.
    5.40 +	 */
    5.41 +}
    5.42 +
    5.43 +- (void)applicationWillEnterForeground: (UIApplication*)app
    5.44 +{
    5.45 +	/* Called as part of the transition from the background to the inactive
    5.46 +	 * state; here you can undo many of the changes made on entering the
    5.47 +	 * background.
    5.48 +	 */
    5.49 +}
    5.50 +
    5.51 +- (void)applicationDidBecomeActive: (UIApplication*)app
    5.52 +{
    5.53 +	/* Restart any tasks that were paused (or not yet started) while the
    5.54 +	 * application was inactive. If the application was previously in the
    5.55 +	 * background, optionally refresh the user interface.
    5.56 +	 */
    5.57 +}
    5.58 +
    5.59 +- (void)applicationWillTerminate: (UIApplication*)app
    5.60 +{
    5.61 +	/* Called when the application is about to terminate. Save data if
    5.62 +	 * appropriate. See also applicationDidEnterBackground: .
    5.63 +	 */
    5.64 +}
    5.65 +
    5.66 +@end
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/ios/main.m	Wed Sep 16 07:10:02 2015 +0300
     6.3 @@ -0,0 +1,9 @@
     6.4 +#import <UIKit/UIKit.h>
     6.5 +#import "app_delegate.h"
     6.6 +
     6.7 +int main(int argc, char **argv)
     6.8 +{
     6.9 +	@autoreleasepool {
    6.10 +	    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    6.11 +	}
    6.12 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/ios/viewctl.h	Wed Sep 16 07:10:02 2015 +0300
     7.3 @@ -0,0 +1,10 @@
     7.4 +#ifndef VIEWCTL_H_
     7.5 +#define VIEWCTL_H_
     7.6 +
     7.7 +#import <UIKit/UIKit.h>
     7.8 +#import <GLKit/GLKit.h>
     7.9 +
    7.10 +@interface ViewController : GLKViewController
    7.11 +@end
    7.12 +
    7.13 +#endif	/* VIEWCTL_H_ */
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/ios/viewctl.m	Wed Sep 16 07:10:02 2015 +0300
     8.3 @@ -0,0 +1,83 @@
     8.4 +#import "viewctl.h"
     8.5 +#import <OpenGLES/ES2/glext.h>
     8.6 +
     8.7 +@interface ViewController () {
     8.8 +	EAGLContext *ctx;
     8.9 +}
    8.10 +
    8.11 +- (void)initgl;
    8.12 +- (void)destroygl;
    8.13 +@end
    8.14 +
    8.15 +@implementation ViewController
    8.16 +
    8.17 +- (void)viewDidLoad
    8.18 +{
    8.19 +    [super viewDidLoad];
    8.20 +
    8.21 +    self->ctx = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2];
    8.22 +    if(!self->ctx) {
    8.23 +        NSLog(@"Failed to create OpenGL ES 2.0 context");
    8.24 +    }
    8.25 +
    8.26 +    GLKView *view = (GLKView*)self.view;
    8.27 +    view.context = self->ctx;
    8.28 +    view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
    8.29 +
    8.30 +	[self initgl];
    8.31 +}
    8.32 +
    8.33 +- (void)dealloc
    8.34 +{
    8.35 +	[self destroygl];
    8.36 +
    8.37 +    if([EAGLContext currentContext] == self->ctx) {
    8.38 +        [EAGLContext setCurrentContext: nil];
    8.39 +    }
    8.40 +}
    8.41 +
    8.42 +- (void)didReceiveMemoryWarning
    8.43 +{
    8.44 +    [super didReceiveMemoryWarning];
    8.45 +
    8.46 +    if([self isViewLoaded] && ([[self view] window] == nil)) {
    8.47 +        self.view = nil;
    8.48 +
    8.49 +        [self destroygl];
    8.50 +
    8.51 +        if([EAGLContext currentContext] == self->ctx) {
    8.52 +            [EAGLContext setCurrentContext: nil];
    8.53 +        }
    8.54 +        self->ctx = nil;
    8.55 +    }
    8.56 +
    8.57 +    // Dispose of any resources that can be recreated.
    8.58 +}
    8.59 +
    8.60 +- (BOOL)prefersStatusBarHidden
    8.61 +{
    8.62 +    return YES;
    8.63 +}
    8.64 +
    8.65 +- (void)initgl
    8.66 +{
    8.67 +    [EAGLContext setCurrentContext: self->ctx];
    8.68 +
    8.69 +	glClearColor(1.0, 0.0, 0.0, 1.0);
    8.70 +}
    8.71 +
    8.72 +- (void)destroygl
    8.73 +{
    8.74 +    [EAGLContext setCurrentContext: self->ctx];
    8.75 +}
    8.76 +
    8.77 +- (void)update
    8.78 +{
    8.79 +}
    8.80 +
    8.81 +- (void)glkView: (GLKView*)view drawInRect: (CGRect)rect
    8.82 +{
    8.83 +    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    8.84 +}
    8.85 +
    8.86 +@end	/* implementation ViewController */