# HG changeset patch # User John Tsiombikas # Date 1442376602 -10800 # Node ID 7841e93650657d7827b127e66b6c951f68b784e6 new istereo done right diff -r 000000000000 -r 7841e9365065 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,7 @@ +\.o$ +\.swp$ +\.d$ +\.xcuserstate$ +\.xcworkspace +xcuserdata/ +^build/ diff -r 000000000000 -r 7841e9365065 ios/Info.plist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ios/Info.plist Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.mutantstargoat.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff -r 000000000000 -r 7841e9365065 istereo.xcodeproj/project.pbxproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/istereo.xcodeproj/project.pbxproj Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,282 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0669D6751BA858BF00611CFA /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0669D6741BA858BF00611CFA /* Info.plist */; }; + 0669D67F1BA85DDE00611CFA /* app_delegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0669D67B1BA85DDE00611CFA /* app_delegate.m */; }; + 0669D6801BA85DDE00611CFA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0669D67C1BA85DDE00611CFA /* main.m */; }; + 0669D6811BA85DDE00611CFA /* viewctl.m in Sources */ = {isa = PBXBuildFile; fileRef = 0669D67E1BA85DDE00611CFA /* viewctl.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 0669D6471BA851BE00611CFA /* istereo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = istereo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0669D6741BA858BF00611CFA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ios/Info.plist; sourceTree = ""; }; + 0669D67A1BA85DDE00611CFA /* app_delegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = app_delegate.h; path = src/ios/app_delegate.h; sourceTree = ""; }; + 0669D67B1BA85DDE00611CFA /* app_delegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = app_delegate.m; path = src/ios/app_delegate.m; sourceTree = ""; }; + 0669D67C1BA85DDE00611CFA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/ios/main.m; sourceTree = ""; }; + 0669D67D1BA85DDE00611CFA /* viewctl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = viewctl.h; path = src/ios/viewctl.h; sourceTree = ""; }; + 0669D67E1BA85DDE00611CFA /* viewctl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = viewctl.m; path = src/ios/viewctl.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0669D6441BA851BE00611CFA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0669D63E1BA851BE00611CFA = { + isa = PBXGroup; + children = ( + 0669D6761BA858D600611CFA /* src */, + 0669D6741BA858BF00611CFA /* Info.plist */, + 0669D6481BA851BE00611CFA /* Products */, + ); + sourceTree = ""; + }; + 0669D6481BA851BE00611CFA /* Products */ = { + isa = PBXGroup; + children = ( + 0669D6471BA851BE00611CFA /* istereo.app */, + ); + name = Products; + sourceTree = ""; + }; + 0669D6761BA858D600611CFA /* src */ = { + isa = PBXGroup; + children = ( + 0669D6791BA85DCC00611CFA /* ios */, + ); + name = src; + sourceTree = ""; + }; + 0669D6791BA85DCC00611CFA /* ios */ = { + isa = PBXGroup; + children = ( + 0669D67A1BA85DDE00611CFA /* app_delegate.h */, + 0669D67B1BA85DDE00611CFA /* app_delegate.m */, + 0669D67C1BA85DDE00611CFA /* main.m */, + 0669D67D1BA85DDE00611CFA /* viewctl.h */, + 0669D67E1BA85DDE00611CFA /* viewctl.m */, + ); + name = ios; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 0669D6461BA851BE00611CFA /* istereo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0669D66E1BA851BE00611CFA /* Build configuration list for PBXNativeTarget "istereo" */; + buildPhases = ( + 0669D6431BA851BE00611CFA /* Sources */, + 0669D6441BA851BE00611CFA /* Frameworks */, + 0669D6451BA851BE00611CFA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = istereo; + productName = istereo; + productReference = 0669D6471BA851BE00611CFA /* istereo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0669D63F1BA851BE00611CFA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + ORGANIZATIONNAME = "Mutant Stargoat"; + TargetAttributes = { + 0669D6461BA851BE00611CFA = { + CreatedOnToolsVersion = 6.4; + DevelopmentTeam = RGR8XFZ5JC; + }; + }; + }; + buildConfigurationList = 0669D6421BA851BE00611CFA /* Build configuration list for PBXProject "istereo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 0669D63E1BA851BE00611CFA; + productRefGroup = 0669D6481BA851BE00611CFA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 0669D6461BA851BE00611CFA /* istereo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 0669D6451BA851BE00611CFA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0669D6751BA858BF00611CFA /* Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 0669D6431BA851BE00611CFA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0669D6801BA85DDE00611CFA /* main.m in Sources */, + 0669D6811BA85DDE00611CFA /* viewctl.m in Sources */, + 0669D67F1BA85DDE00611CFA /* app_delegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0669D66C1BA851BE00611CFA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 0669D66D1BA851BE00611CFA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 0669D66F1BA851BE00611CFA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/ios/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 0669D6701BA851BE00611CFA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/ios/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0669D6421BA851BE00611CFA /* Build configuration list for PBXProject "istereo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0669D66C1BA851BE00611CFA /* Debug */, + 0669D66D1BA851BE00611CFA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0669D66E1BA851BE00611CFA /* Build configuration list for PBXNativeTarget "istereo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0669D66F1BA851BE00611CFA /* Debug */, + 0669D6701BA851BE00611CFA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0669D63F1BA851BE00611CFA /* Project object */; +} diff -r 000000000000 -r 7841e9365065 src/ios/app_delegate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ios/app_delegate.h Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,13 @@ +#ifndef APP_DELEGATE_H_ +#define APP_DELEGATE_H_ + +#import + +@interface AppDelegate : UIResponder { +} + +@property (nonatomic, retain) UIWindow *window; + +@end /* AppDelegate */ + +#endif /* APP_DELEGATE_H_ */ diff -r 000000000000 -r 7841e9365065 src/ios/app_delegate.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ios/app_delegate.m Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,63 @@ +#import "app_delegate.h" +#import "viewctl.h" + +@implementation AppDelegate + +- (BOOL)application: (UIApplication*)app didFinishLaunchingWithOptions: (NSDictionary*)opt +{ + /* Override point for customization after application launch. */ + self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + + ViewController *vctl = [[ViewController alloc] initWithNibName: nil bundle: nil]; + self.window.rootViewController = vctl; + + return YES; +} + +- (void)applicationWillResignActive: (UIApplication*)app +{ + /* Sent when the application is about to move from active to inactive + * state. This can occur for certain types of temporary interruptions (such + * as an incoming phone call or SMS message) or when the user quits the + * application and it begins the transition to the background state. Use + * this method to pause ongoing tasks, disable timers, and throttle down + * OpenGL ES frame rates. Games should use this method to pause the game. + */ +} + +- (void)applicationDidEnterBackground: (UIApplication*)app +{ + /* Use this method to release shared resources, save user data, invalidate + * timers, and store enough application state information to restore your + * application to its current state in case it is terminated later. If + * your application supports background execution, this method is called + * instead of applicationWillTerminate: when the user quits. + */ +} + +- (void)applicationWillEnterForeground: (UIApplication*)app +{ + /* Called as part of the transition from the background to the inactive + * state; here you can undo many of the changes made on entering the + * background. + */ +} + +- (void)applicationDidBecomeActive: (UIApplication*)app +{ + /* Restart any tasks that were paused (or not yet started) while the + * application was inactive. If the application was previously in the + * background, optionally refresh the user interface. + */ +} + +- (void)applicationWillTerminate: (UIApplication*)app +{ + /* Called when the application is about to terminate. Save data if + * appropriate. See also applicationDidEnterBackground: . + */ +} + +@end diff -r 000000000000 -r 7841e9365065 src/ios/main.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ios/main.m Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,9 @@ +#import +#import "app_delegate.h" + +int main(int argc, char **argv) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff -r 000000000000 -r 7841e9365065 src/ios/viewctl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ios/viewctl.h Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,10 @@ +#ifndef VIEWCTL_H_ +#define VIEWCTL_H_ + +#import +#import + +@interface ViewController : GLKViewController +@end + +#endif /* VIEWCTL_H_ */ diff -r 000000000000 -r 7841e9365065 src/ios/viewctl.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ios/viewctl.m Wed Sep 16 07:10:02 2015 +0300 @@ -0,0 +1,83 @@ +#import "viewctl.h" +#import + +@interface ViewController () { + EAGLContext *ctx; +} + +- (void)initgl; +- (void)destroygl; +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self->ctx = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2]; + if(!self->ctx) { + NSLog(@"Failed to create OpenGL ES 2.0 context"); + } + + GLKView *view = (GLKView*)self.view; + view.context = self->ctx; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [self initgl]; +} + +- (void)dealloc +{ + [self destroygl]; + + if([EAGLContext currentContext] == self->ctx) { + [EAGLContext setCurrentContext: nil]; + } +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + + if([self isViewLoaded] && ([[self view] window] == nil)) { + self.view = nil; + + [self destroygl]; + + if([EAGLContext currentContext] == self->ctx) { + [EAGLContext setCurrentContext: nil]; + } + self->ctx = nil; + } + + // Dispose of any resources that can be recreated. +} + +- (BOOL)prefersStatusBarHidden +{ + return YES; +} + +- (void)initgl +{ + [EAGLContext setCurrentContext: self->ctx]; + + glClearColor(1.0, 0.0, 0.0, 1.0); +} + +- (void)destroygl +{ + [EAGLContext setCurrentContext: self->ctx]; +} + +- (void)update +{ +} + +- (void)glkView: (GLKView*)view drawInRect: (CGRect)rect +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); +} + +@end /* implementation ViewController */