Skip to content
Browse files

init example

  • Loading branch information...
0 parents commit a170e083342e1905b43e027297b1f047afe7146b @jrwren committed Feb 7, 2012
289 HelloGLKit.xcodeproj/project.pbxproj
@@ -0,0 +1,289 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 354546921433C8990074AF72 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 354546911433C8990074AF72 /* UIKit.framework */; };
+ 354546941433C8990074AF72 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 354546931433C8990074AF72 /* Foundation.framework */; };
+ 354546961433C8990074AF72 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 354546951433C8990074AF72 /* CoreGraphics.framework */; };
+ 3545469C1433C8990074AF72 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3545469A1433C8990074AF72 /* InfoPlist.strings */; };
+ 3545469E1433C8990074AF72 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3545469D1433C8990074AF72 /* main.m */; };
+ 354546A21433C8990074AF72 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 354546A11433C8990074AF72 /* AppDelegate.m */; };
+ 354546AD1433CCE10074AF72 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 354546AC1433CCE10074AF72 /* QuartzCore.framework */; };
+ 354546AF1433CCE80074AF72 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 354546AE1433CCE80074AF72 /* OpenGLES.framework */; };
+ 354546B11433CCED0074AF72 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 354546B01433CCED0074AF72 /* GLKit.framework */; };
+ 354546B31433FFCD0074AF72 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 354546B21433FFCD0074AF72 /* MainStoryboard.storyboard */; };
+ 354546B61434008F0074AF72 /* HelloGLKitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 354546B51434008F0074AF72 /* HelloGLKitViewController.m */; };
+ 354546BA14342F0D0074AF72 /* tile_floor.png in Resources */ = {isa = PBXBuildFile; fileRef = 354546B914342F0D0074AF72 /* tile_floor.png */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 3545468D1433C8990074AF72 /* HelloGLKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloGLKit.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 354546911433C8990074AF72 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 354546931433C8990074AF72 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 354546951433C8990074AF72 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 354546991433C8990074AF72 /* HelloGLKit-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HelloGLKit-Info.plist"; sourceTree = "<group>"; };
+ 3545469B1433C8990074AF72 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3545469D1433C8990074AF72 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 3545469F1433C8990074AF72 /* HelloGLKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HelloGLKit-Prefix.pch"; sourceTree = "<group>"; };
+ 354546A01433C8990074AF72 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 354546A11433C8990074AF72 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 354546AC1433CCE10074AF72 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ 354546AE1433CCE80074AF72 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
+ 354546B01433CCED0074AF72 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
+ 354546B21433FFCD0074AF72 /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
+ 354546B41434008F0074AF72 /* HelloGLKitViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloGLKitViewController.h; sourceTree = "<group>"; };
+ 354546B51434008F0074AF72 /* HelloGLKitViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelloGLKitViewController.m; sourceTree = "<group>"; };
+ 354546B914342F0D0074AF72 /* tile_floor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tile_floor.png; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 3545468A1433C8990074AF72 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 354546B11433CCED0074AF72 /* GLKit.framework in Frameworks */,
+ 354546AF1433CCE80074AF72 /* OpenGLES.framework in Frameworks */,
+ 354546AD1433CCE10074AF72 /* QuartzCore.framework in Frameworks */,
+ 354546921433C8990074AF72 /* UIKit.framework in Frameworks */,
+ 354546941433C8990074AF72 /* Foundation.framework in Frameworks */,
+ 354546961433C8990074AF72 /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 354546821433C8990074AF72 = {
+ isa = PBXGroup;
+ children = (
+ 354546971433C8990074AF72 /* HelloGLKit */,
+ 354546901433C8990074AF72 /* Frameworks */,
+ 3545468E1433C8990074AF72 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 3545468E1433C8990074AF72 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 3545468D1433C8990074AF72 /* HelloGLKit.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 354546901433C8990074AF72 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 354546B01433CCED0074AF72 /* GLKit.framework */,
+ 354546AE1433CCE80074AF72 /* OpenGLES.framework */,
+ 354546AC1433CCE10074AF72 /* QuartzCore.framework */,
+ 354546911433C8990074AF72 /* UIKit.framework */,
+ 354546931433C8990074AF72 /* Foundation.framework */,
+ 354546951433C8990074AF72 /* CoreGraphics.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 354546971433C8990074AF72 /* HelloGLKit */ = {
+ isa = PBXGroup;
+ children = (
+ 354546B914342F0D0074AF72 /* tile_floor.png */,
+ 354546A01433C8990074AF72 /* AppDelegate.h */,
+ 354546A11433C8990074AF72 /* AppDelegate.m */,
+ 354546B41434008F0074AF72 /* HelloGLKitViewController.h */,
+ 354546B51434008F0074AF72 /* HelloGLKitViewController.m */,
+ 354546B21433FFCD0074AF72 /* MainStoryboard.storyboard */,
+ 354546981433C8990074AF72 /* Supporting Files */,
+ );
+ path = HelloGLKit;
+ sourceTree = "<group>";
+ };
+ 354546981433C8990074AF72 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 354546991433C8990074AF72 /* HelloGLKit-Info.plist */,
+ 3545469A1433C8990074AF72 /* InfoPlist.strings */,
+ 3545469D1433C8990074AF72 /* main.m */,
+ 3545469F1433C8990074AF72 /* HelloGLKit-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 3545468C1433C8990074AF72 /* HelloGLKit */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 354546A51433C8990074AF72 /* Build configuration list for PBXNativeTarget "HelloGLKit" */;
+ buildPhases = (
+ 354546891433C8990074AF72 /* Sources */,
+ 3545468A1433C8990074AF72 /* Frameworks */,
+ 3545468B1433C8990074AF72 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = HelloGLKit;
+ productName = HelloGLKit;
+ productReference = 3545468D1433C8990074AF72 /* HelloGLKit.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 354546841433C8990074AF72 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
+ buildConfigurationList = 354546871433C8990074AF72 /* Build configuration list for PBXProject "HelloGLKit" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 354546821433C8990074AF72;
+ productRefGroup = 3545468E1433C8990074AF72 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 3545468C1433C8990074AF72 /* HelloGLKit */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 3545468B1433C8990074AF72 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 3545469C1433C8990074AF72 /* InfoPlist.strings in Resources */,
+ 354546B31433FFCD0074AF72 /* MainStoryboard.storyboard in Resources */,
+ 354546BA14342F0D0074AF72 /* tile_floor.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 354546891433C8990074AF72 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 3545469E1433C8990074AF72 /* main.m in Sources */,
+ 354546A21433C8990074AF72 /* AppDelegate.m in Sources */,
+ 354546B61434008F0074AF72 /* HelloGLKitViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 3545469A1433C8990074AF72 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 3545469B1433C8990074AF72 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 354546A31433C8990074AF72 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 354546A41433C8990074AF72 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 354546A61433C8990074AF72 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "HelloGLKit/HelloGLKit-Prefix.pch";
+ INFOPLIST_FILE = "HelloGLKit/HelloGLKit-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 354546A71433C8990074AF72 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "HelloGLKit/HelloGLKit-Prefix.pch";
+ INFOPLIST_FILE = "HelloGLKit/HelloGLKit-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 354546871433C8990074AF72 /* Build configuration list for PBXProject "HelloGLKit" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 354546A31433C8990074AF72 /* Debug */,
+ 354546A41433C8990074AF72 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 354546A51433C8990074AF72 /* Build configuration list for PBXNativeTarget "HelloGLKit" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 354546A61433C8990074AF72 /* Debug */,
+ 354546A71433C8990074AF72 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 354546841433C8990074AF72 /* Project object */;
+}
7 HelloGLKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:HelloGLKit.xcodeproj">
+ </FileRef>
+</Workspace>
BIN ...roj/project.xcworkspace/xcuserdata/rwenderlich.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
5 HelloGLKit.xcodeproj/xcuserdata/rwenderlich.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+ type = "1"
+ version = "1.0">
+</Bucket>
84 HelloGLKit.xcodeproj/xcuserdata/rwenderlich.xcuserdatad/xcschemes/HelloGLKit.xcscheme
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "3545468C1433C8990074AF72"
+ BuildableName = "HelloGLKit.app"
+ BlueprintName = "HelloGLKit"
+ ReferencedContainer = "container:HelloGLKit.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "3545468C1433C8990074AF72"
+ BuildableName = "HelloGLKit.app"
+ BlueprintName = "HelloGLKit"
+ ReferencedContainer = "container:HelloGLKit.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "3545468C1433C8990074AF72"
+ BuildableName = "HelloGLKit.app"
+ BlueprintName = "HelloGLKit"
+ ReferencedContainer = "container:HelloGLKit.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "3545468C1433C8990074AF72"
+ BuildableName = "HelloGLKit.app"
+ BlueprintName = "HelloGLKit"
+ ReferencedContainer = "container:HelloGLKit.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
22 HelloGLKit.xcodeproj/xcuserdata/rwenderlich.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>HelloGLKit.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>3545468C1433C8990074AF72</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
16 HelloGLKit/AppDelegate.h
@@ -0,0 +1,16 @@
+//
+// AppDelegate.h
+// HelloGLKit
+//
+// Created by Ray Wenderlich on 9/28/11.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <GLKit/GLKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
66 HelloGLKit/AppDelegate.m
@@ -0,0 +1,66 @@
+//
+// AppDelegate.m
+// HelloGLKit
+//
+// Created by Ray Wenderlich on 9/28/11.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import <QuartzCore/QuartzCore.h>
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+
+/*- (void)render:(CADisplayLink*)displayLink {
+ GLKView * view = [self.window.subviews objectAtIndex:0];
+ [view display];
+}*/
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ /*
+ 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 *)application
+{
+ /*
+ 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 *)application
+{
+ /*
+ 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 *)application
+{
+ /*
+ 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 *)application
+{
+ /*
+ Called when the application is about to terminate.
+ Save data if appropriate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+
+@end
38 HelloGLKit/HelloGLKit-Info.plist
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFiles</key>
+ <array/>
+ <key>CFBundleIdentifier</key>
+ <string>com.raywenderlich.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UIMainStoryboardFile</key>
+ <string>MainStoryboard</string>
+</dict>
+</plist>
14 HelloGLKit/HelloGLKit-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'HelloGLKit' target in the 'HelloGLKit' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
13 HelloGLKit/HelloGLKitViewController.h
@@ -0,0 +1,13 @@
+//
+// HelloGLKitViewController.h
+// HelloGLKit
+//
+// Created by Ray Wenderlich on 9/28/11.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <GLKit/GLKit.h>
+
+@interface HelloGLKitViewController : GLKViewController
+
+@end
259 HelloGLKit/HelloGLKitViewController.m
@@ -0,0 +1,259 @@
+//
+// HelloGLKitViewController.m
+// HelloGLKit
+//
+// Created by Ray Wenderlich on 9/28/11.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "HelloGLKitViewController.h"
+
+typedef struct {
+ float Position[3];
+ float Color[4];
+ float TexCoord[2];
+} Vertex;
+
+const Vertex Vertices[] = {
+ // Front
+ {{1, -1, 1}, {1, 0, 0, 1}, {1, 0}},
+ {{1, 1, 1}, {0, 1, 0, 1}, {1, 1}},
+ {{-1, 1, 1}, {0, 0, 1, 1}, {0, 1}},
+ {{-1, -1, 1}, {0, 0, 0, 1}, {0, 0}},
+ // Back
+ {{1, 1, -1}, {1, 0, 0, 1}, {0, 1}},
+ {{-1, -1, -1}, {0, 1, 0, 1}, {1, 0}},
+ {{1, -1, -1}, {0, 0, 1, 1}, {0, 0}},
+ {{-1, 1, -1}, {0, 0, 0, 1}, {1, 1}},
+ // Left
+ {{-1, -1, 1}, {1, 0, 0, 1}, {1, 0}},
+ {{-1, 1, 1}, {0, 1, 0, 1}, {1, 1}},
+ {{-1, 1, -1}, {0, 0, 1, 1}, {0, 1}},
+ {{-1, -1, -1}, {0, 0, 0, 1}, {0, 0}},
+ // Right
+ {{1, -1, -1}, {1, 0, 0, 1}, {1, 0}},
+ {{1, 1, -1}, {0, 1, 0, 1}, {1, 1}},
+ {{1, 1, 1}, {0, 0, 1, 1}, {0, 1}},
+ {{1, -1, 1}, {0, 0, 0, 1}, {0, 0}},
+ // Top
+ {{1, 1, 1}, {1, 0, 0, 1}, {1, 0}},
+ {{1, 1, -1}, {0, 1, 0, 1}, {1, 1}},
+ {{-1, 1, -1}, {0, 0, 1, 1}, {0, 1}},
+ {{-1, 1, 1}, {0, 0, 0, 1}, {0, 0}},
+ // Bottom
+ {{1, -1, -1}, {1, 0, 0, 1}, {1, 0}},
+ {{1, -1, 1}, {0, 1, 0, 1}, {1, 1}},
+ {{-1, -1, 1}, {0, 0, 1, 1}, {0, 1}},
+ {{-1, -1, -1}, {0, 0, 0, 1}, {0, 0}}
+};
+
+const GLubyte Indices[] = {
+ // Front
+ 0, 1, 2,
+ 2, 3, 0,
+ // Back
+ 4, 6, 5,
+ 4, 5, 7,
+ // Left
+ 8, 9, 10,
+ 10, 11, 8,
+ // Right
+ 12, 13, 14,
+ 14, 15, 12,
+ // Top
+ 16, 17, 18,
+ 18, 19, 16,
+ // Bottom
+ 20, 21, 22,
+ 22, 23, 20
+};
+
+@interface HelloGLKitViewController () {
+ float _curRed;
+ BOOL _increasing;
+ GLuint _vertexBuffer;
+ GLuint _indexBuffer;
+ GLuint _vertexArray;
+ float _rotation;
+}
+@property (strong, nonatomic) EAGLContext *context;
+@property (strong, nonatomic) GLKBaseEffect *effect;
+
+@end
+
+@implementation HelloGLKitViewController
+@synthesize context = _context;
+@synthesize effect = _effect;
+// Rest of file...
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+- (void)didReceiveMemoryWarning
+{
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+/*
+// Implement loadView to create a view hierarchy programmatically, without using a nib.
+- (void)loadView
+{
+}
+*/
+
+- (void)setupGL {
+
+ [EAGLContext setCurrentContext:self.context];
+ glEnable(GL_CULL_FACE);
+
+ self.effect = [[GLKBaseEffect alloc] init];
+
+ NSDictionary * options = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:YES],
+ GLKTextureLoaderOriginBottomLeft,
+ nil];
+
+ NSError * error;
+ NSString *path = [[NSBundle mainBundle] pathForResource:@"tile_floor" ofType:@"png"];
+ GLKTextureInfo * info = [GLKTextureLoader textureWithContentsOfFile:path options:options error:&error];
+ if (info == nil) {
+ NSLog(@"Error loading file: %@", [error localizedDescription]);
+ }
+ self.effect.texture2d0.name = info.name;
+ self.effect.texture2d0.enabled = true;
+
+ // New lines
+ glGenVertexArraysOES(1, &_vertexArray);
+ glBindVertexArrayOES(_vertexArray);
+
+ // Old stuff
+ glGenBuffers(1, &_vertexBuffer);
+ glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(Vertices), Vertices, GL_STATIC_DRAW);
+
+ glGenBuffers(1, &_indexBuffer);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(Indices), Indices, GL_STATIC_DRAW);
+
+ // New lines (were previously in draw)
+ glEnableVertexAttribArray(GLKVertexAttribPosition);
+ glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid *) offsetof(Vertex, Position));
+ glEnableVertexAttribArray(GLKVertexAttribColor);
+ glVertexAttribPointer(GLKVertexAttribColor, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid *) offsetof(Vertex, Color));
+ glEnableVertexAttribArray(GLKVertexAttribTexCoord0);
+ glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid *) offsetof(Vertex, TexCoord));
+
+ // New line
+ glBindVertexArrayOES(0);
+
+}
+
+- (void)tearDownGL {
+
+ [EAGLContext setCurrentContext:self.context];
+
+ glDeleteBuffers(1, &_vertexBuffer);
+ glDeleteBuffers(1, &_indexBuffer);
+ //glDeleteVertexArraysOES(1, &_vertexArray);
+
+ self.effect = nil;
+
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
+
+ if (!self.context) {
+ NSLog(@"Failed to create ES context");
+ }
+
+ GLKView *view = (GLKView *)self.view;
+ view.context = self.context;
+ view.drawableMultisample = GLKViewDrawableMultisample4X;
+ [self setupGL];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ [self tearDownGL];
+
+ if ([EAGLContext currentContext] == self.context) {
+ [EAGLContext setCurrentContext:nil];
+ }
+ self.context = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+#pragma mark - GLKViewDelegate
+
+- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect {
+
+ glClearColor(_curRed, 0.0, 0.0, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ [self.effect prepareToDraw];
+
+ glBindVertexArrayOES(_vertexArray);
+ glDrawElements(GL_TRIANGLES, sizeof(Indices)/sizeof(Indices[0]), GL_UNSIGNED_BYTE, 0);
+
+}
+
+#pragma mark - GLKViewControllerDelegate
+
+- (void)update {
+ if (_increasing) {
+ _curRed += 1.0 * self.timeSinceLastUpdate;
+ } else {
+ _curRed -= 1.0 * self.timeSinceLastUpdate;
+ }
+ if (_curRed >= 1.0) {
+ _curRed = 1.0;
+ _increasing = NO;
+ }
+ if (_curRed <= 0.0) {
+ _curRed = 0.0;
+ _increasing = YES;
+ }
+
+ float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height);
+ GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 4.0f, 10.0f);
+ self.effect.transform.projectionMatrix = projectionMatrix;
+
+ GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -6.0f);
+ _rotation += 90 * self.timeSinceLastUpdate;
+ modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, GLKMathDegreesToRadians(25), 1, 0, 0);
+ modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, GLKMathDegreesToRadians(_rotation), 0, 1, 0);
+ self.effect.transform.modelviewMatrix = modelViewMatrix;
+
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ NSLog(@"timeSinceLastUpdate: %f", self.timeSinceLastUpdate);
+ NSLog(@"timeSinceLastDraw: %f", self.timeSinceLastDraw);
+ NSLog(@"timeSinceFirstResume: %f", self.timeSinceFirstResume);
+ NSLog(@"timeSinceLastResume: %f", self.timeSinceLastResume);
+ self.paused = !self.paused;
+}
+
+@end
32 HelloGLKit/MainStoryboard.storyboard
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.0" toolsVersion="1934" systemVersion="11B26" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="Na9-Gi-DfK">
+ <dependencies>
+ <development defaultVersion="4200" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="931"/>
+ </dependencies>
+ <scenes>
+ <scene sceneID="29S-Kq-flv">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="h7v-6h-Yct" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <viewController id="Na9-Gi-DfK" customClass="HelloGLKitViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="waO-jH-PLA" customClass="GLKView">
+ <rect key="frame" x="0.0" y="20" width="320" height="460"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ </viewController>
+ </objects>
+ <point key="canvasLocation" x="67" y="28"/>
+ </scene>
+ </scenes>
+ <classes>
+ <class className="HelloGLKitViewController" superclassName="GLKViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/HelloGLKitViewController.h"/>
+ </class>
+ </classes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
2 HelloGLKit/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
18 HelloGLKit/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// HelloGLKit
+//
+// Created by Ray Wenderlich on 9/28/11.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
BIN HelloGLKit/tile_floor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 README.md
@@ -0,0 +1,5 @@
+# opengl es example and tutorial
+
+http://www.raywenderlich.com/5235/beginning-opengl-es-2-0-with-glkit-part-2
+
+I found the tutorial a tiny bit hard to follow and I want to web browse the source to compare oto my source.

0 comments on commit a170e08

Please sign in to comment.
Something went wrong with that request. Please try again.