diff --git a/978-1-4302-3840-9_Ch05/.DS_Store b/978-1-4302-3840-9_Ch05/.DS_Store new file mode 100644 index 0000000..484814b Binary files /dev/null and b/978-1-4302-3840-9_Ch05/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/.DS_Store b/978-1-4302-3840-9_Ch05/Chapter 5/.DS_Store new file mode 100644 index 0000000..574a9ff Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/.DS_Store b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/.DS_Store new file mode 100644 index 0000000..e05973d Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.pbxproj b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1c05d3d --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.pbxproj @@ -0,0 +1,315 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncyTextureAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncyTextureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */; }; + CE59F65D141E880600B8160A /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CE59F65C141E880600B8160A /* hedly.png */; }; + CE59F663141E99FA00B8160A /* hedly_marked.pvr in Resources */ = {isa = PBXBuildFile; fileRef = CE59F662141E99FA00B8160A /* hedly_marked.pvr */; }; + CEFD492814402DEF00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD492414402DEF00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD492914402DEF00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD492614402DEF00CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* Bouncy Texture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Bouncy Texture.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* Bouncy Texture-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Bouncy Texture-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* Bouncy Texture-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bouncy Texture-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncyTextureAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncyTextureAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncyTextureAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncyTextureViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncyTextureViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncyTextureViewController.m; sourceTree = ""; }; + CE59F65C141E880600B8160A /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; + CE59F662141E99FA00B8160A /* hedly_marked.pvr */ = {isa = PBXFileReference; lastKnownFileType = file; name = hedly_marked.pvr; path = assets/hedly_marked.pvr; sourceTree = ""; }; + CEFD492514402DEF00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD492714402DEF00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* Bouncy Texture */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* Bouncy Texture.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* Bouncy Texture */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncyTextureAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncyTextureViewController.h */, + CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */, + CEFD492414402DEF00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD492614402DEF00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = "Bouncy Texture"; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE59F662141E99FA00B8160A /* hedly_marked.pvr */, + CE59F65C141E880600B8160A /* hedly.png */, + CE269CDB141BF49D00704362 /* Bouncy Texture-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* Bouncy Texture-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* Bouncy Texture */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "Bouncy Texture" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Bouncy Texture"; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* Bouncy Texture.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "Bouncy Texture" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* Bouncy Texture */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CE59F65D141E880600B8160A /* hedly.png in Resources */, + CE59F663141E99FA00B8160A /* hedly_marked.pvr in Resources */, + CEFD492814402DEF00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD492914402DEF00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncyTextureAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncyTextureViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD492414402DEF00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD492514402DEF00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD492614402DEF00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD492714402DEF00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/Bouncy Texture-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/Bouncy Texture-Info.plist"; + PRODUCT_NAME = "Bouncy Texture"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/Bouncy Texture-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/Bouncy Texture-Info.plist"; + PRODUCT_NAME = "Bouncy Texture"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "Bouncy Texture" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "Bouncy Texture" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..622f173 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..3cecc06 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/user.mode1v3 b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..ac88dad --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/user.mode1v3 @@ -0,0 +1,1361 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CE210997141EB78B00FB3E04 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 463}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 455 358 788 504 0 0 1920 1058 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {580, 277}} + RubberWindowFrame + 455 358 788 504 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 277pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 282}, {580, 181}} + RubberWindowFrame + 455 358 788 504 0 0 1920 1058 + + Module + XCDetailModule + Proportion + 181pt + + + Proportion + 580pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CE210995141EB78B00FB3E04 + 1CE0B1FE06471DED0097A5F4 + CE210996141EB78B00FB3E04 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CE210998141EB78B00FB3E04 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj + + WindowString + 455 358 788 504 0 0 1920 1058 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + 848 235 500 500 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + 848 235 500 500 0 0 1920 1058 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CE210998141EB78B00FB3E04 + CE210999141EB78B00FB3E04 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 848 235 500 500 0 0 1920 1058 + WindowToolGUID + CE210998141EB78B00FB3E04 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/user.pbxuser b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/user.pbxuser new file mode 100644 index 0000000..7503dd1 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE210986141EB78200FB3E04 /* Bouncy Texture */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = "Bouncy Texture"; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CE21099A141EB78B00FB3E04 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CE21099B141EB78B00FB3E04 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CE210986141EB78200FB3E04 /* Bouncy Texture */; + activeTarget = CE269CCA141BF49D00704362 /* Bouncy Texture */; + codeSenseManager = CE21099B141EB78B00FB3E04 /* Code sense */; + executables = ( + CE210986141EB78200FB3E04 /* Bouncy Texture */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 341, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337557378; + PBXWorkspaceStateSaveDate = 337557378; + }; + sourceControlManager = CE21099A141EB78B00FB3E04 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* Bouncy Texture */ = { + activeExec = 0; + executables = ( + CE210986141EB78200FB3E04 /* Bouncy Texture */, + ); + }; +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Bouncy Texture.xcscheme b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Bouncy Texture.xcscheme new file mode 100644 index 0000000..5982e2a --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Bouncy Texture.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..200ab41 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + Bouncy Texture.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/.DS_Store b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/.DS_Store new file mode 100644 index 0000000..f48df51 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/Bouncy Texture-Info.plist b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/Bouncy Texture-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/Bouncy Texture-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/Bouncy Texture-Prefix.pch b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/Bouncy Texture-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/Bouncy Texture-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureAppDelegate.h b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureAppDelegate.h new file mode 100644 index 0000000..f16fd30 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncyTextureAppDelegate.h +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncyTextureAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureAppDelegate.m b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureAppDelegate.m new file mode 100644 index 0000000..ad6e0ad --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncyTextureAppDelegate.m +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyTextureAppDelegate.h" + +@implementation BouncyTextureAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureViewController.h b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureViewController.h new file mode 100644 index 0000000..4d24fa6 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureViewController.h @@ -0,0 +1,19 @@ +// +// BouncyTextureViewController.h +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncyTextureViewController : GLKViewController +{ + GLKTextureInfo *m_Texture; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename; + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureViewController.m b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureViewController.m new file mode 100644 index 0000000..677a421 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/BouncyTextureViewController.m @@ -0,0 +1,138 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyTextureViewController.h" + +@interface BouncyTextureViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncyTextureViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [EAGLContext setCurrentContext:self.context]; + m_Texture=[self loadTexture:@"hedly.png"]; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = + { + -0.5f, -0.33f, + 0.5f, -0.15f, + -0.5f, 0.33f, + 0.5f, 0.15f, + }; +; + + static const GLubyte squareColors[] = { + 255, 255, 0, 255, + 0, 255, 255, 255, + 0, 0, 0, 0, + 255, 0, 255, 255, + }; + + static GLfloat textureCoords[] = + { + 0.0, 0.0, + 2.0, 0.0, + 0.0, 2.0, + 2.0, 2.0 + }; + + static float texIncrease=0.01; + textureCoords[0]+=texIncrease; + textureCoords[2]+=texIncrease; + textureCoords[4]+=texIncrease; + textureCoords[6]+=texIncrease; + textureCoords[1]+=texIncrease; + textureCoords[3]+=texIncrease; + textureCoords[5]+=texIncrease; + textureCoords[7]+=texIncrease; + + static float transY = 0.0f; + + glClearColor(0.5f, 0.5f, 0.5f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), 0.0f); + + transY += 0.075f; + + glVertexPointer(2, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors); + // glEnableClientState(GL_COLOR_ARRAY); + + + glEnable(GL_TEXTURE_2D); //2 + glEnable(GL_BLEND); //3 + glBlendFunc(GL_ONE, GL_SRC_COLOR); //4 + glBindTexture(GL_TEXTURE_2D,m_Texture.name); //5 + glTexCoordPointer(2, GL_FLOAT,0,textureCoords); //6 + glEnableClientState(GL_TEXTURE_COORD_ARRAY); //7 + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); //8 + + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); + + glDisableClientState(GL_TEXTURE_COORD_ARRAY); //9 +} + + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/hedly.png b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/hedly.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/hedly_marked.pvr b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/hedly_marked.pvr new file mode 100644 index 0000000..ac9e943 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/hedly_marked.pvr differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/moon_highlands.png b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/moon_highlands.png new file mode 100644 index 0000000..e90cff0 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/moon_highlands.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/moon_normal.highlands.png b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/moon_normal.highlands.png new file mode 100644 index 0000000..bb28687 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/moon_normal.highlands.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/usa_normal_hc.png b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/usa_normal_hc.png new file mode 100644 index 0000000..6755355 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/usa_normal_hc.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/usa_texture.png b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/assets/usa_texture.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/InfoPlist.strings b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..38ef246 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..2a0dde6 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/main.m b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/main.m new file mode 100644 index 0000000..c1ab8dd --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncyTextureAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncyTextureAppDelegate class])); + } +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/.DS_Store b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/.DS_Store new file mode 100644 index 0000000..cbaf8fa Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.pbxproj b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.pbxproj new file mode 100644 index 0000000..846aa87 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.pbxproj @@ -0,0 +1,311 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncyTextureAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */; }; + CE269CE7141BF49D00704362 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE269CE5141BF49D00704362 /* MainStoryboard_iPhone.storyboard */; }; + CE269CEA141BF49D00704362 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE269CE8141BF49D00704362 /* MainStoryboard_iPad.storyboard */; }; + CE269CF1141BF49D00704362 /* BouncyTextureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */; }; + CE59F65D141E880600B8160A /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CE59F65C141E880600B8160A /* hedly.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* Bouncy Texture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Bouncy Texture.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* Bouncy Texture-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Bouncy Texture-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* Bouncy Texture-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bouncy Texture-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncyTextureAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncyTextureAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncyTextureAppDelegate.m; sourceTree = ""; }; + CE269CE6141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + CE269CE9141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncyTextureViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncyTextureViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncyTextureViewController.m; sourceTree = ""; }; + CE59F65C141E880600B8160A /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* Bouncy Texture */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* Bouncy Texture.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* Bouncy Texture */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncyTextureAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */, + CE269CE5141BF49D00704362 /* MainStoryboard_iPhone.storyboard */, + CE269CE8141BF49D00704362 /* MainStoryboard_iPad.storyboard */, + CE269CEF141BF49D00704362 /* BouncyTextureViewController.h */, + CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = "Bouncy Texture"; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE59F65C141E880600B8160A /* hedly.png */, + CE269CDB141BF49D00704362 /* Bouncy Texture-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* Bouncy Texture-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* Bouncy Texture */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "Bouncy Texture" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Bouncy Texture"; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* Bouncy Texture.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "Bouncy Texture" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* Bouncy Texture */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CE269CE7141BF49D00704362 /* MainStoryboard_iPhone.storyboard in Resources */, + CE269CEA141BF49D00704362 /* MainStoryboard_iPad.storyboard in Resources */, + CE59F65D141E880600B8160A /* hedly.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncyTextureAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncyTextureViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CE269CE5141BF49D00704362 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE269CE6141BF49D00704362 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE269CE8141BF49D00704362 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE269CE9141BF49D00704362 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/Bouncy Texture-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/Bouncy Texture-Info.plist"; + PRODUCT_NAME = "Bouncy Texture"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/Bouncy Texture-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/Bouncy Texture-Info.plist"; + PRODUCT_NAME = "Bouncy Texture"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "Bouncy Texture" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "Bouncy Texture" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..622f173 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c3ad632 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..8061950 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/Bouncy Texture.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/.DS_Store b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/.DS_Store new file mode 100644 index 0000000..df38805 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/Bouncy Texture-Info.plist b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/Bouncy Texture-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/Bouncy Texture-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/Bouncy Texture-Prefix.pch b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/Bouncy Texture-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/Bouncy Texture-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureAppDelegate.h b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureAppDelegate.h new file mode 100644 index 0000000..f16fd30 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncyTextureAppDelegate.h +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncyTextureAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureAppDelegate.m b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureAppDelegate.m new file mode 100644 index 0000000..ad6e0ad --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncyTextureAppDelegate.m +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyTextureAppDelegate.h" + +@implementation BouncyTextureAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureViewController.h b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureViewController.h new file mode 100644 index 0000000..e6ca56a --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureViewController.h @@ -0,0 +1,14 @@ +// +// BouncyTextureViewController.h +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncyTextureViewController : GLKViewController + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureViewController.m b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureViewController.m new file mode 100644 index 0000000..6077ab3 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/BouncyTextureViewController.m @@ -0,0 +1,91 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyTextureViewController.h" + +@interface BouncyTextureViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncyTextureViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static int counter=0; + + static const GLfloat squareVertices[] = { + -0.5f, -0.33f, + 0.5f, -0.33f, + -0.5f, 0.33f, + 0.5f, 0.33f, + }; + + static const GLubyte squareColors[] = { + 255, 255, 0, 255, + 0, 255, 255, 255, + 0, 0, 0, 0, + 255, 0, 255, 255, + }; + + static float transY = 0.0f; + + glClearColor(0.5f, 0.5f, 0.5f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), 0.0f); + + transY += 0.075f; + + glVertexPointer(2, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors); + glEnableClientState(GL_COLOR_ARRAY); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + if(!(counter%100)) + NSLog(@"FPS: %d\n",self.framesPerSecond); + + counter++; +} + + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/hedly.png b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/hedly.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/hedly_marked.pvr b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/hedly_marked.pvr new file mode 100644 index 0000000..ac9e943 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/hedly_marked.pvr differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/moon_highlands.png b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/moon_highlands.png new file mode 100644 index 0000000..e90cff0 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/moon_highlands.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/moon_normal.highlands.png b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/moon_normal.highlands.png new file mode 100644 index 0000000..bb28687 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/moon_normal.highlands.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/usa_normal_hc.png b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/usa_normal_hc.png new file mode 100644 index 0000000..6755355 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/usa_normal_hc.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/usa_texture.png b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/assets/usa_texture.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/InfoPlist.strings b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..38ef246 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..2a0dde6 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/main.m b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/main.m new file mode 100644 index 0000000..c1ab8dd --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncyTextureAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncyTextureAppDelegate class])); + } +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/.DS_Store b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.pbxproj b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.pbxproj new file mode 100644 index 0000000..36b9eff --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.pbxproj @@ -0,0 +1,323 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE0E3F43141EFE0900799C5F /* earth_light.png in Resources */ = {isa = PBXBuildFile; fileRef = CE0E3F42141EFE0900799C5F /* earth_light.png */; }; + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */; }; + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */; }; + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */; }; + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */; }; + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE60A611141C652F000874FC /* InfoPlist.strings */; }; + CE60A616141C654B000874FC /* Planet.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A615141C654B000874FC /* Planet.m */; }; + CE96CD3A141C6671007DAAA7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD39141C6671007DAAA7 /* main.m */; }; + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE0E3F42141EFE0900799C5F /* earth_light.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = earth_light.png; path = OpenGLSolarSystem/assets/earth_light.png; sourceTree = SOURCE_ROOT; }; + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenGLSolarSystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystem.h; path = OpenGLSolarSystem/OpenGLSolarSystem.h; sourceTree = SOURCE_ROOT; }; + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemAppDelegate.h; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h; sourceTree = SOURCE_ROOT; }; + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemAppDelegate.m; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m; sourceTree = SOURCE_ROOT; }; + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemViewController.h; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.h; sourceTree = SOURCE_ROOT; }; + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemViewController.m; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.m; sourceTree = SOURCE_ROOT; }; + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "OpenGLSolarSystem-Info.plist"; path = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; sourceTree = SOURCE_ROOT; }; + CE60A60C141C6520000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A60F141C6527000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A612141C652F000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = OpenGLSolarSystem/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + CE60A614141C653E000874FC /* Planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Planet.h; path = OpenGLSolarSystem/Planet.h; sourceTree = SOURCE_ROOT; }; + CE60A615141C654B000874FC /* Planet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Planet.m; path = OpenGLSolarSystem/Planet.m; sourceTree = SOURCE_ROOT; }; + CE96CD39141C6671007DAAA7 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = OpenGLSolarSystem/main.m; sourceTree = SOURCE_ROOT; }; + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemController.h; path = OpenGLSolarSystem/OpenGLSolarSystemController.h; sourceTree = SOURCE_ROOT; }; + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemController.m; path = OpenGLSolarSystem/OpenGLSolarSystemController.m; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXGroup; + children = ( + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */, + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */, + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */, + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */, + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */, + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */, + CE60A614141C653E000874FC /* Planet.h */, + CE60A615141C654B000874FC /* Planet.m */, + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */, + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */, + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = OpenGLSolarSystem; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE0E3F42141EFE0900799C5F /* earth_light.png */, + CE96CD39141C6671007DAAA7 /* main.m */, + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */, + CE60A611141C652F000874FC /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpenGLSolarSystem; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */, + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */, + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */, + CE0E3F43141EFE0900799C5F /* earth_light.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */, + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */, + CE60A616141C654B000874FC /* Planet.m in Sources */, + CE96CD3A141C6671007DAAA7 /* main.m in Sources */, + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60C141C6520000874FC /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60F141C6527000874FC /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CE60A611141C652F000874FC /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE60A612141C652F000874FC /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41c6fd1 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..299975e Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/user.mode1v3 b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..cf456b3 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/user.mode1v3 @@ -0,0 +1,1363 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CEF317C6141C662400ADE1D0 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 404 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + CE269CD9141BF49D00704362 + CE269CDA141BF49D00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {404, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {421, 463}} + GroupTreeTableConfiguration + + MainColumn + 404 + + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXSmartGroupTreeModule + Proportion + 421pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {362, 277}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 277pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 282}, {362, 181}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + XCDetailModule + Proportion + 181pt + + + Proportion + 362pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CEF317C4141C662400ADE1D0 + 1CE0B1FE06471DED0097A5F4 + CEF317C5141C662400ADE1D0 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CEF317C7141C662400ADE1D0 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj + + WindowString + -1396 553 788 504 -1680 30 1680 1050 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CEF317C7141C662400ADE1D0 + CEF317C8141C662400ADE1D0 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + -1375 534 500 500 -1680 30 1680 1050 + WindowToolGUID + CEF317C7141C662400ADE1D0 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/user.pbxuser b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/user.pbxuser new file mode 100644 index 0000000..fa58c18 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */; + activeTarget = CE269CCA141BF49D00704362 /* OpenGLSolarSystem */; + codeSenseManager = CEF317CA141C662400ADE1D0 /* Code sense */; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 123, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337405452; + PBXWorkspaceStateSaveDate = 337405452; + }; + sourceControlManager = CEF317C9141C662400ADE1D0 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + activeExec = 0; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + }; + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = OpenGLSolarSystem; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CEF317C9141C662400ADE1D0 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CEF317CA141C662400ADE1D0 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme new file mode 100644 index 0000000..d1a3e4a --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e123ef3 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + OpenGLSolarSystem.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/.DS_Store b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/.DS_Store new file mode 100644 index 0000000..e064fc3 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/.DS_Store differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem.h b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem.h new file mode 100644 index 0000000..fa8742a --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystem.h @@ -0,0 +1,17 @@ +// +// OpenGLSolarSystem.h +// OpenGLSolarSystem +// +// Created by mike on 9/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef OpenGLSolarSystem_OpenGLSolarSystem_h +#define OpenGLSolarSystem_OpenGLSolarSystem_h + +#import +#define SS_SUNLIGHT GL_LIGHT0 //GL uses GL_LIGHTx +#define SS_FILLLIGHT1 GL_LIGHT1 +#define SS_FILLLIGHT2 GL_LIGHT2 + +#endif diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..c1338c5 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h @@ -0,0 +1,15 @@ +// +// OpenGLSolarSystemAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLSolarSystemAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..5947682 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m @@ -0,0 +1,60 @@ +// +// OpenGLSolarSystemAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystemAppDelegate.h" + +@implementation OpenGLSolarSystemAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemController.h b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemController.h new file mode 100644 index 0000000..c5f9bee --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemController.h @@ -0,0 +1,29 @@ +// +// OpenGLSolarSystemController.h +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// +#import +#import "Planet.h" + +#define X_VALUE 0 +#define Y_VALUE 1 +#define Z_VALUE 2 + + +@interface OpenGLSolarSystemController : NSObject +{ + Planet *m_Earth; + Planet *m_Sun; + GLfloat m_Eyeposition[3]; +} + +-(void)execute; +-(void)executePlanet:(Planet *)planet; +-(id)init; +-(void)initGeometry; + +@end + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemController.m b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemController.m new file mode 100644 index 0000000..cda908b --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemController.m @@ -0,0 +1,104 @@ +// +// OpenGLSolarSystemController.m +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" + +@implementation OpenGLSolarSystemController + +-(id)init +{ + [self initGeometry]; + + return self; +} + +-(void)initGeometry +{ + m_Eyeposition[X_VALUE]=0.0; //1 + m_Eyeposition[Y_VALUE]=0.0; + m_Eyeposition[Z_VALUE]=5.0; + + m_Earth=[[Planet alloc] init:50 slices:50 radius:.3 squash:1.0 textureFile:@"earth_light.png"]; //2 + [m_Earth setPositionX:0.0 Y:0.0 Z:-2.0]; //3 + + m_Sun=[[Planet alloc] init:50 slices:50 radius:1.0 squash:1.0 textureFile:nil]; //4 + [m_Sun setPositionX:0.0 Y:0.0 Z:0.0]; +} +-(void)execute +{ + GLfloat paleYellow[]={1.0,1.0,0.3,1.0}; //1 + GLfloat white[]={1.0,1.0,1.0,1.0}; + GLfloat cyan[]={0.0,1.0,1.0,1.0}; + GLfloat black[]={0.0,0.0,0.0,0.0}; //2 + static GLfloat angle=0.0; + GLfloat orbitalIncrement=1.25; //3 + GLfloat sunPos[3]={0.0,0.0,0.0}; + + glPushMatrix(); //4 + + glTranslatef(-m_Eyeposition[X_VALUE],-m_Eyeposition[Y_VALUE], //5 + -m_Eyeposition[Z_VALUE]); + + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); //6 + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cyan); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white); + + glPushMatrix(); //7 + + angle+=orbitalIncrement; //8 + + glRotatef(angle,0.0,1.0,0.0); //9 + + [self executePlanet:m_Earth]; //10 + + glPopMatrix(); //11 + + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, paleYellow); //12 + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, black); //13 + + [self executePlanet:m_Sun]; //14 + + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, black); //15 + + glPopMatrix(); //16 +} + +-(void)executePlanet:(Planet *)planet +{ + GLfloat posX, posY, posZ; + + glPushMatrix(); + + [planet getPositionX:&posX Y:&posY Z:&posZ]; //17 + + glTranslatef(posX,posY,posZ); //18 + + [planet execute]; //19 + + glPopMatrix(); +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:NULL error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemViewController.h b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..7a6e8c7 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemViewController.h @@ -0,0 +1,24 @@ +// +// OpenGLSolarSystemViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" + +@interface OpenGLSolarSystemViewController : GLKViewController +{ + OpenGLSolarSystemController *m_SolarSystem; + +}; + +-(void)viewDidLoad; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)setClipping; +-(void)initLighting; +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemViewController.m b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..6c7553e --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/OpenGLSolarSystemViewController.m @@ -0,0 +1,136 @@ +// +// OpenGL_SolarSystemViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemViewController.h" + +@interface OpenGLSolarSystemViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation OpenGLSolarSystemViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [EAGLContext setCurrentContext:self.context]; + + m_SolarSystem=[[OpenGLSolarSystemController alloc] init]; + + [self initLighting]; + [self setClipping]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + glEnable(GL_DEPTH_TEST); + + glClearColor(0.0f,0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + [m_SolarSystem execute]; +} + +-(void)initLighting +{ + GLfloat sunPos[]={0.0,0.0,0.0,1.0}; + GLfloat posFill1[]={-15.0,15.0,0.0,1.0}; + GLfloat posFill2[]={-10.0,-4.0,1.0,1.0}; + + GLfloat white[]={1.0,1.0,1.0,1.0}; + GLfloat dimblue[]={0.0,0.0,.2,1.0}; + + GLfloat cyan[]={0.0,1.0,1.0,1.0}; + GLfloat yellow[]={1.0,1.0,0.0,1.0}; + GLfloat dimmagenta[]={.75,0.0,.25,1.0}; + + GLfloat dimcyan[]={0.0,.5,.5,1.0}; + + //lights go here + + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); + glLightfv(SS_SUNLIGHT,GL_DIFFUSE,white); + glLightfv(SS_SUNLIGHT,GL_SPECULAR,yellow); + + glLightfv(SS_FILLLIGHT1,GL_POSITION,posFill1); + glLightfv(SS_FILLLIGHT1,GL_DIFFUSE,dimblue); + glLightfv(SS_FILLLIGHT1,GL_SPECULAR,dimcyan); + + glLightfv(SS_FILLLIGHT2,GL_POSITION,posFill2); + glLightfv(SS_FILLLIGHT2,GL_SPECULAR,dimmagenta); + glLightfv(SS_FILLLIGHT2,GL_DIFFUSE,dimblue); + + //materials go here + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cyan); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white); + + glLightf(SS_SUNLIGHT,GL_QUADRATIC_ATTENUATION,.001); + + glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,25); + + glShadeModel(GL_SMOOTH); + glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,0.0); + + glEnable(GL_LIGHTING); + glEnable(SS_SUNLIGHT); + glEnable(SS_FILLLIGHT1); + glEnable(SS_FILLLIGHT2); +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .1; + const float zFar = 1000; + const float fieldOfView = 60.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + aspectRatio=(float)frame.size.width/(float)frame.size.height; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (fieldOfView) / 2.0); + + glFrustumf(-size, size, -size /aspectRatio, size /aspectRatio, zNear, zFar); + glViewport(0, 0, frame.size.width, frame.size.height); + + glMatrixMode(GL_MODELVIEW); +} + + +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/Planet.h b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/Planet.h new file mode 100644 index 0000000..b230e7f --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/Planet.h @@ -0,0 +1,36 @@ +/**************************************************************************************** + * Planet.h : lifted from the iPhone Touchfighter exmaple code. Thanks! Apple! * + ****************************************************************************************/ +#import +#import +#import + +@interface Planet : NSObject +{ + +@private + GLfloat *m_VertexData; + GLubyte *m_ColorData; + GLfloat *m_NormalData; + GLfloat *m_TexCoordsData; + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; + GLfloat m_Angle; + GLfloat m_Pos[3]; + GLfloat m_RotationalIncrement; + + GLKTextureInfo *m_TextureInfo; +} + +-(bool)execute; +-(id)init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat)squash textureFile:(NSString *)textureFile; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z; +-(GLfloat)getRotation; +-(void)setRotation:(GLfloat)angle; +-(GLfloat)getRotationalIncrement; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +@end diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/Planet.m b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/Planet.m new file mode 100644 index 0000000..e4cef32 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/Planet.m @@ -0,0 +1,300 @@ +/* + +===== IMPORTANT ===== + +===================== + +File: Planet.m : taken from the Touchfighter example +Abstract: Planet. + +Version: 2.0 + + +*/ + +#import "Planet.h" + +GLshort *_texData=NULL; + +@implementation Planet + + + +-(id)init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat)squash textureFile:(NSString *)textureFile +{ + unsigned int colorIncrment=0; + unsigned int blue=0; + unsigned int red=255; + int numVertices=0; + + if(textureFile!=nil) + m_TextureInfo=[self loadTexture:textureFile]; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + m_TexCoordsData = nil; + + //vertices + + GLfloat *vPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * + (m_Stacks))); + + //color data + + GLubyte *cPtr = m_ColorData = + (GLubyte*)malloc(sizeof(GLubyte) * 4 * ((m_Slices*2+2) * + (m_Stacks))); + + //normal pointers for lighting + + GLfloat *nPtr = m_NormalData = (GLfloat*) + malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); + + GLfloat *tPtr=nil; //3 + + if(textureFile!=nil) + { + tPtr=m_TexCoordsData = + (GLfloat *)malloc(sizeof(GLfloat) * 2 * ((m_Slices*2+2) * + (m_Stacks))); + } + + unsigned int phiIdx, thetaIdx; + + //latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) + { + //starts at -1.57 goes up to +1.57 radians + + //the first circle + + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0/(float) + (m_Stacks)) - 0.5); + + //the next, or second one. + + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0/(float) + (m_Stacks)) - 0.5); + float cosPhi0 = cos(phi0); + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + //longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) + { + //Increment along the longitude circle each "slice." + + float theta = -2.0*M_PI * ((float)thetaIdx) * + (1.0/(float)(m_Slices-1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + //We're generating a vertical pair of points, such + //as the first point of stack 0 and the first point + //of stack 1 + //above it. This is how TRIANGLE_STRIPS work, + //taking a set of 4 vertices and essentially drawing + //two triangles + //at a time. The first is v0-v1-v2 and the next is + //v2-v1-v3. Etc. + + //Get x-y-z for the first vertex of stack. + + vPtr[0] = m_Scale*cosPhi0 * cosTheta; + vPtr[1] = m_Scale*sinPhi0*m_Squash; + vPtr[2] = m_Scale*(cosPhi0 * sinTheta); + + //the same but for the vertex immediately above the + //previous one + + vPtr[3] = m_Scale*cosPhi1 * cosTheta; + vPtr[4] = m_Scale*sinPhi1*m_Squash; + vPtr[5] = m_Scale*(cosPhi1 * sinTheta); + + //normal pointers for lighting + + nPtr[0] = cosPhi0 * cosTheta; + nPtr[2] = cosPhi0 * sinTheta; + nPtr[1] = sinPhi0; + + nPtr[3] = cosPhi1 * cosTheta; + nPtr[5] = cosPhi1 * sinTheta; + nPtr[4] = sinPhi1; + + if(tPtr!=nil) //4 + { + GLfloat texX = (float)thetaIdx * + (1.0f/(float)(m_Slices-1)); + tPtr[0] = texX; + tPtr[1] = (float)(phiIdx+0) * + (1.0f/(float)(m_Stacks)); + tPtr[2] = texX; + tPtr[3] = (float)(phiIdx+1) * + (1.0f/(float)(m_Stacks)); + } + + cPtr[0] = red; + cPtr[1] = 0; + cPtr[2] = blue; + cPtr[4] = red; + cPtr[5] = 0; + cPtr[6] = blue; + cPtr[3] = cPtr[7] = 255; + + cPtr += 2*4; + vPtr += 2*3; + nPtr += 2*3; + + + if(tPtr!=nil) //5 + tPtr += 2*2; + } + + blue+=colorIncrment; + red-=colorIncrment; + + // Degenerate triangle to connect stacks and maintain + //winding order. + + vPtr[0] = vPtr[3] = vPtr[-3]; + vPtr[1] = vPtr[4] = vPtr[-2]; + vPtr[2] = vPtr[5] = vPtr[-1]; + + nPtr[0] = nPtr[3] = nPtr[-3]; + nPtr[1] = nPtr[4] = nPtr[-2]; + nPtr[2] = nPtr[5] = nPtr[-1]; + + if(tPtr!=nil) + { + tPtr[0] = tPtr[2] = tPtr[-2]; //6 + tPtr[1] = tPtr[3] = tPtr[-1]; + } + + } + + numVertices=(vPtr-m_VertexData)/6; + } + + m_Angle=0.0; + m_RotationalIncrement=0.0; + + m_Pos[0]=0.0; + m_Pos[1]=0.0; + m_Pos[2]=0.0; + + return self; +} +-(bool)execute +{ + glMatrixMode(GL_MODELVIEW); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glFrontFace(GL_CW); + + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + if(m_TextureInfo!=nil) + { + glEnable(GL_TEXTURE_2D); //1 + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + if(m_TextureInfo!=0) + glBindTexture(GL_TEXTURE_2D, m_TextureInfo.name); + + glTexCoordPointer(2, GL_FLOAT, 0, m_TexCoordsData); + } + + + + glMatrixMode(GL_MODELVIEW); + + glVertexPointer(3, GL_FLOAT, 0, m_VertexData); + glNormalPointer(GL_FLOAT, 0, m_NormalData); + + glColorPointer(4, GL_UNSIGNED_BYTE, 0, m_ColorData); + glDrawArrays(GL_TRIANGLE_STRIP, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + glDisable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + return true; +} + +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z +{ + *x=m_Pos[0]; + *y=m_Pos[1]; + *z=m_Pos[2]; +} + +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z +{ + m_Pos[0]=x; + m_Pos[1]=y; + m_Pos[2]=z; +} + +-(GLfloat)getRotation +{ + return m_Angle; +} + +-(void)setRotation:(GLfloat)angle +{ + m_Angle=angle; +} + +-(void)incrementRotation +{ + m_Angle+=m_RotationalIncrement; +} + +-(GLfloat)getRotationalIncrement +{ + return m_RotationalIncrement; +} + +-(void)setRotationalIncrement:(GLfloat)inc +{ + m_RotationalIncrement=inc; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft, + [NSNumber numberWithBool:TRUE],GLKTextureLoaderGenerateMipmaps,nil]; + + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +@end \ No newline at end of file diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/assets/earth_light.png b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/assets/earth_light.png new file mode 100644 index 0000000..ff12df7 Binary files /dev/null and b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/assets/earth_light.png differ diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/InfoPlist.strings b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..6fe7ae9 --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..d77a83e --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/main.m b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/main.m new file mode 100644 index 0000000..60754fa --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "OpenGLSolarSystemAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([OpenGLSolarSystemAppDelegate class])); + } +} diff --git a/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps b/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps new file mode 160000 index 0000000..1f7566a --- /dev/null +++ b/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps @@ -0,0 +1 @@ +Subproject commit 1f7566a4e0a0ec7765d8c59745a3b3b956b93840 diff --git a/9781430238409.jpg b/9781430238409.jpg new file mode 100644 index 0000000..6b47235 Binary files /dev/null and b/9781430238409.jpg differ diff --git a/Chapter 1/.DS_Store b/Chapter 1/.DS_Store new file mode 100644 index 0000000..6d0ba5d Binary files /dev/null and b/Chapter 1/.DS_Store differ diff --git a/Chapter 1/OpeglBook First Project/.DS_Store b/Chapter 1/OpeglBook First Project/.DS_Store new file mode 100644 index 0000000..f9a7f98 Binary files /dev/null and b/Chapter 1/OpeglBook First Project/.DS_Store differ diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.pbxproj b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.pbxproj new file mode 100644 index 0000000..51bf365 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.pbxproj @@ -0,0 +1,314 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE3F5091141A7CFA00CDEE02 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE3F5090141A7CFA00CDEE02 /* UIKit.framework */; }; + CE3F5093141A7CFA00CDEE02 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE3F5092141A7CFA00CDEE02 /* Foundation.framework */; }; + CE3F5095141A7CFA00CDEE02 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE3F5094141A7CFA00CDEE02 /* CoreGraphics.framework */; }; + CE3F5097141A7CFA00CDEE02 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE3F5096141A7CFA00CDEE02 /* GLKit.framework */; }; + CE3F5099141A7CFA00CDEE02 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE3F5098141A7CFA00CDEE02 /* OpenGLES.framework */; }; + CE3F509F141A7CFA00CDEE02 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE3F509D141A7CFA00CDEE02 /* InfoPlist.strings */; }; + CE3F50A1141A7CFA00CDEE02 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE3F50A0141A7CFA00CDEE02 /* main.m */; }; + CE3F50A5141A7CFA00CDEE02 /* TwoCubesAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE3F50A4141A7CFA00CDEE02 /* TwoCubesAppDelegate.m */; }; + CE3F50AD141A7CFA00CDEE02 /* Shader.fsh in Resources */ = {isa = PBXBuildFile; fileRef = CE3F50AC141A7CFA00CDEE02 /* Shader.fsh */; }; + CE3F50AF141A7CFA00CDEE02 /* Shader.vsh in Resources */ = {isa = PBXBuildFile; fileRef = CE3F50AE141A7CFA00CDEE02 /* Shader.vsh */; }; + CE3F50B2141A7CFA00CDEE02 /* TwoCubesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE3F50B1141A7CFA00CDEE02 /* TwoCubesViewController.m */; }; + CEFD48F6144027AE00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD48F2144027AE00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD48F7144027AE00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD48F4144027AE00CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE3F508C141A7CFA00CDEE02 /* OpeglBook First Project.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "OpeglBook First Project.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + CE3F5090141A7CFA00CDEE02 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE3F5092141A7CFA00CDEE02 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE3F5094141A7CFA00CDEE02 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE3F5096141A7CFA00CDEE02 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE3F5098141A7CFA00CDEE02 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE3F509C141A7CFA00CDEE02 /* OpeglBook First Project-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OpeglBook First Project-Info.plist"; sourceTree = ""; }; + CE3F509E141A7CFA00CDEE02 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE3F50A0141A7CFA00CDEE02 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE3F50A2141A7CFA00CDEE02 /* OpeglBook First Project-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OpeglBook First Project-Prefix.pch"; sourceTree = ""; }; + CE3F50A3141A7CFA00CDEE02 /* TwoCubesAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TwoCubesAppDelegate.h; sourceTree = ""; }; + CE3F50A4141A7CFA00CDEE02 /* TwoCubesAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TwoCubesAppDelegate.m; sourceTree = ""; }; + CE3F50AC141A7CFA00CDEE02 /* Shader.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = Shader.fsh; path = Shaders/Shader.fsh; sourceTree = ""; }; + CE3F50AE141A7CFA00CDEE02 /* Shader.vsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = Shader.vsh; path = Shaders/Shader.vsh; sourceTree = ""; }; + CE3F50B0141A7CFA00CDEE02 /* TwoCubesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TwoCubesViewController.h; sourceTree = ""; }; + CE3F50B1141A7CFA00CDEE02 /* TwoCubesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TwoCubesViewController.m; sourceTree = ""; }; + CEFD48F3144027AE00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD48F5144027AE00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE3F5089141A7CFA00CDEE02 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE3F5091141A7CFA00CDEE02 /* UIKit.framework in Frameworks */, + CE3F5093141A7CFA00CDEE02 /* Foundation.framework in Frameworks */, + CE3F5095141A7CFA00CDEE02 /* CoreGraphics.framework in Frameworks */, + CE3F5097141A7CFA00CDEE02 /* GLKit.framework in Frameworks */, + CE3F5099141A7CFA00CDEE02 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE3F5081141A7CF900CDEE02 = { + isa = PBXGroup; + children = ( + CE3F509A141A7CFA00CDEE02 /* OpeglBook First Project */, + CE3F508F141A7CFA00CDEE02 /* Frameworks */, + CE3F508D141A7CFA00CDEE02 /* Products */, + ); + sourceTree = ""; + }; + CE3F508D141A7CFA00CDEE02 /* Products */ = { + isa = PBXGroup; + children = ( + CE3F508C141A7CFA00CDEE02 /* OpeglBook First Project.app */, + ); + name = Products; + sourceTree = ""; + }; + CE3F508F141A7CFA00CDEE02 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE3F5090141A7CFA00CDEE02 /* UIKit.framework */, + CE3F5092141A7CFA00CDEE02 /* Foundation.framework */, + CE3F5094141A7CFA00CDEE02 /* CoreGraphics.framework */, + CE3F5096141A7CFA00CDEE02 /* GLKit.framework */, + CE3F5098141A7CFA00CDEE02 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE3F509A141A7CFA00CDEE02 /* OpeglBook First Project */ = { + isa = PBXGroup; + children = ( + CE3F50A3141A7CFA00CDEE02 /* TwoCubesAppDelegate.h */, + CE3F50A4141A7CFA00CDEE02 /* TwoCubesAppDelegate.m */, + CE3F50AC141A7CFA00CDEE02 /* Shader.fsh */, + CE3F50AE141A7CFA00CDEE02 /* Shader.vsh */, + CE3F50B0141A7CFA00CDEE02 /* TwoCubesViewController.h */, + CE3F50B1141A7CFA00CDEE02 /* TwoCubesViewController.m */, + CEFD48F2144027AE00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD48F4144027AE00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE3F509B141A7CFA00CDEE02 /* Supporting Files */, + ); + path = "OpeglBook First Project"; + sourceTree = ""; + }; + CE3F509B141A7CFA00CDEE02 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE3F509C141A7CFA00CDEE02 /* OpeglBook First Project-Info.plist */, + CE3F509D141A7CFA00CDEE02 /* InfoPlist.strings */, + CE3F50A0141A7CFA00CDEE02 /* main.m */, + CE3F50A2141A7CFA00CDEE02 /* OpeglBook First Project-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE3F508B141A7CFA00CDEE02 /* OpeglBook First Project */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE3F50B5141A7CFA00CDEE02 /* Build configuration list for PBXNativeTarget "OpeglBook First Project" */; + buildPhases = ( + CE3F5088141A7CFA00CDEE02 /* Sources */, + CE3F5089141A7CFA00CDEE02 /* Frameworks */, + CE3F508A141A7CFA00CDEE02 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "OpeglBook First Project"; + productName = "OpeglBook First Project"; + productReference = CE3F508C141A7CFA00CDEE02 /* OpeglBook First Project.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE3F5083141A7CF900CDEE02 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE3F5086141A7CF900CDEE02 /* Build configuration list for PBXProject "OpeglBook First Project" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE3F5081141A7CF900CDEE02; + productRefGroup = CE3F508D141A7CFA00CDEE02 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE3F508B141A7CFA00CDEE02 /* OpeglBook First Project */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE3F508A141A7CFA00CDEE02 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE3F509F141A7CFA00CDEE02 /* InfoPlist.strings in Resources */, + CE3F50AD141A7CFA00CDEE02 /* Shader.fsh in Resources */, + CE3F50AF141A7CFA00CDEE02 /* Shader.vsh in Resources */, + CEFD48F6144027AE00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD48F7144027AE00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE3F5088141A7CFA00CDEE02 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE3F50A1141A7CFA00CDEE02 /* main.m in Sources */, + CE3F50A5141A7CFA00CDEE02 /* TwoCubesAppDelegate.m in Sources */, + CE3F50B2141A7CFA00CDEE02 /* TwoCubesViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE3F509D141A7CFA00CDEE02 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE3F509E141A7CFA00CDEE02 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD48F2144027AE00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD48F3144027AE00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD48F4144027AE00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD48F5144027AE00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE3F50B3141A7CFA00CDEE02 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE3F50B4141A7CFA00CDEE02 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE3F50B6141A7CFA00CDEE02 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpeglBook First Project/OpeglBook First Project-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpeglBook First Project/OpeglBook First Project-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE3F50B7141A7CFA00CDEE02 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpeglBook First Project/OpeglBook First Project-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpeglBook First Project/OpeglBook First Project-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE3F5086141A7CF900CDEE02 /* Build configuration list for PBXProject "OpeglBook First Project" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE3F50B3141A7CFA00CDEE02 /* Debug */, + CE3F50B4141A7CFA00CDEE02 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE3F50B5141A7CFA00CDEE02 /* Build configuration list for PBXNativeTarget "OpeglBook First Project" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE3F50B6141A7CFA00CDEE02 /* Debug */, + CE3F50B7141A7CFA00CDEE02 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE3F5083141A7CF900CDEE02 /* Project object */; +} diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6c2bd45 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..02fc76f Binary files /dev/null and b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/user.mode1v3 b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..9f00912 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/user.mode1v3 @@ -0,0 +1,1362 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CE37AF58141AF48700469BD9 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + servicesModulebreakpoints + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE3F5081141A7CF900CDEE02 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 463}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + -977 401 788 504 -1680 30 1680 1050 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {580, 269}} + RubberWindowFrame + -977 401 788 504 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 269pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 274}, {580, 189}} + RubberWindowFrame + -977 401 788 504 -1680 30 1680 1050 + + Module + XCDetailModule + Proportion + 189pt + + + Proportion + 580pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CE299DF1143D4EB7003F7304 + 1CE0B1FE06471DED0097A5F4 + CE299DF2143D4EB7003F7304 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CE37AF59141AF48700469BD9 + /Users/user/iPhoneProjects1/OpenGL Book/Apress Exercises For Downloading/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj + + WindowString + -977 401 788 504 -1680 30 1680 1050 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + -956 382 500 500 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + -956 382 500 500 -1680 30 1680 1050 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CE37AF59141AF48700469BD9 + CE299DF3143D4EB7003F7304 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + -956 382 500 500 -1680 30 1680 1050 + WindowToolGUID + CE37AF59141AF48700469BD9 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/user.pbxuser b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/user.pbxuser new file mode 100644 index 0000000..d0d213b --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE37AF51141AF48400469BD9 /* OpeglBook First Project */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = "OpeglBook First Project"; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CE37AF5B141AF48700469BD9 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CE37AF5C141AF48700469BD9 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + CE3F5083141A7CF900CDEE02 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CE37AF51141AF48400469BD9 /* OpeglBook First Project */; + activeTarget = CE3F508B141A7CFA00CDEE02 /* OpeglBook First Project */; + codeSenseManager = CE37AF5C141AF48700469BD9 /* Code sense */; + executables = ( + CE37AF51141AF48400469BD9 /* OpeglBook First Project */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 341, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 339562154; + PBXWorkspaceStateSaveDate = 339562154; + }; + sourceControlManager = CE37AF5B141AF48700469BD9 /* Source Control */; + userBuildSettings = { + }; + }; + CE3F508B141A7CFA00CDEE02 /* OpeglBook First Project */ = { + activeExec = 0; + executables = ( + CE37AF51141AF48400469BD9 /* OpeglBook First Project */, + ); + }; +} diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpeglBook First Project.xcscheme b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpeglBook First Project.xcscheme new file mode 100644 index 0000000..2ad872f --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpeglBook First Project.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e72a4a2 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + OpeglBook First Project.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE3F508B141A7CFA00CDEE02 + + primary + + + + + diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/.DS_Store b/Chapter 1/OpeglBook First Project/OpeglBook First Project/.DS_Store new file mode 100644 index 0000000..36e3fca Binary files /dev/null and b/Chapter 1/OpeglBook First Project/OpeglBook First Project/.DS_Store differ diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/OpeglBook First Project-Info.plist b/Chapter 1/OpeglBook First Project/OpeglBook First Project/OpeglBook First Project-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/OpeglBook First Project-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/OpeglBook First Project-Prefix.pch b/Chapter 1/OpeglBook First Project/OpeglBook First Project/OpeglBook First Project-Prefix.pch new file mode 100644 index 0000000..761d31a --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/OpeglBook First Project-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'OpeglBook First Project' target in the 'OpeglBook First Project' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/Shader.fsh b/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/Shader.fsh new file mode 100644 index 0000000..3f88edb --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/Shader.fsh @@ -0,0 +1,14 @@ +// +// Shader.fsh +// OpeglBook First Project +// +// Created by mike on 9/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +varying lowp vec4 colorVarying; + +void main() +{ + gl_FragColor = colorVarying; +} diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/Shader.vsh b/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/Shader.vsh new file mode 100644 index 0000000..b8767f8 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/Shader.vsh @@ -0,0 +1,28 @@ +// +// Shader.vsh +// OpeglBook First Project +// +// Created by mike on 9/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +attribute vec4 position; +attribute vec3 normal; + +varying lowp vec4 colorVarying; + +uniform mat4 modelViewProjectionMatrix; +uniform mat3 normalMatrix; + +void main() +{ + vec3 eyeNormal = normalize(normalMatrix * normal); + vec3 lightPosition = vec3(0.0, 0.0, 1.0); + vec4 diffuseColor = vec4(0.4, 0.4, 1.0, 1.0); + + float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition))); + + colorVarying = diffuseColor * nDotVP; + + gl_Position = modelViewProjectionMatrix * position; +} diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesAppDelegate.h b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesAppDelegate.h new file mode 100644 index 0000000..832e666 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesAppDelegate.h @@ -0,0 +1,15 @@ +// +// TwoCubesAppDelegate.h +// OpeglBook First Project +// +// Created by mike on 9/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface TwoCubesAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesAppDelegate.m b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesAppDelegate.m new file mode 100644 index 0000000..8c802ee --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesAppDelegate.m @@ -0,0 +1,60 @@ +// +// TwoCubesAppDelegate.m +// OpeglBook First Project +// +// Created by mike on 9/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "TwoCubesAppDelegate.h" + +@implementation TwoCubesAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesViewController.h b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesViewController.h new file mode 100644 index 0000000..8e95458 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesViewController.h @@ -0,0 +1,14 @@ +// +// TwoCubesViewController.h +// OpeglBook First Project +// +// Created by mike on 9/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface TwoCubesViewController : GLKViewController + +@end diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesViewController.m b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesViewController.m new file mode 100644 index 0000000..f9fc3fd --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/TwoCubesViewController.m @@ -0,0 +1,442 @@ +// +// TwoCubesViewController.m +// OpeglBook First Project +// +// Created by mike on 9/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "TwoCubesViewController.h" + +#define BUFFER_OFFSET(i) ((char *)NULL + (i)) + +// Uniform index. +enum +{ + UNIFORM_MODELVIEWPROJECTION_MATRIX, + UNIFORM_NORMAL_MATRIX, + NUM_UNIFORMS +}; +GLint uniforms[NUM_UNIFORMS]; + +// Attribute index. +enum +{ + ATTRIB_VERTEX, + ATTRIB_NORMAL, + NUM_ATTRIBUTES +}; + +GLfloat gCubeVertexData[216] = +{ + // Data layout for each line below is: + // positionX, positionY, positionZ, normalX, normalY, normalZ, + 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, + + 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, + 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, + 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, + -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, + + -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, + + -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, + 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, + -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, + -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, + 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, + + 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + + 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f +}; + +@interface TwoCubesViewController () { + GLuint _program; + + GLKMatrix4 _modelViewProjectionMatrix; + GLKMatrix3 _normalMatrix; + float _rotation; + + GLuint _vertexArray; + GLuint _vertexBuffer; +} +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +- (void)setupGL; +- (void)tearDownGL; + +- (BOOL)loadShaders; +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file; +- (BOOL)linkProgram:(GLuint)prog; +- (BOOL)validateProgram:(GLuint)prog; +@end + +@implementation TwoCubesViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (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.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [self setupGL]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + + [self tearDownGL]; + + if ([EAGLContext currentContext] == self.context) { + [EAGLContext setCurrentContext:nil]; + } + self.context = nil; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Release any cached data, images, etc. that aren't in use. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + // Return YES for supported orientations + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); + } else { + return YES; + } +} + +- (void)setupGL +{ + [EAGLContext setCurrentContext:self.context]; + + [self loadShaders]; + + self.effect = [[GLKBaseEffect alloc] init]; + self.effect.light0.enabled = GL_TRUE; + self.effect.light0.diffuseColor = GLKVector4Make(1.0f, 0.4f, 0.4f, 1.0f); + + glEnable(GL_DEPTH_TEST); + + glGenVertexArraysOES(1, &_vertexArray); + glBindVertexArrayOES(_vertexArray); + + glGenBuffers(1, &_vertexBuffer); + glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); + glBufferData(GL_ARRAY_BUFFER, sizeof(gCubeVertexData), gCubeVertexData, GL_STATIC_DRAW); + + glEnableVertexAttribArray(GLKVertexAttribPosition); + glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(0)); + glEnableVertexAttribArray(GLKVertexAttribNormal); + glVertexAttribPointer(GLKVertexAttribNormal, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(12)); + + glBindVertexArrayOES(0); +} + +- (void)tearDownGL +{ + [EAGLContext setCurrentContext:self.context]; + + glDeleteBuffers(1, &_vertexBuffer); + glDeleteVertexArraysOES(1, &_vertexArray); + + self.effect = nil; + + if (_program) { + glDeleteProgram(_program); + _program = 0; + } +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)update +{ + float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height); + GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f); + + self.effect.transform.projectionMatrix = projectionMatrix; + + GLKMatrix4 baseModelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -4.0f); + baseModelViewMatrix = GLKMatrix4Rotate(baseModelViewMatrix, _rotation, 0.0f, 1.0f, 0.0f); + + // Compute the model view matrix for the object rendered with GLKit + GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -1.5f); + modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, _rotation, 1.0f, 1.0f, 1.0f); + modelViewMatrix = GLKMatrix4Multiply(baseModelViewMatrix, modelViewMatrix); + + self.effect.transform.modelviewMatrix = modelViewMatrix; + + // Compute the model view matrix for the object rendered with ES2 + modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, 1.5f); + modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, _rotation, 1.0f, 1.0f, 1.0f); + modelViewMatrix = GLKMatrix4Multiply(baseModelViewMatrix, modelViewMatrix); + + _normalMatrix = GLKMatrix3InvertAndTranspose(GLKMatrix4GetMatrix3(modelViewMatrix), NULL); + + _modelViewProjectionMatrix = GLKMatrix4Multiply(projectionMatrix, modelViewMatrix); + + _rotation += self.timeSinceLastUpdate * 0.5f; +} + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + glClearColor(0.65f, 0.65f, 0.65f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glBindVertexArrayOES(_vertexArray); + + // Render the object with GLKit + [self.effect prepareToDraw]; + + glDrawArrays(GL_TRIANGLES, 0, 36); + + // Render the object again with ES2 + glUseProgram(_program); + + glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX], 1, 0, _modelViewProjectionMatrix.m); + glUniformMatrix3fv(uniforms[UNIFORM_NORMAL_MATRIX], 1, 0, _normalMatrix.m); + + glDrawArrays(GL_TRIANGLES, 0, 36); +} + +#pragma mark - OpenGL ES 2 shader compilation + +- (BOOL)loadShaders +{ + GLuint vertShader, fragShader; + NSString *vertShaderPathname, *fragShaderPathname; + + // Create shader program. + + _program = glCreateProgram(); + + // Create and compile vertex shader. + + vertShaderPathname = [[NSBundle mainBundle] + pathForResource:@"Shader" ofType:@"vsh"]; + + if (![self compileShader:&vertShader + type:GL_VERTEX_SHADER file:vertShaderPathname]) + { + NSLog(@"Failed to compile vertex shader"); + return NO; + } + + // Create and compile fragment shader. + + fragShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"fsh"]; + + if (![self compileShader:&fragShader + type:GL_FRAGMENT_SHADER file:fragShaderPathname]) + { + NSLog(@"Failed to compile fragment shader"); + return NO; + } + + // Attach vertex shader to program. + + glAttachShader(_program, vertShader); + + // Attach fragment shader to program. + + glAttachShader(_program, fragShader); + + // Bind attribute locations. + // This needs to be done prior to linking. + + glBindAttribLocation(_program, ATTRIB_VERTEX, "position"); + glBindAttribLocation(_program, ATTRIB_NORMAL, "normal"); + + // Link program. + + if (![self linkProgram:_program]) + { + NSLog(@"Failed to link program: %d", _program); + + if (vertShader) + { + glDeleteShader(vertShader); + vertShader = 0; + } + + if (fragShader) + { + glDeleteShader(fragShader); + fragShader = 0; + } + + if (_program) + { + glDeleteProgram(_program); + _program = 0; + } + + return NO; + } + + // Get uniform locations. + + uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX] = + glGetUniformLocation(_program, "modelViewProjectionMatrix"); + + uniforms[UNIFORM_NORMAL_MATRIX] = + glGetUniformLocation(_program, "normalMatrix"); + + // Release vertex and fragment shaders. + + if (vertShader) + { + glDetachShader(_program, vertShader); + glDeleteShader(vertShader); + } + + if (fragShader) + { + glDetachShader(_program, fragShader); + glDeleteShader(fragShader); + } + + return YES; +} + +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file +{ + GLint status; + const GLchar *source; + + source = (GLchar *)[[NSString stringWithContentsOfFile:file + encoding:NSUTF8StringEncoding error:nil] UTF8String]; + + if (!source) + { + NSLog(@"Failed to load vertex shader"); + return NO; + } + + *shader = glCreateShader(type); + + glShaderSource(*shader, 1, &source, NULL); + glCompileShader(*shader); + +#if defined(DEBUG) + + GLint logLength; + glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); + + if (logLength > 0) + { + GLchar *log = (GLchar *)malloc(logLength); + glGetShaderInfoLog(*shader, logLength, &logLength, log); + NSLog(@"Shader compile log:\n%s", log); + free(log); + } + +#endif + + glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); + + if (status == 0) + { + glDeleteShader(*shader); + return NO; + } + + return YES; +} + +- (BOOL)linkProgram:(GLuint)prog +{ + GLint status; + glLinkProgram(prog); + +#if defined(DEBUG) + GLint logLength; + + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + + if (logLength > 0) + { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program link log:\n%s", log); + free(log); + } +#endif + + glGetProgramiv(prog, GL_LINK_STATUS, &status); + + if (status == 0) + { + return NO; + } + + return YES; +} + +- (BOOL)validateProgram:(GLuint)prog +{ + GLint logLength, status; + + glValidateProgram(prog); + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + + if (logLength > 0) + { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program validate log:\n%s", log); + free(log); + } + + glGetProgramiv(prog, GL_VALIDATE_STATUS, &status); + + if (status == 0) + { + return NO; + } + + return YES; +} + +@end diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/InfoPlist.strings b/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..b614e25 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..a96c7f5 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 1/OpeglBook First Project/OpeglBook First Project/main.m b/Chapter 1/OpeglBook First Project/OpeglBook First Project/main.m new file mode 100644 index 0000000..d2e6b16 --- /dev/null +++ b/Chapter 1/OpeglBook First Project/OpeglBook First Project/main.m @@ -0,0 +1,18 @@ +// +// main.m +// OpeglBook First Project +// +// Created by mike on 9/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "TwoCubesAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([TwoCubesAppDelegate class])); + } +} diff --git a/Chapter 10/.DS_Store b/Chapter 10/.DS_Store new file mode 100644 index 0000000..410e0c1 Binary files /dev/null and b/Chapter 10/.DS_Store differ diff --git a/Chapter 10/EarthAtNight/.DS_Store b/Chapter 10/EarthAtNight/.DS_Store new file mode 100644 index 0000000..74f169d Binary files /dev/null and b/Chapter 10/EarthAtNight/.DS_Store differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/.DS_Store b/Chapter 10/EarthAtNight/AtmoShader/.DS_Store new file mode 100644 index 0000000..d1a8fac Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/.DS_Store differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/EarthAtNight-Info.plist b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNight-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNight-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 10/EarthAtNight/AtmoShader/EarthAtNight-Prefix.pch b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNight-Prefix.pch new file mode 100644 index 0000000..25b7624 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNight-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'AtmoShader' target in the 'AtmoShader' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightAppDelegate.h b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightAppDelegate.h new file mode 100644 index 0000000..8d059a5 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightAppDelegate.h @@ -0,0 +1,15 @@ +// +// EarthAtNightAppDelegate.h +// EarthAtNight +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface EarthAtNightAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightAppDelegate.m b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightAppDelegate.m new file mode 100644 index 0000000..ebbfc5b --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightAppDelegate.m @@ -0,0 +1,60 @@ +// +// EarthAtNightAppDelegate.m +// EarthAtNight +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "EarthAtNightAppDelegate.h" + +@implementation EarthAtNightAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightViewController.h b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightViewController.h new file mode 100644 index 0000000..77353d7 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightViewController.h @@ -0,0 +1,14 @@ +// +// EarthAtNightViewController.h +// EarthAtNight +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface EarthAtNightViewController : GLKViewController + +@end diff --git a/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightViewController.m b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightViewController.m new file mode 100644 index 0000000..0a2d5fe --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/EarthAtNightViewController.m @@ -0,0 +1,479 @@ +// +// EarthAtNightViewController.m +// EarthAtNight +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + + +#import "Atmosphere.h" +#import "EarthAtNightViewController.h" + +#import "planet.h" +#import "OpenglIOS.h" + +#define BUFFER_OFFSET(i) ((char *)NULL + (i)) + +// Uniform index. +enum +{ + UNIFORM_MODELVIEWPROJECTION_MATRIX, + UNIFORM_NORMAL_MATRIX, + UNIFORM_LIGHT_POSITION, + UNIFORM_EYE_POSITION, + UNIFORM_SAMPLER0, + UNIFORM_SAMPLER1, + NUM_UNIFORMS +}; +GLint uniforms[NUM_UNIFORMS]; + +// Attribute index. +enum +{ + ATTRIB_VERTEX, + ATTRIB_NORMAL, + NUM_ATTRIBUTES +}; + +@interface EarthAtNightViewController () +{ + GLuint m_DaysideProgram; + GLuint m_NightsideProgram; + GLuint m_AtmoProgram; + + float m_Rotation; + + GLuint m_VertexArray; + GLuint m_VertexBuffer; + + GLKMatrix4 m_ProjectionMatrix; + GLKMatrix4 m_ModelViewProjectionMatrix; + GLKMatrix3 m_NormalMatrix; + GLKMatrix4 m_WorldModelViewMatrix; + + GLKVector3 m_LightPosition; + GLKVector3 m_EyePosition; + + GLKTextureInfo *m_EarthDayTexture; + GLKTextureInfo *m_EarthNightTexture; + GLKTextureInfo *m_EarthCloudTexture; + + Planet *m_Sphere; + Atmosphere *m_Atmo; +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +- (void)setupGL; +- (void)tearDownGL; + +- (BOOL)loadShaders:(GLuint *)program shaderName:(NSString *)shaderName; +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file; +- (BOOL)linkProgram:(GLuint)prog; +- (BOOL)validateProgram:(GLuint)prog; +- (GLKTextureInfo *)loadTexture:(NSString *)fileName; +- (void)useProgram:(GLuint)program; + +@end + +@implementation EarthAtNightViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (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.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [self setupGL]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + + [self tearDownGL]; + + if ([EAGLContext currentContext] == self.context) + { + [EAGLContext setCurrentContext:nil]; + } + self.context = nil; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Release any cached data, images, etc. that aren't in use. +} + +-(GLKTextureInfo *)loadTexture:(NSString *)fileName +{ + GLKTextureInfo *ti; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:fileName ofType:NULL]; + + ti=[GLKTextureLoader textureWithContentsOfFile:path options:options error:NULL]; + + return ti; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) + { + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); + } + else + { + return YES; + } +} + +- (void)setupGL +{ + int planetSize=100; + + [EAGLContext setCurrentContext:self.context]; + + //shows the light side of the earth, then fades to transparency on the dark side + //so the earth-at-night part can show through, (the "solid" shaders do that, + //as in the night side doesn't fade from transparent to solid, it just is always + //solid to ensure that nothing can show trhought he earth. + + [self loadShaders:&m_NightsideProgram shaderName:@"nightside"]; + [self loadShaders:&m_DaysideProgram shaderName:@"dayside"]; + + float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height); + m_ProjectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f); + + glEnable(GL_DEPTH_TEST); + + m_EyePosition=GLKVector3Make(0.0,0.0,65.0); + + m_WorldModelViewMatrix=GLKMatrix4MakeTranslation(-m_EyePosition.x,-m_EyePosition.y,-m_EyePosition.z); //sets the eyepoint + + m_Sphere=[[Planet alloc] init:planetSize slices:planetSize radius:10.0f squash:1.0f textureFile:NULL]; + [m_Sphere setPositionX:0.0 Y:0.0 Z:0.0]; + + m_EarthDayTexture=[self loadTexture:@"earth_light.png"]; + m_EarthNightTexture=[self loadTexture:@"earth_night.png"]; + m_EarthCloudTexture=[self loadTexture:@"clouds_1024.png"]; + + //bind the clouds to texture unit 1 + + glUseProgram(m_DaysideProgram); + glUniform1i(uniforms[UNIFORM_SAMPLER0],0); + glUniform1i(uniforms[UNIFORM_SAMPLER1],1); + + glUseProgram(m_NightsideProgram); + glUniform1i(uniforms[UNIFORM_SAMPLER0],0); + glUniform1i(uniforms[UNIFORM_SAMPLER1],1); + + m_LightPosition=GLKVector3Make(0.0, 0.0,100.0); +} + +- (void)tearDownGL +{ + [EAGLContext setCurrentContext:self.context]; + + glDeleteBuffers(1, &m_VertexBuffer); + glDeleteVertexArraysOES(1, &m_VertexArray); + + self.effect = nil; + + if (m_DaysideProgram) + { + glDeleteProgram(m_DaysideProgram); + m_DaysideProgram = 0; + } + + if (m_NightsideProgram) + { + glDeleteProgram(m_NightsideProgram); + m_NightsideProgram = 0; + } +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)update +{ + GLfloat scale=2.0; + + GLKMatrix4 baseModelViewMatrix = GLKMatrix4Identity; + GLKMatrix4 modelViewMatrix = GLKMatrix4Identity; + + baseModelViewMatrix = GLKMatrix4Scale(baseModelViewMatrix,scale,scale,scale); + + modelViewMatrix = GLKMatrix4Rotate(baseModelViewMatrix, m_Rotation, 0.0f, 1.0f, 0.0f); + modelViewMatrix = GLKMatrix4Multiply(m_WorldModelViewMatrix, modelViewMatrix); + + m_ModelViewProjectionMatrix=GLKMatrix4Multiply(m_ProjectionMatrix, modelViewMatrix); + + m_NormalMatrix = GLKMatrix3InvertAndTranspose(GLKMatrix4GetMatrix3(modelViewMatrix), NULL); + + m_Rotation+=GLKMathDegreesToRadians(1.0); +} + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + GLfloat gray=0.0; + static int frame=0; + + glClearColor(gray,gray,gray, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + //nightside + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,m_EarthNightTexture.name); + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,m_EarthCloudTexture.name); + + [self useProgram:m_NightsideProgram]; + + [m_Sphere setBlendMode:PLANET_BLEND_MODE_SOLID]; + [m_Sphere execute:m_EarthNightTexture.name]; + + //dayside + + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,m_EarthDayTexture.name); + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,m_EarthCloudTexture.name); + + [self useProgram:m_DaysideProgram]; + + [m_Sphere setBlendMode:PLANET_BLEND_MODE_FADE]; + [m_Sphere execute:m_EarthDayTexture.name]; + + //atmosphere + + glCullFace(GL_FRONT); + glEnable(GL_CULL_FACE); + glFrontFace(GL_CW); + + frame++; +} + +-(void)useProgram:(GLuint)program +{ + glUseProgram(program); + + //updates the uniform values + + glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX], 1, 0, m_ModelViewProjectionMatrix.m); + glUniformMatrix3fv(uniforms[UNIFORM_NORMAL_MATRIX], 1, 0, m_NormalMatrix.m); + + //now rotate the light as well, but not as much as the earth, so we can still see + //different parts at night. I need to rotate it here just to ensure it is properly + //synched with the proper programs + + GLKMatrix4 lightMatrix=GLKMatrix4Identity; + + lightMatrix = GLKMatrix4Rotate(lightMatrix, m_Rotation*.6, 0.0f, 1.0f, 0.0f); + + lightMatrix = GLKMatrix4Rotate(lightMatrix, m_Rotation, 0.0f, 1.0f, 0.0f); + +//lightMatrix=GLKMatrix4Identity; + + lightMatrix = GLKMatrix4Multiply(m_WorldModelViewMatrix, lightMatrix); + + GLKVector3 lightPosition=GLKMatrix4MultiplyVector3(lightMatrix,m_LightPosition); + + glUniform3fv(uniforms[UNIFORM_LIGHT_POSITION],1,lightPosition.v); + glUniform3fv(uniforms[UNIFORM_EYE_POSITION], 1, m_EyePosition.v); +} + +#pragma mark - OpenGL ES 2 shader compilation + +- (BOOL)loadShaders:(GLuint *)program shaderName:(NSString *)shaderName +{ + GLint temp; + GLuint vertShader, fragShader; + NSString *vertShaderPathname, *fragShaderPathname; + + // Create shader program. + + *program = glCreateProgram(); + + // Create and compile fragment shader. + + fragShaderPathname = [[NSBundle mainBundle] pathForResource:shaderName ofType:@"fsh"]; + if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER file:fragShaderPathname]) + { + NSLog(@"Failed to compile fragment shader"); + return NO; + } + + // Create and compile vertex shader. + + vertShaderPathname = [[NSBundle mainBundle] pathForResource:shaderName ofType:@"vsh"]; + if (![self compileShader:&vertShader type:GL_VERTEX_SHADER file:vertShaderPathname]) + { + NSLog(@"Failed to compile vertex shader"); + return NO; + } + + + + // Attach vertex shader to program. + glAttachShader(*program, vertShader); + + // Attach fragment shader to program. + glAttachShader(*program, fragShader); + + // Bind attribute locations. + // This needs to be done prior to linking. + glBindAttribLocation(*program, ATTRIB_VERTEX, "position"); + glBindAttribLocation(*program, ATTRIB_NORMAL, "normal"); + glBindAttribLocation(*program, GLKVertexAttribTexCoord0, "texCoord"); + + // Link program. + + if (![self linkProgram:*program]) + { + NSLog(@"Failed to link program: %d", *program); + + if (vertShader) { + glDeleteShader(vertShader); + vertShader = 0; + } + if (fragShader) { + glDeleteShader(fragShader); + fragShader = 0; + } + if (*program) { + glDeleteProgram(*program); + *program = 0; + } + + return NO; + } + + // Get uniform locations. + + uniforms[UNIFORM_LIGHT_POSITION] = glGetUniformLocation(*program, "lightPosition"); + uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX] = glGetUniformLocation(*program, "modelViewProjectionMatrix"); + uniforms[UNIFORM_NORMAL_MATRIX] = glGetUniformLocation(*program, "normalMatrix"); + uniforms[UNIFORM_EYE_POSITION] = glGetUniformLocation(*program, "eyePosition"); + uniforms[UNIFORM_SAMPLER1] = glGetUniformLocation(*program, "cloud_texture"); + uniforms[UNIFORM_SAMPLER0] = glGetUniformLocation(*program, "s_texture"); + + temp=uniforms[UNIFORM_LIGHT_POSITION]; + temp=uniforms[UNIFORM_SAMPLER1]; + temp=uniforms[UNIFORM_SAMPLER0] ; + + // Release vertex and fragment shaders. + if (vertShader) { + glDetachShader(*program, vertShader); + glDeleteShader(vertShader); + } + if (fragShader) { + glDetachShader(*program, fragShader); + glDeleteShader(fragShader); + } + + return YES; +} +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file +{ + GLint status; + const GLchar *source; + + source = (GLchar *)[[NSString stringWithContentsOfFile:file encoding:NSUTF8StringEncoding error:nil] UTF8String]; + + if (!source) + { + NSLog(@"Failed to load vertex shader"); + return NO; + } + + *shader = glCreateShader(type); + glShaderSource(*shader, 1, &source, NULL); + glCompileShader(*shader); + +#if defined(DEBUG) + GLint logLength; + glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetShaderInfoLog(*shader, logLength, &logLength, log); + NSLog(@"Shader compile log:\n%s", log); + free(log); + } +#endif + + glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); + if (status == 0) { + glDeleteShader(*shader); + return NO; + } + + return YES; +} + +- (BOOL)linkProgram:(GLuint)prog +{ + GLint status; + glLinkProgram(prog); + +#if defined(DEBUG) + GLint logLength; + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program link log:\n%s", log); + free(log); + } +#endif + + glGetProgramiv(prog, GL_LINK_STATUS, &status); + if (status == 0) { + return NO; + } + + return YES; +} + +- (BOOL)validateProgram:(GLuint)prog +{ + GLint logLength, status; + + glValidateProgram(prog); + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program validate log:\n%s", log); + free(log); + } + + glGetProgramiv(prog, GL_VALIDATE_STATUS, &status); + if (status == 0) { + return NO; + } + + return YES; +} + +@end diff --git a/Chapter 10/EarthAtNight/AtmoShader/OpenglIOS.h b/Chapter 10/EarthAtNight/AtmoShader/OpenglIOS.h new file mode 100644 index 0000000..fbf819e --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/OpenglIOS.h @@ -0,0 +1,19 @@ +// +// OpenglIOS.h +// General header for the exercises from Apress IOS/GLKIT Book +// +// Created by mike on 9/1/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef Bouncy_Planet_OpenglIOS_h +#define Bouncy_Planet_OpenglIOS_h + +#define BUFFER_OFFSET(i) ((char *)NULL + (i)) + +#define NUM_XYZ_ELS 3 +#define NUM_NXYZ_ELS 3 +#define NUM_RGBA_ELS 4 +#define NUM_ST_ELS 2 //2D texture coords + +#endif diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/.DS_Store b/Chapter 10/EarthAtNight/AtmoShader/Shaders/.DS_Store new file mode 100644 index 0000000..d40bda5 Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/Shaders/.DS_Store differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/SkyFromAtmosphereFrag.glsl b/Chapter 10/EarthAtNight/AtmoShader/Shaders/SkyFromAtmosphereFrag.glsl new file mode 100644 index 0000000..5bb8ac6 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/SkyFromAtmosphereFrag.glsl @@ -0,0 +1,24 @@ +// +// Atmospheric scattering fragment shader +// +// Author: Sean O'Neil +// +// Copyright (c) 2004 Sean O'Neil +// + +uniform vec3 v3LightPos; +uniform float g; +uniform float g2; + +varying vec3 v3Direction; + + +void main (void) +{ + float fCos = dot(v3LightPos, v3Direction) / length(v3Direction); + float fRayleighPhase = 0.75 * (1.0 + fCos*fCos); + float fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos*fCos) / pow(1.0 + g2 - 2.0*g*fCos, 1.5); + gl_FragColor = fRayleighPhase * gl_Color + fMiePhase * gl_SecondaryColor; + //gl_FragColor.a = gl_FragColor.b; +} + diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/SkyFromAtmosphereVert.glsl b/Chapter 10/EarthAtNight/AtmoShader/Shaders/SkyFromAtmosphereVert.glsl new file mode 100644 index 0000000..8e0c687 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/SkyFromAtmosphereVert.glsl @@ -0,0 +1,79 @@ +// +// Atmospheric scattering vertex shader +// +// Author: Sean O'Neil +// +// Copyright (c) 2004 Sean O'Neil +// + +uniform vec3 v3CameraPos; // The camera's current position +uniform vec3 v3LightPos; // The direction vector to the light source +uniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels +uniform float fCameraHeight; // The camera's current height +uniform float fCameraHeight2; // fCameraHeight^2 +uniform float fOuterRadius; // The outer (atmosphere) radius +uniform float fOuterRadius2; // fOuterRadius^2 +uniform float fInnerRadius; // The inner (planetary) radius +uniform float fInnerRadius2; // fInnerRadius^2 +uniform float fKrESun; // Kr * ESun +uniform float fKmESun; // Km * ESun +uniform float fKr4PI; // Kr * 4 * PI +uniform float fKm4PI; // Km * 4 * PI +uniform float fScale; // 1 / (fOuterRadius - fInnerRadius) +uniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere's average density is found) +uniform float fScaleOverScaleDepth; // fScale / fScaleDepth + +uniform int nSamples; +uniform float fSamples; + +varying vec3 v3Direction; + + +float scale(float fCos) +{ + float x = 1.0 - fCos; + return fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25)))); +} + +void main(void) +{ + // Get the ray from the camera to the vertex, and its length (which is the far point of the ray passing through the atmosphere) + vec3 v3Pos = gl_Vertex.xyz; + vec3 v3Ray = v3Pos - v3CameraPos; + float fFar = length(v3Ray); + v3Ray /= fFar; + + // Calculate the ray's starting position, then calculate its scattering offset + vec3 v3Start = v3CameraPos; + float fHeight = length(v3Start); + float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight)); + float fStartAngle = dot(v3Ray, v3Start) / fHeight; + float fStartOffset = fDepth*scale(fStartAngle); + + // Initialize the scattering loop variables + //gl_FrontColor = vec4(0.0, 0.0, 0.0, 0.0); + float fSampleLength = fFar / fSamples; + float fScaledLength = fSampleLength * fScale; + vec3 v3SampleRay = v3Ray * fSampleLength; + vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5; + + // Now loop through the sample rays + vec3 v3FrontColor = vec3(0.0, 0.0, 0.0); + for(int i=0; i1.0) + halfBlue=1.0; + + if((surfaceColor[0]1.15) + + if(0) + { + cloudColor[3]=1.0; + gl_FragColor=(cloudColor*1.3+surfaceColor*.3+finalSpecular)*colorVarying; + } + else + gl_FragColor = surfaceColor*colorVarying+finalSpecular*colorVarying; + + + gl_FragColor = finalSpecular*colorVarying; + +} \ No newline at end of file diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside copy.vsh b/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside copy.vsh new file mode 100644 index 0000000..eaed0bd --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside copy.vsh @@ -0,0 +1,54 @@ +// +// dayside.vsh +// AtmoShader +// +// used for the daylight side of the earth. The alpha of this fades to 0 +// at the terminator so the night's texture can show through +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +attribute vec4 position; +attribute vec3 normal; +attribute vec2 texCoord; + +varying vec2 v_texCoord; + +varying lowp vec4 colorVarying; +varying lowp vec4 specularColorVarying; + +uniform mat4 modelViewProjectionMatrix; +uniform mat3 normalMatrix; +uniform vec3 lightPosition; +uniform vec3 eyePosition; + +void main() +{ + vec3 normalDirection = normalize(normalMatrix * normal); + vec3 lightDirection; + vec3 eyeNormal = normalize(eyePosition); + + float specular=0.0; + + v_texCoord=texCoord; + + vec4 diffuseColor = vec4(1.0, 1.0, 1.0, 1.0); + + lightDirection=normalize(lightPosition); + + float nDotVP = max(0.0, dot(eyeNormal,lightDirection)); + + float nDotVPReflection = dot(reflect(-lightDirection,normalDirection),eyeNormal); + + specular = pow(max(0.0,nDotVPReflection),100.0)*.75; + specularColorVarying=vec4(specular,specular,specular,0.0); + + + //colorVarying = diffuseColor * nDotVP + specular; + + + colorVarying = diffuseColor * nDotVP; + + gl_Position = modelViewProjectionMatrix * position; +} diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside.fsh b/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside.fsh new file mode 100644 index 0000000..227b7dd --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside.fsh @@ -0,0 +1,56 @@ +// +// dayside.fsh +// AtmoShader +// +// used for the daylight side of the earth. The alpha of this fades to 0 +// at the terminator so the night's texture can show through +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +precision mediump float; + +varying lowp vec4 colorVarying; +varying lowp vec4 specularColorVarying; + + +uniform mat4 modelViewProjectionMatrix; +uniform mat3 normalMatrix; +uniform vec3 lightPosition; + +varying vec2 v_texCoord; +uniform sampler2D s_texture; +uniform sampler2D cloud_texture; + +void main() +{ + vec4 finalSpecular=vec4(0,0,0,1); + vec4 surfaceColor; + vec4 cloudColor; + + float halfBlue; //a value used to detect a mainly blue fragment. + + surfaceColor=texture2D( s_texture, v_texCoord ); + cloudColor=texture2D(cloud_texture, v_texCoord ); + + //if the fragment is mainly blue, that is if red and green are less than + //half of the blue component, then this is the ocean so it is shiny enough + //to have a specular reflection. + + halfBlue=0.5*surfaceColor[2]; + + if(halfBlue>1.0) + halfBlue=1.0; + + if((surfaceColor[0]0.20) + { + cloudColor[3]=1.0; + gl_FragColor=(cloudColor*1.3+surfaceColor*.4)*colorVarying; + } + else + gl_FragColor=(surfaceColor+finalSpecular)*colorVarying; +} \ No newline at end of file diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside.vsh b/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside.vsh new file mode 100644 index 0000000..2598a5c --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/dayside.vsh @@ -0,0 +1,54 @@ +// +// dayside.vsh +// AtmoShader +// +// used for the daylight side of the earth. The alpha of this fades to 0 +// at the terminator so the night's texture can show through +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +attribute vec4 position; +attribute vec3 normal; +attribute vec2 texCoord; + +varying vec2 v_texCoord; + +varying lowp vec4 colorVarying; +varying lowp vec4 specularColorVarying; + +uniform mat4 modelViewProjectionMatrix; +uniform mat3 normalMatrix; +uniform vec3 lightPosition; +uniform vec3 eyePosition; + +void main() +{ + float shininess=25.0; + float balance=.75; + + vec3 normalDirection = normalize(normalMatrix * normal); + vec3 eyeNormal = normalize(eyePosition); + vec3 lightDirection; + + float specular=0.0; + + v_texCoord=texCoord; + + vec4 diffuseColor = vec4(1.0, 1.0, 1.0, 1.0); + + lightDirection=normalize(lightPosition); + + float nDotVP = max(0.0, dot(normalDirection,lightDirection)); + + float nDotVPReflection = dot(reflect(-lightDirection,normalDirection),eyeNormal); + + specular = pow(max(0.0,nDotVPReflection),shininess)*balance; + specularColorVarying=vec4(specular,specular,specular,0.0); + + colorVarying = diffuseColor * nDotVP*1.3; + + gl_Position = modelViewProjectionMatrix * position; +} + diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/nightside.fsh b/Chapter 10/EarthAtNight/AtmoShader/Shaders/nightside.fsh new file mode 100644 index 0000000..c6838e9 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/nightside.fsh @@ -0,0 +1,35 @@ +// +// nightside.fsh +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +varying lowp vec4 colorVarying; + + +precision mediump float; +varying vec2 v_texCoord; +uniform sampler2D s_texture; +uniform sampler2D cloud_texture; + +void main() +{ + vec4 newColor; + vec4 cloudColor; + vec4 surfaceColor; + float cloudNightBrightness=.1; //just a small boost to ensure the clouds to actually show at night + + newColor=1.0-colorVarying; + + cloudColor=texture2D(cloud_texture, v_texCoord ); + surfaceColor=texture2D( s_texture, v_texCoord ); + + if(cloudColor[0]>0.4) + { + cloudColor[3]=1.0; + gl_FragColor=cloudNightBrightness*cloudColor+0.6*surfaceColor*newColor; + } + else + gl_FragColor = surfaceColor*newColor; +} \ No newline at end of file diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/nightside.vsh b/Chapter 10/EarthAtNight/AtmoShader/Shaders/nightside.vsh new file mode 100644 index 0000000..c8c7e24 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/nightside.vsh @@ -0,0 +1,32 @@ +// +// nightside.vsh +// AtmoShader +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +attribute vec4 position; +attribute vec3 normal; +attribute vec2 texCoord; + +varying vec2 v_texCoord; + +varying lowp vec4 colorVarying; + +uniform mat4 modelViewProjectionMatrix; +uniform mat3 normalMatrix; +uniform vec3 lightPosition; + +void main() +{ + v_texCoord=texCoord; + + vec3 eyeNormal = normalize(normalMatrix * normal); + vec4 diffuseColor = vec4(1.0, 1.0, 1.0, 1.0); + + float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition))); + + colorVarying = diffuseColor * nDotVP; + + gl_Position = modelViewProjectionMatrix * position; +} diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/specular.fsh b/Chapter 10/EarthAtNight/AtmoShader/Shaders/specular.fsh new file mode 100644 index 0000000..5b90bb6 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/specular.fsh @@ -0,0 +1,23 @@ +// +// Shader.fsh +// AtmoShader +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +varying lowp vec4 colorVarying; + + +precision mediump float; +varying vec2 v_texCoord; +uniform sampler2D s_texture; + +void main() +{ + vec4 newColor; + + newColor=1.0-colorVarying; + + gl_FragColor = texture2D( s_texture, v_texCoord )*newColor; +} \ No newline at end of file diff --git a/Chapter 10/EarthAtNight/AtmoShader/Shaders/specular.vsh b/Chapter 10/EarthAtNight/AtmoShader/Shaders/specular.vsh new file mode 100644 index 0000000..374ff7e --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/Shaders/specular.vsh @@ -0,0 +1,33 @@ +// +// Shader.vsh +// AtmoShader +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +attribute vec4 position; +attribute vec3 normal; +attribute vec2 texCoord; + +varying vec2 v_texCoord; + +varying lowp vec4 colorVarying; + +uniform mat4 modelViewProjectionMatrix; +uniform mat3 normalMatrix; +uniform vec3 lightPosition; + +void main() +{ + v_texCoord=texCoord; + + vec3 eyeNormal = normalize(normalMatrix * normal); + vec4 diffuseColor = vec4(1.0, 1.0, 1.0, 1.0); + + float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition))); + + colorVarying = pow(max(0.0,nDotVP)*5.0; + + gl_Position = modelViewProjectionMatrix * position; +} diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/.DS_Store b/Chapter 10/EarthAtNight/AtmoShader/assets/.DS_Store new file mode 100644 index 0000000..99e09c8 Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/assets/.DS_Store differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/clouds_1024.png b/Chapter 10/EarthAtNight/AtmoShader/assets/clouds_1024.png new file mode 100644 index 0000000..874eb13 Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/assets/clouds_1024.png differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/earth_atmo.plist b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_atmo.plist new file mode 100644 index 0000000..888ffc7 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_atmo.plist @@ -0,0 +1,34 @@ + + + + + samples + 2 + g + -0.95 + innerRadius + 10.0 + outerRadius + 12 + rayleigh + 0.0025 + mie + 0.0015 + sunBrightness + 500.0 + miePhaseAsymmetry + -0.95 + waveLengthRed + 0.650 + waveLengthGreen + 0.570 + waveLengthBlue + 0.475 + scaleDepth + 0.25 + mieScaleDepth + 0.1 + exposure + 2.0f + + diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/earth_atmo_2.plist b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_atmo_2.plist new file mode 100644 index 0000000..1a74e4e --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_atmo_2.plist @@ -0,0 +1,34 @@ + + + + + samples + 3 + g + -0.95 + innerRadius + 10 + outerRadius + 13 + rayleigh + 0.0025 + mie + 0.0010 + sunBrightness + 150.0 + miePhaseAsymmetry + -0.95 + waveLengthRed + 0.650 + waveLengthGreen + 0.570 + waveLengthBlue + 0.475 + scaleDepth + 0.25 + mieScaleDepth + 0.1 + exposure + 2.0f + + diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/earth_light.png b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_light.png new file mode 100644 index 0000000..a46417e Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_light.png differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/earth_night.png b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_night.png new file mode 100644 index 0000000..75accfa Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/assets/earth_night.png differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/hedly.png b/Chapter 10/EarthAtNight/AtmoShader/assets/hedly.png new file mode 100644 index 0000000..587adf6 Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/assets/hedly.png differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/assets/obsolete/earth_light.png b/Chapter 10/EarthAtNight/AtmoShader/assets/obsolete/earth_light.png new file mode 100644 index 0000000..a425787 Binary files /dev/null and b/Chapter 10/EarthAtNight/AtmoShader/assets/obsolete/earth_light.png differ diff --git a/Chapter 10/EarthAtNight/AtmoShader/atmosphere.h b/Chapter 10/EarthAtNight/AtmoShader/atmosphere.h new file mode 100644 index 0000000..45ec29e --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/atmosphere.h @@ -0,0 +1,99 @@ +// +// Atmosphere.h +// AtmoShader +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + + +#import "planet.h" + +#define PI 3.14159 + + +// Uniform index. +enum +{ + ATMO_UNIFORM_MODELVIEWPROJECTION_MATRIX, + ATMO_UNIFORM_NORMAL_MATRIX, + ATMO_UNIFORM_LIGHT_POSITION, + ATMO_CAMERA_POS, + ATMO_INV_WAVELENGTH, + ATMO_CAMERA_HEIGHT, + ATMO_CAMERA_HEIGHT2, + ATMO_OUTER_RADIUS, + ATMO_OUTER_RADIUS2, + ATMO_INNER_RADIUS, + ATMO_INNER_RADIUS2, + ATMO_KR_E_SUN, + ATMO_KM_E_SUN, + ATMO_KR4_SUN_PI, + ATMO_KM4_SUN_PI, + ATMO_SCALE, + ATMO_SCALE_DEPTH, + ATMO_SCALE_OVER_SCALE_DEPTH, + ATMO_NSAMPLES, + ATMO_FSAMPLES, + ATMO_G, + ATMO_G2, + ATMO_NUM_UNIFORMS +}; + + +// Attribute index. +enum +{ + ATMO_ATTRIB_VERTEX, + ATMO_ATTRIB_NORMAL, + ATMO_NUM_ATTRIBUTES +}; + +@interface Atmosphere : Planet +{ + int m_PolygonMode; + BOOL m_bHDR; + + GLKVector3 m_Light; + GLKVector3 m_LightDirection; + + // Variables that can be tweaked with keypresses + BOOL m_ShowTexture; + float m_ScaleOverScaleDepth; + int m_nSamples; + float m_fSamples; + float m_CameraHeight; + float m_CameraHeight2; + float m_KrESun, m_Kr4PI; + float m_KmESun, m_Km4PI; + float m_ESun; + float m_g; + float m_g2; + float m_RadiusScale; //actually just the "scale" but m_Scale was already taken + float m_InnerRadius; + float m_InnerRadius2; + float m_OuterRadius; + float m_OuterRadius2; + GLKVector3 m_Wavelength; + GLKVector3 m_WavelengthInv; + float m_ScaleDepth; //aka, the Rayleigh Scale Depth + float m_MieScaleDepth; + float m_Exposure; + GLuint m_ShaderProgram; + + NSMutableDictionary *m_Configuration; + + GLint m_AtmoUniforms[ATMO_NUM_UNIFORMS]; +} + +-(id)init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash textureFile:(NSString *)textureFile configFile:(NSString *)configFile; +-(BOOL)loadShaders:(NSString *)shaderName; +-(BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file; +-(BOOL)linkProgram:(GLuint)prog; +-(BOOL)validateProgram:(GLuint)prog; +-(void)useProgram:(GLKMatrix4)mvpMatrix lightPosition:(GLKVector3)lightPosition cameraPosition:(GLKVector3)cameraPosition; +-(void)initData:(NSString *)configFile; +-(float)scalex:(float)fCos; +-(void)testShaderAlgorithm:(GLKVector3)lightPosition cameraPosition:(GLKVector3)v3CameraPos; + +@end diff --git a/Chapter 10/EarthAtNight/AtmoShader/atmosphere.m b/Chapter 10/EarthAtNight/AtmoShader/atmosphere.m new file mode 100644 index 0000000..1ccf8ac --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/atmosphere.m @@ -0,0 +1,476 @@ +// +// Atmosphere.m +// AtmoShader +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "Atmosphere.h" + +@implementation Atmosphere + +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius + squash:(GLfloat) squash textureFile:(NSString *)textureFile configFile:(NSString *)configFile +{ + if(self=[super init:stacks slices:slices radius:radius squash:squash textureFile:textureFile]) + { + + [self initData:configFile]; + } + + return self; +} + + +-(void)initData:(NSString *)configFile +{ + NSString *thePath = [[NSBundle mainBundle] pathForResource:configFile ofType:NULL]; + + m_Configuration=[[NSMutableDictionary alloc] initWithContentsOfFile:thePath]; + + m_nSamples=[[m_Configuration objectForKey:@"samples"]intValue]; + m_fSamples=(float)m_nSamples; + m_OuterRadius=[[m_Configuration objectForKey:@"outerRadius"]floatValue]; + m_OuterRadius2=m_OuterRadius*m_OuterRadius; + m_InnerRadius=[[m_Configuration objectForKey:@"innerRadius"]floatValue]; + m_InnerRadius2=m_InnerRadius*m_InnerRadius; + + m_RadiusScale=1.0/(m_OuterRadius-m_InnerRadius); + + m_ScaleDepth=[[m_Configuration objectForKey:@"scaleDepth"]floatValue]; + m_ScaleOverScaleDepth=m_RadiusScale/m_ScaleDepth; + + m_ESun=[[m_Configuration objectForKey:@"sunBrightness"]floatValue]; + + m_KrESun=[[m_Configuration objectForKey:@"rayleigh"]floatValue]*m_ESun; + m_Kr4PI=4.0*m_KrESun*PI; + + m_KmESun=[[m_Configuration objectForKey:@"mie"]floatValue]*m_ESun; + m_Km4PI=4.0*m_KmESun*PI; + + m_g=[[m_Configuration objectForKey:@"miePhaseAsymmetry"]floatValue]; + + + m_InnerRadius=[[m_Configuration objectForKey:@"innerRadius"]floatValue]; + m_OuterRadius=[[m_Configuration objectForKey:@"outerRadius"]floatValue]; + + m_Wavelength.r=[[m_Configuration objectForKey:@"waveLengthRed"]floatValue]; + m_Wavelength.g=[[m_Configuration objectForKey:@"waveLengthGreen"]floatValue]; + m_Wavelength.b=[[m_Configuration objectForKey:@"waveLengthBlue"]floatValue]; + + m_WavelengthInv.r=1.0/powf(m_Wavelength.r,4.0f); + m_WavelengthInv.g=1.0/powf(m_Wavelength.g,4.0f); + m_WavelengthInv.b=1.0/powf(m_Wavelength.b,4.0f); + + m_MieScaleDepth=[[m_Configuration objectForKey:@"mieScaleDepth"]floatValue]; + + m_Exposure=[[m_Configuration objectForKey:@"exposure"]floatValue]; + + m_g=[[m_Configuration objectForKey:@"g"]floatValue]; + m_g2=m_g*m_g; + // m_CameraHeight=15.0; + m_CameraHeight2=m_CameraHeight*m_CameraHeight; + +} + +- (BOOL)loadShaders:(NSString *)shaderName +{ + GLuint vertShader, fragShader; + NSString *vertShaderPathname, *fragShaderPathname; + + // Create shader program. + + m_ShaderProgram = glCreateProgram(); + + // Create and compile vertex shader. + + vertShaderPathname = [[NSBundle mainBundle] pathForResource:shaderName ofType:@"vsh"]; + if (![self compileShader:&vertShader type:GL_VERTEX_SHADER file:vertShaderPathname]) + { + NSLog(@"Failed to compile vertex shader"); + return NO; + } + + // Create and compile fragment shader. + + fragShaderPathname = [[NSBundle mainBundle] pathForResource:shaderName ofType:@"fsh"]; + if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER file:fragShaderPathname]) + { + NSLog(@"Failed to compile fragment shader"); + return NO; + } + + // Attach vertex shader to program. + glAttachShader(m_ShaderProgram, vertShader); + + // Attach fragment shader to program. + glAttachShader(m_ShaderProgram, fragShader); + + // Bind attribute locations. + // This needs to be done prior to linking. + glBindAttribLocation(m_ShaderProgram, ATMO_ATTRIB_VERTEX, "position"); + // glBindAttribLocation(m_ShaderProgram, ATMO_ATTRIB_NORMAL, "normal"); + + // Link program. + + if (![self linkProgram:m_ShaderProgram]) + { + NSLog(@"Failed to link program: %d", m_ShaderProgram); + + if (vertShader) { + glDeleteShader(vertShader); + vertShader = 0; + } + if (fragShader) { + glDeleteShader(fragShader); + fragShader = 0; + } + if (m_ShaderProgram) { + glDeleteProgram(m_ShaderProgram); + m_ShaderProgram = 0; + } + + return NO; + } + + // Get uniform locations. + + //lifted, er, borrowed from http://sponeil.net/ + + + m_AtmoUniforms[ATMO_UNIFORM_LIGHT_POSITION] = glGetUniformLocation(m_ShaderProgram, "lightPosition"); + m_AtmoUniforms[ATMO_UNIFORM_MODELVIEWPROJECTION_MATRIX] = glGetUniformLocation(m_ShaderProgram, "modelViewProjectionMatrix"); + m_AtmoUniforms[ATMO_CAMERA_POS] = glGetUniformLocation(m_ShaderProgram, "v3CameraPos"); + m_AtmoUniforms[ATMO_INV_WAVELENGTH] = glGetUniformLocation(m_ShaderProgram, "v3InvWavelength"); + // m_AtmoUniforms[ATMO_CAMERA_HEIGHT] = glGetUniformLocation(m_ShaderProgram, "fCameraHeight"); + m_AtmoUniforms[ATMO_CAMERA_HEIGHT2] = glGetUniformLocation(m_ShaderProgram, "fCameraHeight2"); + m_AtmoUniforms[ATMO_OUTER_RADIUS] = glGetUniformLocation(m_ShaderProgram, "fOuterRadius"); + m_AtmoUniforms[ATMO_OUTER_RADIUS2] = glGetUniformLocation(m_ShaderProgram, "fOuterRadius2"); + m_AtmoUniforms[ATMO_INNER_RADIUS] = glGetUniformLocation(m_ShaderProgram, "fInnerRadius"); + // m_AtmoUniforms[ATMO_INNER_RADIUS2] = glGetUniformLocation(m_ShaderProgram, "fInnerRadius2"); + m_AtmoUniforms[ATMO_KR_E_SUN] = glGetUniformLocation(m_ShaderProgram, "fKrESun"); + m_AtmoUniforms[ATMO_KM_E_SUN] = glGetUniformLocation(m_ShaderProgram, "fKmESun"); + m_AtmoUniforms[ATMO_SCALE] = glGetUniformLocation(m_ShaderProgram, "fScale"); + m_AtmoUniforms[ATMO_KR4_SUN_PI] = glGetUniformLocation(m_ShaderProgram, "fKr4PI"); + m_AtmoUniforms[ATMO_KM4_SUN_PI] = glGetUniformLocation(m_ShaderProgram, "fKm4PI"); + m_AtmoUniforms[ATMO_SCALE_DEPTH] = glGetUniformLocation(m_ShaderProgram, "fScaleDepth"); + m_AtmoUniforms[ATMO_SCALE_OVER_SCALE_DEPTH] = glGetUniformLocation(m_ShaderProgram, "fScaleOverScaleDepth"); + m_AtmoUniforms[ATMO_NSAMPLES] = glGetUniformLocation(m_ShaderProgram, "nSamples"); + m_AtmoUniforms[ATMO_FSAMPLES] = glGetUniformLocation(m_ShaderProgram, "fSamples"); + m_AtmoUniforms[ATMO_G] = glGetUniformLocation(m_ShaderProgram, "g"); + m_AtmoUniforms[ATMO_G2] = glGetUniformLocation(m_ShaderProgram, "g2"); + + // Release vertex and fragment shaders. + + if (vertShader) + { + glDetachShader(m_ShaderProgram, vertShader); + glDeleteShader(vertShader); + } + + if (fragShader) + { + glDetachShader(m_ShaderProgram, fragShader); + glDeleteShader(fragShader); + } + + return YES; +} +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file +{ + GLint status; + const GLchar *source; + + source = (GLchar *)[[NSString stringWithContentsOfFile:file + encoding:NSUTF8StringEncoding error:nil] UTF8String]; + + if (!source) + { + NSLog(@"Failed to load vertex shader"); + return NO; + } + + *shader = glCreateShader(type); + glShaderSource(*shader, 1, &source, NULL); + glCompileShader(*shader); + +#if defined(DEBUG) + GLint logLength; + glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetShaderInfoLog(*shader, logLength, &logLength, log); + NSLog(@"Shader compile log:\n%s", log); + free(log); + } +#endif + + glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); + + if (status == 0) + { + glDeleteShader(*shader); + return NO; + } + + return YES; +} + +- (BOOL)linkProgram:(GLuint)prog +{ + GLint status; + glLinkProgram(prog); + +#if defined(DEBUG) + GLint logLength; + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program link log:\n%s", log); + free(log); + } +#endif + + glGetProgramiv(prog, GL_LINK_STATUS, &status); + if (status == 0) { + return NO; + } + + return YES; +} + +- (BOOL)validateProgram:(GLuint)prog +{ + GLint logLength, status; + + glValidateProgram(prog); + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program validate log:\n%s", log); + free(log); + } + + glGetProgramiv(prog, GL_VALIDATE_STATUS, &status); + if (status == 0) { + return NO; + } + + return YES; +} + +-(void)useProgram:(GLKMatrix4)mvpMatrix lightPosition:(GLKVector3)lightPosition cameraPosition:(GLKVector3)cameraPosition +{ + GLenum error; + + m_CameraHeight=GLKVector3Length(cameraPosition); + m_CameraHeight2=m_CameraHeight*m_CameraHeight; + + glUseProgram(m_ShaderProgram); + + glUniformMatrix4fv(m_AtmoUniforms[ATMO_UNIFORM_MODELVIEWPROJECTION_MATRIX], 1, 0, mvpMatrix.m); + + error=glGetError(); + + glUniform3fv(m_AtmoUniforms[ATMO_UNIFORM_LIGHT_POSITION],1,lightPosition.v); + + error=glGetError(); + + glUniform3fv(m_AtmoUniforms[ATMO_CAMERA_POS],1,cameraPosition.v); + + error=glGetError(); + + glUniform3fv(m_AtmoUniforms[ATMO_INV_WAVELENGTH],1,m_WavelengthInv.v); + + error=glGetError(); + + // glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_CAMERA_HEIGHT]],m_CameraHeight); + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_CAMERA_HEIGHT2]],m_CameraHeight2); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_OUTER_RADIUS]],m_OuterRadius); + + error=glGetError(); + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_OUTER_RADIUS2]],m_OuterRadius2); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_INNER_RADIUS]],m_InnerRadius); + + + error=glGetError(); + + // glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_INNER_RADIUS2]],m_InnerRadius2); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_KR_E_SUN]],m_KrESun); + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_KM_E_SUN]],m_KmESun); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_KR4_SUN_PI]],m_Kr4PI); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_KM4_SUN_PI]],m_Km4PI); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_SCALE]],m_RadiusScale); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_SCALE_DEPTH]],m_ScaleDepth); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_SCALE_OVER_SCALE_DEPTH]],m_ScaleOverScaleDepth); + + + error=glGetError(); + + glUniform1i(m_AtmoUniforms[m_AtmoUniforms[ATMO_NSAMPLES]],m_nSamples); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_FSAMPLES]],m_fSamples); + + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_G]],m_g); + + error=glGetError(); + + glUniform1f(m_AtmoUniforms[m_AtmoUniforms[ATMO_G2]],m_g2); + + error=glGetError(); + + [self testShaderAlgorithm:lightPosition cameraPosition:cameraPosition]; + +} + + +-(float)scalex:(float)fCos +{ + if(fCos<0) + fCos*= -1.0; + + float x = 1.0 - fCos; + float temp; + + temp=(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25)))); + + float rvalue=m_ScaleDepth * expf(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25)))); + + return rvalue; +} + +-(void)testShaderAlgorithm:(GLKVector3)lightPosition cameraPosition:(GLKVector3)cameraPosition +{ + int i; + + GLKVector3 v3Pos=GLKVector3Make(0.0, 13.0, 0.0); //a sample vertex + GLKVector3 v3CameraPos=cameraPosition; + GLKVector3 v3Ray=GLKVector3Subtract(v3Pos, v3CameraPos); + + float fFar=GLKVector3Length(v3Ray); + v3Ray=GLKVector3Normalize(v3Ray); + + float B=2.0*GLKVector3DotProduct(v3CameraPos, v3Ray); + float C=m_CameraHeight2-m_OuterRadius2; + float fDet = MAX(0.0, B*B - 4.0 * C); + float fNear = 0.5 * (-B - sqrt(fDet)); + + GLKVector3 v3Temp=GLKVector3MultiplyScalar(v3Ray, fNear); + GLKVector3 v3Start=GLKVector3Add(v3CameraPos, v3Temp); + + fFar-=fNear; + + float fStartAngle=GLKVector3DotProduct(v3Ray,v3Start); + float fStartDepth=expf(-1.0/m_ScaleDepth); + float fStartOffset = fStartDepth*[self scalex:fStartAngle]; + + float fSampleLength = fFar / m_fSamples; + float fScaledLength = fSampleLength * m_RadiusScale; + + GLKVector3 v3SampleRay=GLKVector3MultiplyScalar(v3Ray, fSampleLength); + GLKVector3 v3SamplePoint=GLKVector3Add(v3Start,GLKVector3MultiplyScalar(v3SampleRay, 0.5)); + + v3Temp=GLKVector3MultiplyScalar(v3SampleRay, 0.5); + v3SamplePoint=GLKVector3Add(v3Start,v3Temp); + GLKVector3 v3FrontColor=GLKVector3Make(0.0, 0.0, 0.0); + + for(i=0;i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 10/EarthAtNight/AtmoShader/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 10/EarthAtNight/AtmoShader/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..9d4dc70 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 10/EarthAtNight/AtmoShader/main.m b/Chapter 10/EarthAtNight/AtmoShader/main.m new file mode 100644 index 0000000..c0d8a82 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/main.m @@ -0,0 +1,19 @@ +// +// main.m +// AtmoShader +// +// Created by mike on 9/6/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "EarthAtNightAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool + { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([EarthAtNightAppDelegate class])); + } +} diff --git a/Chapter 10/EarthAtNight/AtmoShader/planet.h b/Chapter 10/EarthAtNight/AtmoShader/planet.h new file mode 100644 index 0000000..e432532 --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/planet.h @@ -0,0 +1,87 @@ + +#import +#import +#import +#import "OpenglIOS.h" + +//#import "mathlib.h" + +//used to generate interleaved data + +/* +struct VBOInterleaved +{ + GLfloat x,y,z; + GLfloat nx,ny,nz; + + GLfloat s,t; +}; +*/ + +#define PLANET_BLEND_MODE_NONE 0 +#define PLANET_BLEND_MODE_SOLID 1 +#define PLANET_BLEND_MODE_FADE 2 +#define PLANET_BLEND_MODE_ATMO 3 + +struct VAOInterleaved +{ + GLfloat xyz[NUM_XYZ_ELS]; + GLfloat nxyz[NUM_NXYZ_ELS]; + GLfloat rgba[NUM_RGBA_ELS]; + GLfloat st[NUM_ST_ELS]; +}; + +@interface Planet : NSObject +{ +@private + GLfloat *m_VertexData; + GLfloat *m_ColorData; + GLfloat *m_NormalData; + + GLKTextureInfo *m_TextureInfo; + + GLsizeiptr m_NumVertices; + + long m_TotalXYZBytes; + long m_TotalNormalBytes; + + bool m_UseTexture; + bool m_UseNormals; + bool m_UseColors; + bool m_UseInterleaved; + + GLfloat *m_TexCoordsData; + + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; + GLfloat m_Angle; + GLKVector3 m_Pos; + GLfloat m_RotationalIncrement; + + GLuint m_VertexArrayName; + GLuint m_VertexBufferName; + + struct VAOInterleaved *m_InterleavedData; +} + +-(bool)execute:(GLuint)textureName; +-(bool)executeAtmo; +-(id)init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash textureFile:(NSString *)textureFile; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z; +-(GLfloat)getRotation; +-(void)setRotation:(GLfloat)angle; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(GLfloat)getRotationalIncrement; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; +-(void)createVAO; +-(void)createInterleavedData; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; +-(void)loadTexture:(NSString *)fileName; +-(void)setBlendMode:(GLuint)blendMode; + +@end + diff --git a/Chapter 10/EarthAtNight/AtmoShader/planet.mm b/Chapter 10/EarthAtNight/AtmoShader/planet.mm new file mode 100644 index 0000000..a7e995a --- /dev/null +++ b/Chapter 10/EarthAtNight/AtmoShader/planet.mm @@ -0,0 +1,406 @@ +// +// planet.m +// +// Created by mike on 5/14/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "planet.h" + +@implementation Planet + +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash textureFile:(NSString *)textureFile //chapter 5 +{ + unsigned int colorIncrment=0; + unsigned int blue=0; + unsigned int red=255; + + m_UseTexture=YES; + m_UseNormals=YES; + m_UseInterleaved=YES; + m_InterleavedData=NULL; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + + //vertices + + GLfloat *vtxPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * NUM_XYZ_ELS * ((m_Slices*2+2) * (m_Stacks))); + + //color data + + GLfloat *colPtr = m_ColorData = + (GLfloat*)malloc(sizeof(GLfloat) * NUM_RGBA_ELS * ((m_Slices*2+2) * (m_Stacks))); + + //normal pointers for lighting + + GLfloat *norPtr = m_NormalData = + (GLfloat*)malloc(sizeof(GLfloat) * NUM_NXYZ_ELS * ((m_Slices*2+2) * (m_Stacks))); //normals + + GLfloat *textPtr=nil; + + textPtr=m_TexCoordsData = (GLfloat *)malloc(sizeof(GLfloat) * NUM_ST_ELS * ((m_Slices*2+2) * (m_Stacks))); //texture coords + + unsigned int phiIdx, thetaIdx; + + //latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) + { + //starts at -1.57 goes up to +1.57 radians + + //the first circle + + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0/(float)(m_Stacks)) - 0.5); + + //the next, or second one. + + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0/(float)(m_Stacks)) - 0.5); + float cosPhi0 = cos(phi0); + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + //longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) + { + //increment along the longitude circle each "slice" + + float theta = -2.0*M_PI * ((float)thetaIdx) * (1.0/(float)(m_Slices-1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + //we're generating a vertical pair of points, such + //as the first point of stack 0 and the first point of stack 1 + //above it. This is how TRIANGLE_STRIPS work, + //taking a set of 4 vertices and essentially drawing two triangles + //at a time. The first is v0-v1-v2 and the next is v2-v1-v3. Etc. + + //get x-y-z for the first vertex of stack + + vtxPtr[0] = m_Scale*cosPhi0 * cosTheta; + vtxPtr[1] = m_Scale*sinPhi0*m_Squash; + vtxPtr[2] = m_Scale*(cosPhi0 * sinTheta); + + //the same but for the vertex immediately above the previous one + + vtxPtr[3] = m_Scale*cosPhi1 * cosTheta; + vtxPtr[4] = m_Scale*sinPhi1*m_Squash; + vtxPtr[5] = m_Scale*(cosPhi1 * sinTheta); + + //normal pointers for lighting + + norPtr[0] = cosPhi0 * cosTheta; + norPtr[2] = cosPhi0 * sinTheta; + norPtr[1] = sinPhi0; //get x-y-z for the first vertex of stack N + norPtr[3] = cosPhi1 * cosTheta; + norPtr[5] = cosPhi1 * sinTheta; + norPtr[4] = sinPhi1; + + + if(textPtr!=nil) + { + GLfloat texX = (float)thetaIdx * (1.0f/(float)(m_Slices-1)); + + textPtr[0] = texX; + textPtr[1] = (float)(phiIdx+0) * (1.0f/(float)(m_Stacks)); + textPtr[2] = texX; + textPtr[3] = (float)(phiIdx+1) * (1.0f/(float)(m_Stacks)); + } + + if(0) + { + //needed to switch back to bytes + + colPtr[0] = red; + colPtr[1] = 0; + colPtr[2] = blue; + colPtr[4] = red; + colPtr[5] = 0; + colPtr[6] = blue; + colPtr[3] = colPtr[7] = 255; + } + else + { + colPtr[0] =(GLfloat)red/255.0f; + colPtr[1] = 0.0f/255.0f; + colPtr[2] = (GLfloat)blue/255.0f; + colPtr[4] = (GLfloat)red/255.0f; + colPtr[5] = 0.0f/255.0; + colPtr[6] =(GLfloat) blue/255.0f; + colPtr[3] = colPtr[7] = 255.0f/255.0f; + } + + colPtr += 2*NUM_RGBA_ELS; + vtxPtr += 2*NUM_XYZ_ELS; + norPtr += 2*NUM_NXYZ_ELS; + + if(textPtr!=nil) + textPtr += 2*NUM_ST_ELS; + } + + blue+=colorIncrment; + red-=colorIncrment; + + // degenerate triangle to connect stacks and maintain winding order + + vtxPtr[0] = vtxPtr[3] = vtxPtr[-3]; vtxPtr[1] = vtxPtr[4] = vtxPtr[-2]; vtxPtr[2] = vtxPtr[5] = vtxPtr[-1]; + norPtr[0] = norPtr[3] = norPtr[-3]; norPtr[1] = norPtr[4] = norPtr[-2]; norPtr[2] = norPtr[5] = norPtr[-1]; + + textPtr[0] = textPtr[2] = textPtr[-2]; textPtr[1] = textPtr[3] = textPtr[-1]; + } + } + + m_NumVertices=((m_Slices*2+2) * (m_Stacks)); + + m_Angle=0.0; + m_RotationalIncrement=0.0; + + m_Pos.x=0.0; + m_Pos.y=0.0; + m_Pos.z=0.0; + + if(textureFile!=NULL) + [self loadTexture:textureFile]; + + [self createVAO]; + + [self setBlendMode:PLANET_BLEND_MODE_SOLID]; + + return self; +} + +-(void)setBlendMode:(GLuint)blendMode +{ + glEnable(GL_BLEND); + + if(blendMode==PLANET_BLEND_MODE_NONE) + glDisable(GL_BLEND); + else if(blendMode==PLANET_BLEND_MODE_FADE) + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + else if(blendMode==PLANET_BLEND_MODE_ATMO) + glBlendFunc(GL_ONE, GL_ONE); + else if(blendMode==PLANET_BLEND_MODE_SOLID) + glDisable(GL_BLEND); +} + +-(void)createInterleavedData +{ + int i; + GLfloat *vtxPtr; + GLfloat *norPtr; + GLfloat *colPtr; + GLfloat *textPtr; + int xyzSize; + int nxyzSize; + int rgbaSize; + int textSize; + + struct VAOInterleaved *startData; + + int structSize=sizeof(struct VAOInterleaved); + long allocSize=structSize*m_NumVertices; + + m_InterleavedData=(struct VAOInterleaved *)malloc(allocSize); + + startData=m_InterleavedData; + + vtxPtr=m_VertexData; + norPtr=m_NormalData; + colPtr=m_ColorData; + textPtr=m_TexCoordsData; + + xyzSize=sizeof(GLfloat)*NUM_XYZ_ELS; + nxyzSize=sizeof(GLfloat)*NUM_NXYZ_ELS; + rgbaSize=sizeof(GLfloat)*NUM_RGBA_ELS; + textSize=sizeof(GLfloat)*NUM_ST_ELS; + + for(i=0;ixyz,vtxPtr,xyzSize); //geometry + memcpy(&startData->nxyz,norPtr,nxyzSize); //normals + memcpy(&startData->rgba,colPtr,rgbaSize); //colors + memcpy(&startData->st,textPtr,textSize); //texture coords + + startData++; + + vtxPtr+=NUM_XYZ_ELS; + norPtr+=NUM_NXYZ_ELS; + colPtr+=NUM_RGBA_ELS; + textPtr+=NUM_ST_ELS; + } +} + +-(void)createVAO +{ + GLuint numBytesPerXYZ,numBytesPerNXYZ,numBytesPerRGBA; + GLuint structSize=sizeof(struct VAOInterleaved); + + [self createInterleavedData]; + + //note that the context is set in the in the parent object + + glGenVertexArraysOES(1, &m_VertexArrayName); + glBindVertexArrayOES(m_VertexArrayName); + + numBytesPerXYZ=sizeof(GL_FLOAT)*NUM_XYZ_ELS; + numBytesPerNXYZ=sizeof(GL_FLOAT)*NUM_NXYZ_ELS; + numBytesPerRGBA=sizeof(GL_FLOAT)*NUM_RGBA_ELS; + + glGenBuffers(1, &m_VertexBufferName); + glBindBuffer(GL_ARRAY_BUFFER, m_VertexBufferName); + glBufferData(GL_ARRAY_BUFFER, sizeof(struct VAOInterleaved)*m_NumVertices, m_InterleavedData, GL_STATIC_DRAW); + + glEnableVertexAttribArray(GLKVertexAttribPosition); + glVertexAttribPointer(GLKVertexAttribPosition, NUM_XYZ_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(0)); + + glEnableVertexAttribArray(GLKVertexAttribNormal); + glVertexAttribPointer(GLKVertexAttribNormal, NUM_NXYZ_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(numBytesPerXYZ)); + + glEnableVertexAttribArray(GLKVertexAttribColor); + glVertexAttribPointer(GLKVertexAttribColor, NUM_RGBA_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(numBytesPerNXYZ+numBytesPerXYZ)); + + glEnableVertexAttribArray(GLKVertexAttribTexCoord0); + glVertexAttribPointer(GLKVertexAttribTexCoord0,NUM_ST_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(numBytesPerNXYZ+numBytesPerXYZ+numBytesPerRGBA)); +} + +-(bool)execute:(GLuint)textureName +{ + int objectType=GL_TRIANGLE_STRIP; //GL_POINTS, GL_LINES, GL_TRIANGLE_STRIP + static int whichFace=GL_CW; + + // if(!(counter%25)) + // NSLog(@"Execute VAOs\n"); + /* + if(textureName>0) + glBindTexture(GL_TEXTURE_2D,textureName); + else + { + if(m_TextureInfo!=NULL) + glBindTexture(GL_TEXTURE_2D,m_TextureInfo.name); + else + { + glDisable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,0); + } + } + */ + glBindVertexArrayOES(m_VertexArrayName); + + //commented out for shader testing + + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + glFrontFace(whichFace); + + // this blend mode, src color/1-src color will cause the dark side + //of the earth to fade out to the background + + // glEnable(GL_BLEND); + // glBlendFunc(GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR); + + + glDisable(GL_DEPTH_TEST); + + glDrawArrays(objectType, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + return true; +} + +-(bool)executeAtmo +{ + int objectType=GL_TRIANGLE_STRIP; //GL_POINTS, GL_LINES, GL_TRIANGLE_STRIP + static int whichFace=GL_CW; + + // if(!(counter%25)) + // NSLog(@"Execute VAOs\n"); + + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE); + + glDisable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,0); + + + glBindVertexArrayOES(m_VertexArrayName); + + //commented out for shader testing + + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + glFrontFace(whichFace); + + glDisable(GL_DEPTH_TEST); + + glDrawArrays(objectType, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + return true; +} + +-(void)loadTexture:(NSString *)fileName +{ + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:fileName ofType:NULL]; + + m_TextureInfo=[GLKTextureLoader textureWithContentsOfFile:path options:options error:NULL]; +} + +//Yes, I am old-school, I like to create my own setters/getters + +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z +{ + *x=m_Pos.x; + *y=m_Pos.y; + *z=m_Pos.z; +} + +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z +{ + m_Pos.x=x; + m_Pos.y=y; + m_Pos.z=z; +} + +-(GLfloat)getRotation +{ + return m_Angle; +} + +-(void)setRotation:(GLfloat)angle +{ + m_Angle=angle; +} + +-(void)incrementRotation +{ + m_Angle+=m_RotationalIncrement; +} + +-(GLfloat)getRotationalIncrement +{ + return m_RotationalIncrement; +} + +-(void)setRotationalIncrement:(GLfloat)inc +{ + m_RotationalIncrement=inc; +} + +@end diff --git a/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.pbxproj b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.pbxproj new file mode 100644 index 0000000..bcdd3ee --- /dev/null +++ b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.pbxproj @@ -0,0 +1,374 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE3F507C1419B74C00CDEE02 /* earth_atmo_2.plist in Resources */ = {isa = PBXBuildFile; fileRef = CE3F507B1419B74C00CDEE02 /* earth_atmo_2.plist */; }; + CE4A4D2514180C9800312DAD /* earth_atmo.plist in Resources */ = {isa = PBXBuildFile; fileRef = CE4A4D2414180C9800312DAD /* earth_atmo.plist */; }; + CE4E4431142FC94200EF927F /* nightside.fsh in Resources */ = {isa = PBXBuildFile; fileRef = CE057F9D142FC716001AEF6B /* nightside.fsh */; }; + CE4E4432142FC94200EF927F /* nightside.vsh in Resources */ = {isa = PBXBuildFile; fileRef = CE057F9E142FC716001AEF6B /* nightside.vsh */; }; + CE4E4438142FFAAD00EF927F /* clouds_1024.png in Resources */ = {isa = PBXBuildFile; fileRef = CE4E4437142FFAAD00EF927F /* clouds_1024.png */; }; + CE86E8DD141600790014AA63 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE86E8DC141600790014AA63 /* UIKit.framework */; }; + CE86E8DF141600790014AA63 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE86E8DE141600790014AA63 /* Foundation.framework */; }; + CE86E8E1141600790014AA63 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE86E8E0141600790014AA63 /* CoreGraphics.framework */; }; + CE86E8E3141600790014AA63 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE86E8E2141600790014AA63 /* GLKit.framework */; }; + CE86E8E5141600790014AA63 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE86E8E4141600790014AA63 /* OpenGLES.framework */; }; + CE86E8EB141600790014AA63 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE86E8E9141600790014AA63 /* InfoPlist.strings */; }; + CE86E8ED141600790014AA63 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE86E8EC141600790014AA63 /* main.m */; }; + CE86E8F1141600790014AA63 /* EarthAtNightAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE86E8F0141600790014AA63 /* EarthAtNightAppDelegate.m */; }; + CE86E8F4141600790014AA63 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE86E8F2141600790014AA63 /* MainStoryboard_iPhone.storyboard */; }; + CE86E8F7141600790014AA63 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE86E8F5141600790014AA63 /* MainStoryboard_iPad.storyboard */; }; + CE86E8FB141600790014AA63 /* dayside.vsh in Resources */ = {isa = PBXBuildFile; fileRef = CE86E8FA141600790014AA63 /* dayside.vsh */; }; + CE86E8FE141600790014AA63 /* EarthAtNightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE86E8FD141600790014AA63 /* EarthAtNightViewController.m */; }; + CE86E907141601190014AA63 /* planet.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE86E906141601190014AA63 /* planet.mm */; }; + CE86E909141602560014AA63 /* earth_light.png in Resources */ = {isa = PBXBuildFile; fileRef = CE86E908141602560014AA63 /* earth_light.png */; }; + CE86E92F141691F80014AA63 /* earth_night.png in Resources */ = {isa = PBXBuildFile; fileRef = CE86E92E141691F80014AA63 /* earth_night.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + CEFD495C1440BDAE00CEB597 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + fileType = pattern.proxy; + isEditable = 1; + outputFiles = ( + ); + script = ""; + }; +/* End PBXBuildRule section */ + +/* Begin PBXFileReference section */ + CE057F92142FB2F0001AEF6B /* specular.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = specular.fsh; path = Shaders/specular.fsh; sourceTree = ""; }; + CE057F93142FB2F0001AEF6B /* specular.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = specular.vsh; path = Shaders/specular.vsh; sourceTree = ""; }; + CE057F9D142FC716001AEF6B /* nightside.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = nightside.fsh; path = Shaders/nightside.fsh; sourceTree = ""; }; + CE057F9E142FC716001AEF6B /* nightside.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = nightside.vsh; path = Shaders/nightside.vsh; sourceTree = ""; }; + CE3F507B1419B74C00CDEE02 /* earth_atmo_2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = earth_atmo_2.plist; path = assets/earth_atmo_2.plist; sourceTree = ""; }; + CE4A4D2414180C9800312DAD /* earth_atmo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = earth_atmo.plist; path = assets/earth_atmo.plist; sourceTree = ""; }; + CE4E4437142FFAAD00EF927F /* clouds_1024.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = clouds_1024.png; path = assets/clouds_1024.png; sourceTree = ""; }; + CE4E443E14301ABB00EF927F /* dayside.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = dayside.fsh; path = Shaders/dayside.fsh; sourceTree = ""; }; + CE86E8D8141600790014AA63 /* EarthAtNight.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EarthAtNight.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE86E8DC141600790014AA63 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE86E8DE141600790014AA63 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE86E8E0141600790014AA63 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE86E8E2141600790014AA63 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE86E8E4141600790014AA63 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE86E8E8141600790014AA63 /* EarthAtNight-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EarthAtNight-Info.plist"; sourceTree = ""; }; + CE86E8EA141600790014AA63 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE86E8EC141600790014AA63 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE86E8EE141600790014AA63 /* EarthAtNight-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EarthAtNight-Prefix.pch"; sourceTree = ""; }; + CE86E8EF141600790014AA63 /* EarthAtNightAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EarthAtNightAppDelegate.h; sourceTree = ""; }; + CE86E8F0141600790014AA63 /* EarthAtNightAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EarthAtNightAppDelegate.m; sourceTree = ""; }; + CE86E8F3141600790014AA63 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + CE86E8F6141600790014AA63 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CE86E8FA141600790014AA63 /* dayside.vsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = dayside.vsh; path = Shaders/dayside.vsh; sourceTree = ""; }; + CE86E8FC141600790014AA63 /* EarthAtNightViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EarthAtNightViewController.h; sourceTree = ""; }; + CE86E8FD141600790014AA63 /* EarthAtNightViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EarthAtNightViewController.m; sourceTree = ""; }; + CE86E904141601190014AA63 /* OpenglIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenglIOS.h; sourceTree = ""; }; + CE86E905141601190014AA63 /* planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = planet.h; sourceTree = ""; }; + CE86E906141601190014AA63 /* planet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = planet.mm; sourceTree = ""; }; + CE86E908141602560014AA63 /* earth_light.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = earth_light.png; path = assets/earth_light.png; sourceTree = ""; }; + CE86E92E141691F80014AA63 /* earth_night.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = earth_night.png; path = assets/earth_night.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE86E8D5141600790014AA63 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE86E8DD141600790014AA63 /* UIKit.framework in Frameworks */, + CE86E8DF141600790014AA63 /* Foundation.framework in Frameworks */, + CE86E8E1141600790014AA63 /* CoreGraphics.framework in Frameworks */, + CE86E8E3141600790014AA63 /* GLKit.framework in Frameworks */, + CE86E8E5141600790014AA63 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE86E8CD141600790014AA63 = { + isa = PBXGroup; + children = ( + CE86E8E6141600790014AA63 /* EarthAtNight */, + CE86E8DB141600790014AA63 /* Frameworks */, + CE86E8D9141600790014AA63 /* Products */, + ); + sourceTree = ""; + }; + CE86E8D9141600790014AA63 /* Products */ = { + isa = PBXGroup; + children = ( + CE86E8D8141600790014AA63 /* EarthAtNight.app */, + ); + name = Products; + sourceTree = ""; + }; + CE86E8DB141600790014AA63 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE86E8DC141600790014AA63 /* UIKit.framework */, + CE86E8DE141600790014AA63 /* Foundation.framework */, + CE86E8E0141600790014AA63 /* CoreGraphics.framework */, + CE86E8E2141600790014AA63 /* GLKit.framework */, + CE86E8E4141600790014AA63 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE86E8E6141600790014AA63 /* EarthAtNight */ = { + isa = PBXGroup; + children = ( + CE86E93014169E5D0014AA63 /* shader */, + CE86E8EF141600790014AA63 /* EarthAtNightAppDelegate.h */, + CE86E8F0141600790014AA63 /* EarthAtNightAppDelegate.m */, + CE86E8F2141600790014AA63 /* MainStoryboard_iPhone.storyboard */, + CE86E8F5141600790014AA63 /* MainStoryboard_iPad.storyboard */, + CE86E8FC141600790014AA63 /* EarthAtNightViewController.h */, + CE86E8FD141600790014AA63 /* EarthAtNightViewController.m */, + CE86E904141601190014AA63 /* OpenglIOS.h */, + CE86E905141601190014AA63 /* planet.h */, + CE86E906141601190014AA63 /* planet.mm */, + CE86E8E7141600790014AA63 /* Supporting Files */, + ); + name = EarthAtNight; + path = AtmoShader; + sourceTree = ""; + }; + CE86E8E7141600790014AA63 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE4E4437142FFAAD00EF927F /* clouds_1024.png */, + CE86E908141602560014AA63 /* earth_light.png */, + CE86E92E141691F80014AA63 /* earth_night.png */, + CE86E8E8141600790014AA63 /* EarthAtNight-Info.plist */, + CE86E8E9141600790014AA63 /* InfoPlist.strings */, + CE86E8EC141600790014AA63 /* main.m */, + CE86E8EE141600790014AA63 /* EarthAtNight-Prefix.pch */, + CE4A4D2414180C9800312DAD /* earth_atmo.plist */, + CE3F507B1419B74C00CDEE02 /* earth_atmo_2.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CE86E93014169E5D0014AA63 /* shader */ = { + isa = PBXGroup; + children = ( + CE057F92142FB2F0001AEF6B /* specular.fsh */, + CE057F93142FB2F0001AEF6B /* specular.vsh */, + CE4E443E14301ABB00EF927F /* dayside.fsh */, + CE86E8FA141600790014AA63 /* dayside.vsh */, + CE057F9D142FC716001AEF6B /* nightside.fsh */, + CE057F9E142FC716001AEF6B /* nightside.vsh */, + ); + name = shader; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE86E8D7141600790014AA63 /* EarthAtNight */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE86E901141600790014AA63 /* Build configuration list for PBXNativeTarget "EarthAtNight" */; + buildPhases = ( + CE86E8D4141600790014AA63 /* Sources */, + CE86E8D5141600790014AA63 /* Frameworks */, + CE86E8D6141600790014AA63 /* Resources */, + ); + buildRules = ( + CEFD495C1440BDAE00CEB597 /* PBXBuildRule */, + ); + dependencies = ( + ); + name = EarthAtNight; + productName = AtmoShader; + productReference = CE86E8D8141600790014AA63 /* EarthAtNight.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE86E8CF141600790014AA63 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE86E8D2141600790014AA63 /* Build configuration list for PBXProject "EarthAtNight" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE86E8CD141600790014AA63; + productRefGroup = CE86E8D9141600790014AA63 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE86E8D7141600790014AA63 /* EarthAtNight */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE86E8D6141600790014AA63 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE4E4431142FC94200EF927F /* nightside.fsh in Resources */, + CE4E4432142FC94200EF927F /* nightside.vsh in Resources */, + CE86E8EB141600790014AA63 /* InfoPlist.strings in Resources */, + CE86E8F4141600790014AA63 /* MainStoryboard_iPhone.storyboard in Resources */, + CE86E8F7141600790014AA63 /* MainStoryboard_iPad.storyboard in Resources */, + CE86E8FB141600790014AA63 /* dayside.vsh in Resources */, + CE86E909141602560014AA63 /* earth_light.png in Resources */, + CE86E92F141691F80014AA63 /* earth_night.png in Resources */, + CE4A4D2514180C9800312DAD /* earth_atmo.plist in Resources */, + CE3F507C1419B74C00CDEE02 /* earth_atmo_2.plist in Resources */, + CE4E4438142FFAAD00EF927F /* clouds_1024.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE86E8D4141600790014AA63 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE86E8ED141600790014AA63 /* main.m in Sources */, + CE86E8F1141600790014AA63 /* EarthAtNightAppDelegate.m in Sources */, + CE86E8FE141600790014AA63 /* EarthAtNightViewController.m in Sources */, + CE86E907141601190014AA63 /* planet.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE86E8E9141600790014AA63 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE86E8EA141600790014AA63 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CE86E8F2141600790014AA63 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE86E8F3141600790014AA63 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE86E8F5141600790014AA63 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE86E8F6141600790014AA63 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE86E8FF141600790014AA63 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE86E900141600790014AA63 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE86E902141600790014AA63 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "AtmoShader/EarthAtNight-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "AtmoShader/EarthAtNight-Info.plist"; + PRODUCT_NAME = EarthAtNight; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE86E903141600790014AA63 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "AtmoShader/EarthAtNight-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "AtmoShader/EarthAtNight-Info.plist"; + PRODUCT_NAME = EarthAtNight; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE86E8D2141600790014AA63 /* Build configuration list for PBXProject "EarthAtNight" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE86E8FF141600790014AA63 /* Debug */, + CE86E900141600790014AA63 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE86E901141600790014AA63 /* Build configuration list for PBXNativeTarget "EarthAtNight" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE86E902141600790014AA63 /* Debug */, + CE86E903141600790014AA63 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE86E8CF141600790014AA63 /* Project object */; +} diff --git a/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..d72a429 --- /dev/null +++ b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..1ea6fab Binary files /dev/null and b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/AtmoShader.xcscheme b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/AtmoShader.xcscheme new file mode 100644 index 0000000..dc05bfe --- /dev/null +++ b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/AtmoShader.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..c82cd64 --- /dev/null +++ b/Chapter 10/EarthAtNight/EarthAtNight.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + AtmoShader.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE86E8D7141600790014AA63 + + primary + + + + + diff --git a/Chapter 10/GLKReflectionMap/.DS_Store b/Chapter 10/GLKReflectionMap/.DS_Store new file mode 100644 index 0000000..7de31a3 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/.DS_Store differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.pbxproj b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0485733 --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.pbxproj @@ -0,0 +1,364 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE10DBAF143675AB006FBFFB /* hedly1.png in Resources */ = {isa = PBXBuildFile; fileRef = CE10DBA9143675AA006FBFFB /* hedly1.png */; }; + CE10DBB0143675AB006FBFFB /* hedly2.png in Resources */ = {isa = PBXBuildFile; fileRef = CE10DBAA143675AA006FBFFB /* hedly2.png */; }; + CE10DBB1143675AB006FBFFB /* hedly3.png in Resources */ = {isa = PBXBuildFile; fileRef = CE10DBAB143675AA006FBFFB /* hedly3.png */; }; + CE10DBB2143675AB006FBFFB /* hedly4.png in Resources */ = {isa = PBXBuildFile; fileRef = CE10DBAC143675AA006FBFFB /* hedly4.png */; }; + CE10DBB3143675AB006FBFFB /* hedly5.png in Resources */ = {isa = PBXBuildFile; fileRef = CE10DBAD143675AA006FBFFB /* hedly5.png */; }; + CE10DBB4143675AB006FBFFB /* hedly6.png in Resources */ = {isa = PBXBuildFile; fileRef = CE10DBAE143675AB006FBFFB /* hedly6.png */; }; + CE99667A1412BEF100F2E47E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE9966791412BEF100F2E47E /* UIKit.framework */; }; + CE99667C1412BEF100F2E47E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE99667B1412BEF100F2E47E /* Foundation.framework */; }; + CE99667E1412BEF100F2E47E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE99667D1412BEF100F2E47E /* CoreGraphics.framework */; }; + CE9966801412BEF100F2E47E /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE99667F1412BEF100F2E47E /* GLKit.framework */; }; + CE9966821412BEF100F2E47E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE9966811412BEF100F2E47E /* OpenGLES.framework */; }; + CE9966881412BEF100F2E47E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE9966861412BEF100F2E47E /* InfoPlist.strings */; }; + CE99668A1412BEF100F2E47E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9966891412BEF100F2E47E /* main.m */; }; + CE99668E1412BEF200F2E47E /* GLKReflectionMapAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE99668D1412BEF200F2E47E /* GLKReflectionMapAppDelegate.m */; }; + CE9966911412BEF200F2E47E /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE99668F1412BEF200F2E47E /* MainStoryboard_iPhone.storyboard */; }; + CE9966941412BEF200F2E47E /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE9966921412BEF200F2E47E /* MainStoryboard_iPad.storyboard */; }; + CE9966961412BEF200F2E47E /* Shader.fsh in Resources */ = {isa = PBXBuildFile; fileRef = CE9966951412BEF200F2E47E /* Shader.fsh */; }; + CE9966981412BEF200F2E47E /* Shader.vsh in Resources */ = {isa = PBXBuildFile; fileRef = CE9966971412BEF200F2E47E /* Shader.vsh */; }; + CE99669B1412BEF200F2E47E /* GLKReflectionMapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE99669A1412BEF200F2E47E /* GLKReflectionMapViewController.m */; }; + CE9966A51412C01D00F2E47E /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CE9966A11412C01D00F2E47E /* hedly.png */; }; + CE9966A61412C01D00F2E47E /* moon_highlands.png in Resources */ = {isa = PBXBuildFile; fileRef = CE9966A21412C01D00F2E47E /* moon_highlands.png */; }; + CE9966A71412C01D00F2E47E /* rgb_splats.256.png in Resources */ = {isa = PBXBuildFile; fileRef = CE9966A31412C01D00F2E47E /* rgb_splats.256.png */; }; + CE9966A81412C01D00F2E47E /* usa_texture.png in Resources */ = {isa = PBXBuildFile; fileRef = CE9966A41412C01D00F2E47E /* usa_texture.png */; }; + CE9966AE1412C0D600F2E47E /* planet.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE9966AD1412C0D600F2E47E /* planet.mm */; }; + CE9966B01412C37D00F2E47E /* earth_light.png in Resources */ = {isa = PBXBuildFile; fileRef = CE9966AF1412C37D00F2E47E /* earth_light.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE10DBA9143675AA006FBFFB /* hedly1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly1.png; path = "../../../../../../Documents/Apress/IPhone-OpenGL book 1/First Draft/Chapter 10/Retweak/Artwork/assets/hedly1.png"; sourceTree = ""; }; + CE10DBAA143675AA006FBFFB /* hedly2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly2.png; path = "../../../../../../Documents/Apress/IPhone-OpenGL book 1/First Draft/Chapter 10/Retweak/Artwork/assets/hedly2.png"; sourceTree = ""; }; + CE10DBAB143675AA006FBFFB /* hedly3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly3.png; path = "../../../../../../Documents/Apress/IPhone-OpenGL book 1/First Draft/Chapter 10/Retweak/Artwork/assets/hedly3.png"; sourceTree = ""; }; + CE10DBAC143675AA006FBFFB /* hedly4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly4.png; path = "../../../../../../Documents/Apress/IPhone-OpenGL book 1/First Draft/Chapter 10/Retweak/Artwork/assets/hedly4.png"; sourceTree = ""; }; + CE10DBAD143675AA006FBFFB /* hedly5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly5.png; path = "../../../../../../Documents/Apress/IPhone-OpenGL book 1/First Draft/Chapter 10/Retweak/Artwork/assets/hedly5.png"; sourceTree = ""; }; + CE10DBAE143675AB006FBFFB /* hedly6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly6.png; path = "../../../../../../Documents/Apress/IPhone-OpenGL book 1/First Draft/Chapter 10/Retweak/Artwork/assets/hedly6.png"; sourceTree = ""; }; + CE9966751412BEF100F2E47E /* GLKReflectionMap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GLKReflectionMap.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE9966791412BEF100F2E47E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE99667B1412BEF100F2E47E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE99667D1412BEF100F2E47E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE99667F1412BEF100F2E47E /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE9966811412BEF100F2E47E /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE9966851412BEF100F2E47E /* GLKReflectionMap-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GLKReflectionMap-Info.plist"; sourceTree = ""; }; + CE9966871412BEF100F2E47E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE9966891412BEF100F2E47E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE99668B1412BEF100F2E47E /* GLKReflectionMap-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GLKReflectionMap-Prefix.pch"; sourceTree = ""; }; + CE99668C1412BEF200F2E47E /* GLKReflectionMapAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLKReflectionMapAppDelegate.h; sourceTree = ""; }; + CE99668D1412BEF200F2E47E /* GLKReflectionMapAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GLKReflectionMapAppDelegate.m; sourceTree = ""; }; + CE9966901412BEF200F2E47E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + CE9966931412BEF200F2E47E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CE9966951412BEF200F2E47E /* Shader.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = Shader.fsh; path = Shaders/Shader.fsh; sourceTree = ""; }; + CE9966971412BEF200F2E47E /* Shader.vsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = Shader.vsh; path = Shaders/Shader.vsh; sourceTree = ""; }; + CE9966991412BEF200F2E47E /* GLKReflectionMapViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLKReflectionMapViewController.h; sourceTree = ""; }; + CE99669A1412BEF200F2E47E /* GLKReflectionMapViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GLKReflectionMapViewController.m; sourceTree = ""; }; + CE9966A11412C01D00F2E47E /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; + CE9966A21412C01D00F2E47E /* moon_highlands.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = moon_highlands.png; path = assets/moon_highlands.png; sourceTree = ""; }; + CE9966A31412C01D00F2E47E /* rgb_splats.256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = rgb_splats.256.png; path = assets/rgb_splats.256.png; sourceTree = ""; }; + CE9966A41412C01D00F2E47E /* usa_texture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = usa_texture.png; path = assets/usa_texture.png; sourceTree = ""; }; + CE9966AC1412C0D600F2E47E /* planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = planet.h; sourceTree = ""; }; + CE9966AD1412C0D600F2E47E /* planet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = planet.mm; sourceTree = ""; }; + CE9966AF1412C37D00F2E47E /* earth_light.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = earth_light.png; path = assets/earth_light.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE9966721412BEF100F2E47E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE99667A1412BEF100F2E47E /* UIKit.framework in Frameworks */, + CE99667C1412BEF100F2E47E /* Foundation.framework in Frameworks */, + CE99667E1412BEF100F2E47E /* CoreGraphics.framework in Frameworks */, + CE9966801412BEF100F2E47E /* GLKit.framework in Frameworks */, + CE9966821412BEF100F2E47E /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE99666A1412BEF100F2E47E = { + isa = PBXGroup; + children = ( + CE9966831412BEF100F2E47E /* GLKReflectionMap */, + CE9966781412BEF100F2E47E /* Frameworks */, + CE9966761412BEF100F2E47E /* Products */, + ); + sourceTree = ""; + }; + CE9966761412BEF100F2E47E /* Products */ = { + isa = PBXGroup; + children = ( + CE9966751412BEF100F2E47E /* GLKReflectionMap.app */, + ); + name = Products; + sourceTree = ""; + }; + CE9966781412BEF100F2E47E /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE9966791412BEF100F2E47E /* UIKit.framework */, + CE99667B1412BEF100F2E47E /* Foundation.framework */, + CE99667D1412BEF100F2E47E /* CoreGraphics.framework */, + CE99667F1412BEF100F2E47E /* GLKit.framework */, + CE9966811412BEF100F2E47E /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE9966831412BEF100F2E47E /* GLKReflectionMap */ = { + isa = PBXGroup; + children = ( + CE99668C1412BEF200F2E47E /* GLKReflectionMapAppDelegate.h */, + CE99668D1412BEF200F2E47E /* GLKReflectionMapAppDelegate.m */, + CE99668F1412BEF200F2E47E /* MainStoryboard_iPhone.storyboard */, + CE9966921412BEF200F2E47E /* MainStoryboard_iPad.storyboard */, + CE9966951412BEF200F2E47E /* Shader.fsh */, + CE9966971412BEF200F2E47E /* Shader.vsh */, + CE9966991412BEF200F2E47E /* GLKReflectionMapViewController.h */, + CE99669A1412BEF200F2E47E /* GLKReflectionMapViewController.m */, + CE9966AC1412C0D600F2E47E /* planet.h */, + CE9966AD1412C0D600F2E47E /* planet.mm */, + CE9966841412BEF100F2E47E /* Supporting Files */, + ); + path = GLKReflectionMap; + sourceTree = ""; + }; + CE9966841412BEF100F2E47E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE10DBA9143675AA006FBFFB /* hedly1.png */, + CE10DBAA143675AA006FBFFB /* hedly2.png */, + CE10DBAB143675AA006FBFFB /* hedly3.png */, + CE10DBAC143675AA006FBFFB /* hedly4.png */, + CE10DBAD143675AA006FBFFB /* hedly5.png */, + CE10DBAE143675AB006FBFFB /* hedly6.png */, + CE9966AF1412C37D00F2E47E /* earth_light.png */, + CE9966A11412C01D00F2E47E /* hedly.png */, + CE9966A21412C01D00F2E47E /* moon_highlands.png */, + CE9966A31412C01D00F2E47E /* rgb_splats.256.png */, + CE9966A41412C01D00F2E47E /* usa_texture.png */, + CE9966851412BEF100F2E47E /* GLKReflectionMap-Info.plist */, + CE9966861412BEF100F2E47E /* InfoPlist.strings */, + CE9966891412BEF100F2E47E /* main.m */, + CE99668B1412BEF100F2E47E /* GLKReflectionMap-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE9966741412BEF100F2E47E /* GLKReflectionMap */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE99669E1412BEF200F2E47E /* Build configuration list for PBXNativeTarget "GLKReflectionMap" */; + buildPhases = ( + CE9966711412BEF100F2E47E /* Sources */, + CE9966721412BEF100F2E47E /* Frameworks */, + CE9966731412BEF100F2E47E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GLKReflectionMap; + productName = GLKReflectionMap; + productReference = CE9966751412BEF100F2E47E /* GLKReflectionMap.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE99666C1412BEF100F2E47E /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE99666F1412BEF100F2E47E /* Build configuration list for PBXProject "GLKReflectionMap" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE99666A1412BEF100F2E47E; + productRefGroup = CE9966761412BEF100F2E47E /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE9966741412BEF100F2E47E /* GLKReflectionMap */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE9966731412BEF100F2E47E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE9966881412BEF100F2E47E /* InfoPlist.strings in Resources */, + CE9966911412BEF200F2E47E /* MainStoryboard_iPhone.storyboard in Resources */, + CE9966941412BEF200F2E47E /* MainStoryboard_iPad.storyboard in Resources */, + CE9966961412BEF200F2E47E /* Shader.fsh in Resources */, + CE9966981412BEF200F2E47E /* Shader.vsh in Resources */, + CE9966A51412C01D00F2E47E /* hedly.png in Resources */, + CE9966A61412C01D00F2E47E /* moon_highlands.png in Resources */, + CE9966A71412C01D00F2E47E /* rgb_splats.256.png in Resources */, + CE9966A81412C01D00F2E47E /* usa_texture.png in Resources */, + CE9966B01412C37D00F2E47E /* earth_light.png in Resources */, + CE10DBAF143675AB006FBFFB /* hedly1.png in Resources */, + CE10DBB0143675AB006FBFFB /* hedly2.png in Resources */, + CE10DBB1143675AB006FBFFB /* hedly3.png in Resources */, + CE10DBB2143675AB006FBFFB /* hedly4.png in Resources */, + CE10DBB3143675AB006FBFFB /* hedly5.png in Resources */, + CE10DBB4143675AB006FBFFB /* hedly6.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE9966711412BEF100F2E47E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE99668A1412BEF100F2E47E /* main.m in Sources */, + CE99668E1412BEF200F2E47E /* GLKReflectionMapAppDelegate.m in Sources */, + CE99669B1412BEF200F2E47E /* GLKReflectionMapViewController.m in Sources */, + CE9966AE1412C0D600F2E47E /* planet.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE9966861412BEF100F2E47E /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE9966871412BEF100F2E47E /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CE99668F1412BEF200F2E47E /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE9966901412BEF200F2E47E /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE9966921412BEF200F2E47E /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE9966931412BEF200F2E47E /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE99669C1412BEF200F2E47E /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE99669D1412BEF200F2E47E /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE99669F1412BEF200F2E47E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "GLKReflectionMap/GLKReflectionMap-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "GLKReflectionMap/GLKReflectionMap-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE9966A01412BEF200F2E47E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "GLKReflectionMap/GLKReflectionMap-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "GLKReflectionMap/GLKReflectionMap-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE99666F1412BEF100F2E47E /* Build configuration list for PBXProject "GLKReflectionMap" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE99669C1412BEF200F2E47E /* Debug */, + CE99669D1412BEF200F2E47E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE99669E1412BEF200F2E47E /* Build configuration list for PBXNativeTarget "GLKReflectionMap" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE99669F1412BEF200F2E47E /* Debug */, + CE9966A01412BEF200F2E47E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE99666C1412BEF100F2E47E /* Project object */; +} diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..e12229f --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2f7b932 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/GLKReflectionMap.xcscheme b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/GLKReflectionMap.xcscheme new file mode 100644 index 0000000..e8f0dbe --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/GLKReflectionMap.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..7a0d0a2 --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + GLKReflectionMap.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE9966741412BEF100F2E47E + + primary + + + + + diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/.DS_Store b/Chapter 10/GLKReflectionMap/GLKReflectionMap/.DS_Store new file mode 100644 index 0000000..3024cf4 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/.DS_Store differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMap-Info.plist b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMap-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMap-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMap-Prefix.pch b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMap-Prefix.pch new file mode 100644 index 0000000..8ce920d --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMap-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'GLKReflectionMap' target in the 'GLKReflectionMap' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapAppDelegate.h b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapAppDelegate.h new file mode 100644 index 0000000..37c567d --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapAppDelegate.h @@ -0,0 +1,15 @@ +// +// GLKReflectionMapAppDelegate.h +// GLKReflectionMap +// +// Created by mike on 9/3/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface GLKReflectionMapAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapAppDelegate.m b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapAppDelegate.m new file mode 100644 index 0000000..6e20ce6 --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapAppDelegate.m @@ -0,0 +1,60 @@ +// +// GLKReflectionMapAppDelegate.m +// GLKReflectionMap +// +// Created by mike on 9/3/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "GLKReflectionMapAppDelegate.h" + +@implementation GLKReflectionMapAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapViewController.h b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapViewController.h new file mode 100644 index 0000000..83ffaa1 --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapViewController.h @@ -0,0 +1,14 @@ +// +// GLKReflectionMapViewController.h +// GLKReflectionMap +// +// Created by mike on 9/3/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface GLKReflectionMapViewController : GLKViewController + +@end diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapViewController.m b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapViewController.m new file mode 100644 index 0000000..93ddede --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/GLKReflectionMapViewController.m @@ -0,0 +1,408 @@ +// +// GLKReflectionMapViewController.m +// GLKReflectionMap +// +// Created by mike on 9/3/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "planet.h" +#import "GLKReflectionMapViewController.h" + +#define BUFFER_OFFSET(i) ((char *)NULL + (i)) + +// Uniform index. +enum +{ + UNIFORM_MODELVIEWPROJECTION_MATRIX, + UNIFORM_NORMAL_MATRIX, + NUM_UNIFORMS +}; +GLint uniforms[NUM_UNIFORMS]; + +// Attribute index. +enum +{ + ATTRIB_VERTEX, + ATTRIB_NORMAL, + NUM_ATTRIBUTES +}; + +GLfloat gCubeVertexData[216] = +{ + // Data layout for each line below is: + // positionX, positionY, positionZ, normalX, normalY, normalZ, + 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, + 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, + + 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, + 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, + 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, + -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, + + -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, + -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, + + -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, + 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, + -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, + -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, + 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, + + 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, + + 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f +}; + +@interface GLKReflectionMapViewController () { + GLuint _program; + + GLKMatrix4 _modelViewProjectionMatrix; + GLKMatrix3 _normalMatrix; + float _rotation; + + GLuint _vertexArray; + GLuint _vertexBuffer; + + GLKVector3 m_Eyeposition; + Planet *m_Earth; +} +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKReflectionMapEffect *effect; + +- (void)setupGL; +- (void)tearDownGL; + +- (BOOL)loadShaders; +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file; +- (BOOL)linkProgram:(GLuint)prog; +- (BOOL)validateProgram:(GLuint)prog; +- (NSString *)imagePath:(NSString *)image; + +@end + +@implementation GLKReflectionMapViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (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.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + + [self setupGL]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + + [self tearDownGL]; + + if ([EAGLContext currentContext] == self.context) { + [EAGLContext setCurrentContext:nil]; + } + self.context = nil; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Release any cached data, images, etc. that aren't in use. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + // Return YES for supported orientations + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); + } else { + return YES; + } +} + +-(NSString *)imagePath:(NSString *)image +{ + return [[NSBundle mainBundle] pathForResource:image ofType:NULL]; +} + +- (void)setupGL +{ + int planetSize=50; + + + NSArray *images = [[NSMutableArray alloc] initWithObjects: //1 + [self imagePath:@"hedly1.png"], + [self imagePath:@"hedly2.png"], + [self imagePath:@"hedly3.png"], + [self imagePath:@"hedly4.png"], + [self imagePath:@"hedly5.png"], + [self imagePath:@"hedly6.png"], + nil]; + + [EAGLContext setCurrentContext:self.context]; + + NSDictionary *options= + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + GLKTextureInfo *info= //2 + [GLKTextureLoader cubeMapWithContentsOfFiles:images options:options error:nil]; + + + self.effect = [[GLKReflectionMapEffect alloc] init]; //3 + self.effect.light0.enabled = GL_TRUE; //4 + self.effect.light0.diffuseColor = GLKVector4Make(1.0f, 1.0f, 1.0f, 1.0f); + self.effect.light0.specularColor = GLKVector4Make(1.0f, 1.0f, 1.0f, 1.0f); + self.effect.material.shininess = 15.0f; + self.effect.lightingType = GLKLightingTypePerPixel; + + + self.effect.textureCubeMap.name =info.name; + + self.effect.light0.position=GLKVector4Make(-5.0f, 5.0f, 10.0f, 1.0); + + glEnable(GL_DEPTH_TEST); + + m_Eyeposition.x=0.0; + m_Eyeposition.y=0.0; + m_Eyeposition.z=5.0; + + m_Earth=[[Planet alloc] init:planetSize slices:planetSize radius:.5f squash:1.0f + textureFile:@"earth_light.png"]; + [m_Earth setPositionX:0.0 Y:0.0 Z:-3.0]; +} + +- (void)tearDownGL +{ + [EAGLContext setCurrentContext:self.context]; + + glDeleteBuffers(1, &_vertexBuffer); + glDeleteVertexArraysOES(1, &_vertexArray); + + self.effect = nil; + + if (_program) { + glDeleteProgram(_program); + _program = 0; + } +} + +- (void)update +{ + GLfloat scale=2.0; + float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height); + GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f); + + self.effect.transform.projectionMatrix = projectionMatrix; + + GLKMatrix4 baseModelViewMatrix = GLKMatrix4Identity; + GLKMatrix4 modelViewMatrix = GLKMatrix4Identity; + + baseModelViewMatrix = GLKMatrix4Scale(baseModelViewMatrix,scale,scale,scale); + baseModelViewMatrix = GLKMatrix4Rotate(baseModelViewMatrix, _rotation, 0.0, 0.5, 0.0f); + modelViewMatrix = GLKMatrix4MakeTranslation(0.0, 0.0, -3.0); + modelViewMatrix = GLKMatrix4Multiply(modelViewMatrix, baseModelViewMatrix); + + self.effect.transform.modelviewMatrix = modelViewMatrix; + self.effect.matrix=GLKMatrix3Identity; + + _rotation+=0.03; +} + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + GLfloat gray=0.2; + + glClearColor(gray,gray,gray, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + [self.effect prepareToDraw]; + [m_Earth execute:self.effect]; +} + +#pragma mark - OpenGL ES 2 shader compilation + +- (BOOL)loadShaders +{ + GLuint vertShader, fragShader; + NSString *vertShaderPathname, *fragShaderPathname; + + // Create shader program. + _program = glCreateProgram(); + + // Create and compile vertex shader. + vertShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"vsh"]; + if (![self compileShader:&vertShader type:GL_VERTEX_SHADER file:vertShaderPathname]) { + NSLog(@"Failed to compile vertex shader"); + return NO; + } + + // Create and compile fragment shader. + fragShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"fsh"]; + if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER file:fragShaderPathname]) { + NSLog(@"Failed to compile fragment shader"); + return NO; + } + + // Attach vertex shader to program. + glAttachShader(_program, vertShader); + + // Attach fragment shader to program. + glAttachShader(_program, fragShader); + + // Bind attribute locations. + // This needs to be done prior to linking. + glBindAttribLocation(_program, ATTRIB_VERTEX, "position"); + glBindAttribLocation(_program, ATTRIB_NORMAL, "normal"); + + // Link program. + if (![self linkProgram:_program]) { + NSLog(@"Failed to link program: %d", _program); + + if (vertShader) { + glDeleteShader(vertShader); + vertShader = 0; + } + if (fragShader) { + glDeleteShader(fragShader); + fragShader = 0; + } + if (_program) { + glDeleteProgram(_program); + _program = 0; + } + + return NO; + } + + // Get uniform locations. + uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX] = glGetUniformLocation(_program, "modelViewProjectionMatrix"); + uniforms[UNIFORM_NORMAL_MATRIX] = glGetUniformLocation(_program, "normalMatrix"); + + // Release vertex and fragment shaders. + if (vertShader) { + glDetachShader(_program, vertShader); + glDeleteShader(vertShader); + } + if (fragShader) { + glDetachShader(_program, fragShader); + glDeleteShader(fragShader); + } + + return YES; +} + +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file +{ + GLint status; + const GLchar *source; + + source = (GLchar *)[[NSString stringWithContentsOfFile:file encoding:NSUTF8StringEncoding error:nil] UTF8String]; + if (!source) { + NSLog(@"Failed to load vertex shader"); + return NO; + } + + *shader = glCreateShader(type); + glShaderSource(*shader, 1, &source, NULL); + glCompileShader(*shader); + +#if defined(DEBUG) + GLint logLength; + glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetShaderInfoLog(*shader, logLength, &logLength, log); + NSLog(@"Shader compile log:\n%s", log); + free(log); + } +#endif + + glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); + if (status == 0) { + glDeleteShader(*shader); + return NO; + } + + return YES; +} + +- (BOOL)linkProgram:(GLuint)prog +{ + GLint status; + glLinkProgram(prog); + +#if defined(DEBUG) + GLint logLength; + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program link log:\n%s", log); + free(log); + } +#endif + + glGetProgramiv(prog, GL_LINK_STATUS, &status); + if (status == 0) { + return NO; + } + + return YES; +} + +- (BOOL)validateProgram:(GLuint)prog +{ + GLint logLength, status; + + glValidateProgram(prog); + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); + if (logLength > 0) { + GLchar *log = (GLchar *)malloc(logLength); + glGetProgramInfoLog(prog, logLength, &logLength, log); + NSLog(@"Program validate log:\n%s", log); + free(log); + } + + glGetProgramiv(prog, GL_VALIDATE_STATUS, &status); + if (status == 0) { + return NO; + } + + return YES; +} + +@end diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/OpenglIOS.h b/Chapter 10/GLKReflectionMap/GLKReflectionMap/OpenglIOS.h new file mode 100644 index 0000000..fbf819e --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/OpenglIOS.h @@ -0,0 +1,19 @@ +// +// OpenglIOS.h +// General header for the exercises from Apress IOS/GLKIT Book +// +// Created by mike on 9/1/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef Bouncy_Planet_OpenglIOS_h +#define Bouncy_Planet_OpenglIOS_h + +#define BUFFER_OFFSET(i) ((char *)NULL + (i)) + +#define NUM_XYZ_ELS 3 +#define NUM_NXYZ_ELS 3 +#define NUM_RGBA_ELS 4 +#define NUM_ST_ELS 2 //2D texture coords + +#endif diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/Shader.fsh b/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/Shader.fsh new file mode 100644 index 0000000..b58ccb2 --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/Shader.fsh @@ -0,0 +1,14 @@ +// +// Shader.fsh +// GLKReflectionMap +// +// Created by mike on 9/3/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +varying lowp vec4 colorVarying; + +void main() +{ + gl_FragColor = colorVarying; +} diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/Shader.vsh b/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/Shader.vsh new file mode 100644 index 0000000..49b773b --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/Shader.vsh @@ -0,0 +1,28 @@ +// +// Shader.vsh +// GLKReflectionMap +// +// Created by mike on 9/3/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +attribute vec4 position; +attribute vec3 normal; + +varying lowp vec4 colorVarying; + +uniform mat4 modelViewProjectionMatrix; +uniform mat3 normalMatrix; + +void main() +{ + vec3 eyeNormal = normalize(normalMatrix * normal); + vec3 lightPosition = vec3(0.0, 0.0, 0.0); + vec4 diffuseColor = vec4(0.4, 0.4, 1.0, 1.0); + + float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition))); + + colorVarying = diffuseColor * nDotVP; + + gl_Position = modelViewProjectionMatrix * position; +} diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/earth_light.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/earth_light.png new file mode 100644 index 0000000..ff12df7 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/earth_light.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly.png new file mode 100644 index 0000000..587adf6 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly1.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly1.png new file mode 100644 index 0000000..3a49fec Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly1.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly2.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly2.png new file mode 100644 index 0000000..b50cf57 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly2.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly3.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly3.png new file mode 100644 index 0000000..25acdb8 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly3.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly4.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly4.png new file mode 100644 index 0000000..20798ba Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly4.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly5.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly5.png new file mode 100644 index 0000000..7288f7c Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly5.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly6.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly6.png new file mode 100644 index 0000000..8cc5897 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/hedly6.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/moon_highlands.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/moon_highlands.png new file mode 100644 index 0000000..e90cff0 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/moon_highlands.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/rgb_splats.256.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/rgb_splats.256.png new file mode 100644 index 0000000..898c27e Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/rgb_splats.256.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/usa_texture.png b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/usa_texture.png differ diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/InfoPlist.strings b/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1e3e4d7 --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..271c937 --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/main.m b/Chapter 10/GLKReflectionMap/GLKReflectionMap/main.m new file mode 100644 index 0000000..37e6bed --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/main.m @@ -0,0 +1,18 @@ +// +// main.m +// GLKReflectionMap +// +// Created by mike on 9/3/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "GLKReflectionMapAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([GLKReflectionMapAppDelegate class])); + } +} diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/planet.h b/Chapter 10/GLKReflectionMap/GLKReflectionMap/planet.h new file mode 100644 index 0000000..f19c66c --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/planet.h @@ -0,0 +1,82 @@ + +#import +#import +#import +#import "OpenglIOS.h" + +//#import "mathlib.h" + +//used to generate interleaved data + +/* +struct VBOInterleaved +{ + GLfloat x,y,z; + GLfloat nx,ny,nz; + + GLfloat s,t; +}; +*/ + +struct VAOInterleaved +{ + GLfloat xyz[NUM_XYZ_ELS]; + GLfloat nxyz[NUM_NXYZ_ELS]; + GLfloat rgba[NUM_RGBA_ELS]; + GLfloat st[NUM_ST_ELS]; +}; + +@interface Planet : NSObject +{ +@private + GLfloat *m_VertexData; + GLfloat *m_ColorData; + GLfloat *m_NormalData; + + GLKTextureInfo *m_TextureInfo; + + GLsizeiptr m_NumVertices; + + int m_NumberBatchedSpheres; + + long m_TotalXYZBytes; + long m_TotalNormalBytes; + + bool m_UseTexture; + bool m_UseNormals; + bool m_UseColors; + bool m_UseInterleaved; + + GLfloat *m_TexCoordsData; + + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; + GLfloat m_Angle; + GLKVector3 m_Pos; + GLfloat m_RotationalIncrement; + + GLuint m_VertexArrayName; + GLuint m_VertexBufferName; + + struct VAOInterleaved *m_InterleavedData; //interleaved data for testing. +} + +-(bool)execute:(GLKBaseEffect *)effect; +-(id)init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash textureFile:(NSString *)textureFile; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z; +-(GLfloat)getRotation; +-(void)setRotation:(GLfloat)angle; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(GLfloat)getRotationalIncrement; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; +-(void)createVAO; +-(void)createInterleavedData; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; +-(void)loadTexture:(NSString *)fileName; + +@end + diff --git a/Chapter 10/GLKReflectionMap/GLKReflectionMap/planet.mm b/Chapter 10/GLKReflectionMap/GLKReflectionMap/planet.mm new file mode 100644 index 0000000..e0a662b --- /dev/null +++ b/Chapter 10/GLKReflectionMap/GLKReflectionMap/planet.mm @@ -0,0 +1,353 @@ +// +// planet.m +// +// Created by mike on 5/14/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "planet.h" + +@implementation Planet + +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash textureFile:(NSString *)textureFile //chapter 5 +{ + unsigned int colorIncrment=0; + unsigned int blue=0; + unsigned int red=255; + + m_UseTexture=YES; + m_UseNormals=YES; + m_UseInterleaved=YES; + m_InterleavedData=NULL; + + //used during testing for teh number of extra spheres rendered after the first one + //to test dataloading. This value shows up as the "batch" metric in Instruments. + + m_NumberBatchedSpheres=10; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + + //vertices + + GLfloat *vtxPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * NUM_XYZ_ELS * ((m_Slices*2+2) * (m_Stacks))); + + //color data + + GLfloat *colPtr = m_ColorData = + (GLfloat*)malloc(sizeof(GLfloat) * NUM_RGBA_ELS * ((m_Slices*2+2) * (m_Stacks))); + + //normal pointers for lighting + + GLfloat *norPtr = m_NormalData = + (GLfloat*)malloc(sizeof(GLfloat) * NUM_NXYZ_ELS * ((m_Slices*2+2) * (m_Stacks))); //normals + + GLfloat *textPtr=nil; + + if(textureFile!=nil) + textPtr=m_TexCoordsData = (GLfloat *)malloc(sizeof(GLfloat) * NUM_ST_ELS * ((m_Slices*2+2) * (m_Stacks))); //texture coords + + unsigned int phiIdx, thetaIdx; + + //latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) + { + //starts at -1.57 goes up to +1.57 radians + + //the first circle + + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0/(float)(m_Stacks)) - 0.5); + + //the next, or second one. + + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0/(float)(m_Stacks)) - 0.5); + float cosPhi0 = cos(phi0); + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + //longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) + { + //increment along the longitude circle each "slice" + + float theta = -2.0*M_PI * ((float)thetaIdx) * (1.0/(float)(m_Slices-1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + //we're generating a vertical pair of points, such + //as the first point of stack 0 and the first point of stack 1 + //above it. This is how TRIANGLE_STRIPS work, + //taking a set of 4 vertices and essentially drawing two triangles + //at a time. The first is v0-v1-v2 and the next is v2-v1-v3. Etc. + + //get x-y-z for the first vertex of stack + + vtxPtr[0] = m_Scale*cosPhi0 * cosTheta; + vtxPtr[1] = m_Scale*sinPhi0*m_Squash; + vtxPtr[2] = m_Scale*(cosPhi0 * sinTheta); + + //the same but for the vertex immediately above the previous one + + vtxPtr[3] = m_Scale*cosPhi1 * cosTheta; + vtxPtr[4] = m_Scale*sinPhi1*m_Squash; + vtxPtr[5] = m_Scale*(cosPhi1 * sinTheta); + + //normal pointers for lighting + + norPtr[0] = cosPhi0 * cosTheta; + norPtr[2] = cosPhi0 * sinTheta; + norPtr[1] = sinPhi0; //get x-y-z for the first vertex of stack N + norPtr[3] = cosPhi1 * cosTheta; + norPtr[5] = cosPhi1 * sinTheta; + norPtr[4] = sinPhi1; + + + if(textPtr!=nil) + { + GLfloat texX = (float)thetaIdx * (1.0f/(float)(m_Slices-1)); + + textPtr[0] = texX; + textPtr[1] = (float)(phiIdx+0) * (1.0f/(float)(m_Stacks)); + textPtr[2] = texX; + textPtr[3] = (float)(phiIdx+1) * (1.0f/(float)(m_Stacks)); + } + + if(0) + { + //needed to switch back to bytes + + colPtr[0] = red; + colPtr[1] = 0; + colPtr[2] = blue; + colPtr[4] = red; + colPtr[5] = 0; + colPtr[6] = blue; + colPtr[3] = colPtr[7] = 255; + } + else + { + colPtr[0] =(GLfloat)red/255.0f; + colPtr[1] = 0.0f/255.0f; + colPtr[2] = (GLfloat)blue/255.0f; + colPtr[4] = (GLfloat)red/255.0f; + colPtr[5] = 0.0f/255.0; + colPtr[6] =(GLfloat) blue/255.0f; + colPtr[3] = colPtr[7] = 255.0f/255.0f; + } + + colPtr += 2*NUM_RGBA_ELS; + vtxPtr += 2*NUM_XYZ_ELS; + norPtr += 2*NUM_NXYZ_ELS; + + if(textPtr!=nil) + textPtr += 2*NUM_ST_ELS; + } + + blue+=colorIncrment; + red-=colorIncrment; + + // degenerate triangle to connect stacks and maintain winding order + + vtxPtr[0] = vtxPtr[3] = vtxPtr[-3]; vtxPtr[1] = vtxPtr[4] = vtxPtr[-2]; vtxPtr[2] = vtxPtr[5] = vtxPtr[-1]; + norPtr[0] = norPtr[3] = norPtr[-3]; norPtr[1] = norPtr[4] = norPtr[-2]; norPtr[2] = norPtr[5] = norPtr[-1]; + + if(textPtr!=nil) + { + textPtr[0] = textPtr[2] = textPtr[-2]; textPtr[1] = textPtr[3] = textPtr[-1]; + } + } + } + + m_NumVertices=((m_Slices*2+2) * (m_Stacks)); + + m_Angle=0.0; + m_RotationalIncrement=0.0; + + m_Pos.x=0.0; + m_Pos.y=0.0; + m_Pos.z=0.0; + + [self loadTexture:textureFile]; + + [self createVAO]; + + return self; +} + +-(void)createInterleavedData +{ + int i; + GLfloat *vtxPtr; + GLfloat *norPtr; + GLfloat *colPtr; + GLfloat *textPtr; + int xyzSize; + int nxyzSize; + int rgbaSize; + int textSize; + + struct VAOInterleaved *startData; + + int structSize=sizeof(struct VAOInterleaved); + long allocSize=structSize*m_NumVertices; + + m_InterleavedData=(struct VAOInterleaved *)malloc(allocSize); + + startData=m_InterleavedData; + + vtxPtr=m_VertexData; + norPtr=m_NormalData; + colPtr=m_ColorData; + textPtr=m_TexCoordsData; + + xyzSize=sizeof(GLfloat)*NUM_XYZ_ELS; + nxyzSize=sizeof(GLfloat)*NUM_NXYZ_ELS; + rgbaSize=sizeof(GLfloat)*NUM_RGBA_ELS; + textSize=sizeof(GLfloat)*NUM_ST_ELS; + + for(i=0;ixyz,vtxPtr,xyzSize); //geometry + memcpy(&startData->nxyz,norPtr,nxyzSize); //normals + memcpy(&startData->rgba,colPtr,rgbaSize); //colors + memcpy(&startData->st,textPtr,textSize); //texture coords + + startData++; + + vtxPtr+=NUM_XYZ_ELS; + norPtr+=NUM_NXYZ_ELS; + colPtr+=NUM_RGBA_ELS; + textPtr+=NUM_ST_ELS; + } +} + +-(void)createVAO +{ + GLuint numBytesPerXYZ,numBytesPerNXYZ,numBytesPerRGBA; + GLuint structSize=sizeof(struct VAOInterleaved); + + [self createInterleavedData]; + + //note that the context is set in the in the parent object + + glGenVertexArraysOES(1, &m_VertexArrayName); + glBindVertexArrayOES(m_VertexArrayName); + + numBytesPerXYZ=sizeof(GL_FLOAT)*NUM_XYZ_ELS; + numBytesPerNXYZ=sizeof(GL_FLOAT)*NUM_NXYZ_ELS; + numBytesPerRGBA=sizeof(GL_FLOAT)*NUM_RGBA_ELS; + + glGenBuffers(1, &m_VertexBufferName); + glBindBuffer(GL_ARRAY_BUFFER, m_VertexBufferName); + glBufferData(GL_ARRAY_BUFFER, sizeof(struct VAOInterleaved)*m_NumVertices, m_InterleavedData, GL_STATIC_DRAW); + + glEnableVertexAttribArray(GLKVertexAttribPosition); + glVertexAttribPointer(GLKVertexAttribPosition, NUM_XYZ_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(0)); + + glEnableVertexAttribArray(GLKVertexAttribNormal); + glVertexAttribPointer(GLKVertexAttribNormal, NUM_NXYZ_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(numBytesPerXYZ)); + + glEnableVertexAttribArray(GLKVertexAttribColor); + glVertexAttribPointer(GLKVertexAttribColor, NUM_RGBA_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(numBytesPerNXYZ+numBytesPerXYZ)); + + glEnableVertexAttribArray(GLKVertexAttribTexCoord0); + glVertexAttribPointer(GLKVertexAttribTexCoord0,NUM_ST_ELS, GL_FLOAT, GL_FALSE, structSize, BUFFER_OFFSET(numBytesPerNXYZ+numBytesPerXYZ+numBytesPerRGBA)); +} + +-(bool)execute:(GLKBaseEffect *)effect +{ + static int counter=0; + int objectType=GL_TRIANGLE_STRIP; //GL_POINTS, GL_LINES, GL_TRIANGLE_STRIP + static int whichFace=GL_CW; + + if(m_TextureInfo!=NULL) + effect.texture2d0.name=m_TextureInfo.name; + + if(!(counter%25)) + NSLog(@"Execute VAOs\n"); + + glBindVertexArrayOES(m_VertexArrayName); + + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + glFrontFace(whichFace); + + glDisable(GL_BLEND); + glDisable(GL_DEPTH_TEST); + + glDrawArrays(objectType, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + counter++; + + return true; +} + + +-(void)loadTexture:(NSString *)fileName +{ + NSString *path=[[NSBundle mainBundle]pathForResource:fileName ofType:NULL]; + + + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + m_TextureInfo=[GLKTextureLoader textureWithContentsOfFile:path options:options error:NULL]; +} + +//Yes, I am old-school, I like to create my own setters/getters + +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z +{ + *x=m_Pos.x; + *y=m_Pos.y; + *z=m_Pos.z; +} + +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z +{ + m_Pos.x=x; + m_Pos.y=y; + m_Pos.z=z; +} + +-(GLfloat)getRotation +{ + return m_Angle; +} + +-(void)setRotation:(GLfloat)angle +{ + m_Angle=angle; +} + +-(void)incrementRotation +{ + m_Angle+=m_RotationalIncrement; +} + +-(GLfloat)getRotationalIncrement +{ + return m_RotationalIncrement; +} + +-(void)setRotationalIncrement:(GLfloat)inc +{ + m_RotationalIncrement=inc; +} + +@end diff --git a/Chapter 3/.DS_Store b/Chapter 3/.DS_Store new file mode 100644 index 0000000..9bb3390 Binary files /dev/null and b/Chapter 3/.DS_Store differ diff --git a/Chapter 3/BouncyCube/.DS_Store b/Chapter 3/BouncyCube/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 3/BouncyCube/.DS_Store differ diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.pbxproj b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.pbxproj new file mode 100644 index 0000000..07e768d --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.pbxproj @@ -0,0 +1,309 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269D33141C261B00704362 /* BouncyCubeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269D2F141C261B00704362 /* BouncyCubeAppDelegate.m */; }; + CE269D34141C261B00704362 /* BouncyCubeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269D31141C261B00704362 /* BouncyCubeViewController.m */; }; + CE269D3C141C263400704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269D36141C263400704362 /* InfoPlist.strings */; }; + CE269D40141C264600704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269D3F141C264600704362 /* main.m */; }; + CEFD48FF1440288100CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD48FB1440288100CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD49001440288100CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD48FD1440288100CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* BouncyCube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncyCube.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269D2C141C261B00704362 /* BouncyCube-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BouncyCube-Info.plist"; path = "BouncyCube/BouncyCube-Info.plist"; sourceTree = SOURCE_ROOT; }; + CE269D2D141C261B00704362 /* BouncyCube-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "BouncyCube-Prefix.pch"; path = "BouncyCube/BouncyCube-Prefix.pch"; sourceTree = SOURCE_ROOT; }; + CE269D2E141C261B00704362 /* BouncyCubeAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BouncyCubeAppDelegate.h; path = BouncyCube/BouncyCubeAppDelegate.h; sourceTree = SOURCE_ROOT; }; + CE269D2F141C261B00704362 /* BouncyCubeAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BouncyCubeAppDelegate.m; path = BouncyCube/BouncyCubeAppDelegate.m; sourceTree = SOURCE_ROOT; }; + CE269D30141C261B00704362 /* BouncyCubeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BouncyCubeViewController.h; path = BouncyCube/BouncyCubeViewController.h; sourceTree = SOURCE_ROOT; }; + CE269D31141C261B00704362 /* BouncyCubeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BouncyCubeViewController.m; path = BouncyCube/BouncyCubeViewController.m; sourceTree = SOURCE_ROOT; }; + CE269D37141C263400704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = BouncyCube/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + CE269D3F141C264600704362 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BouncyCube/main.m; sourceTree = SOURCE_ROOT; }; + CE269D41141C265200704362 /* BouncyCube-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BouncyCube-Info.plist"; path = "BouncyCube/BouncyCube-Info.plist"; sourceTree = SOURCE_ROOT; }; + CEFD48FC1440288100CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = BouncyCube/en.lproj/MainStoryboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; + CEFD48FE1440288100CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = BouncyCube/en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncyCube */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncyCube.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncyCube */ = { + isa = PBXGroup; + children = ( + CE269D2C141C261B00704362 /* BouncyCube-Info.plist */, + CE269D2D141C261B00704362 /* BouncyCube-Prefix.pch */, + CE269D2E141C261B00704362 /* BouncyCubeAppDelegate.h */, + CE269D2F141C261B00704362 /* BouncyCubeAppDelegate.m */, + CE269D30141C261B00704362 /* BouncyCubeViewController.h */, + CE269D31141C261B00704362 /* BouncyCubeViewController.m */, + CEFD48FB1440288100CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD48FD1440288100CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = BouncyCube; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE269D36141C263400704362 /* InfoPlist.strings */, + CE269D3F141C264600704362 /* main.m */, + CE269D41141C265200704362 /* BouncyCube-Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncyCube */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncyCube" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncyCube; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncyCube.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncyCube" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncyCube */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269D3C141C263400704362 /* InfoPlist.strings in Resources */, + CEFD48FF1440288100CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD49001440288100CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269D33141C261B00704362 /* BouncyCubeAppDelegate.m in Sources */, + CE269D34141C261B00704362 /* BouncyCubeViewController.m in Sources */, + CE269D40141C264600704362 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269D36141C263400704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269D37141C263400704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD48FB1440288100CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD48FC1440288100CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD48FD1440288100CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD48FE1440288100CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncyCube/BouncyCube-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncyCube/BouncyCube-Info.plist"; + PRODUCT_NAME = BouncyCube; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncyCube/BouncyCube-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncyCube/BouncyCube-Info.plist"; + PRODUCT_NAME = BouncyCube; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncyCube" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncyCube" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a0f4940 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..00080ac Binary files /dev/null and b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/user.mode1v3 b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..9d32ce2 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/user.mode1v3 @@ -0,0 +1,1370 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CE0D3402143D521400959955 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + servicesModulebreakpoints + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 463}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 566 428 788 504 0 0 1920 1058 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + BouncyCubeViewController.h + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + BouncyCubeViewController.h + _historyCapacity + 40 + bookmark + CE4A5FDC143D817600DDBAE3 + history + + CE4A5FDB143D817600DDBAE3 + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {580, 251}} + RubberWindowFrame + 566 428 788 504 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 251pt + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 256}, {580, 207}} + RubberWindowFrame + 566 428 788 504 0 0 1920 1058 + + Module + XCDetailModule + Proportion + 207pt + + + Proportion + 580pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CE4A5FDD143D817600DDBAE3 + 1CE0B1FE06471DED0097A5F4 + CE4A5FDE143D817600DDBAE3 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CE0D3403143D521400959955 + /Users/user/iPhoneProjects1/OpenGL Book/Apress Exercises For Downloading/Chapter 3/BouncyCube/BouncyCube.xcodeproj + + WindowString + 566 428 788 504 0 0 1920 1058 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + 587 409 500 500 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + 587 409 500 500 0 0 1920 1058 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CE0D3403143D521400959955 + CE4A5FDF143D817600DDBAE3 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 587 409 500 500 0 0 1920 1058 + WindowToolGUID + CE0D3403143D521400959955 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/user.pbxuser b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/user.pbxuser new file mode 100644 index 0000000..9003a09 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/user.pbxuser @@ -0,0 +1,119 @@ +// !$*UTF8*$! +{ + CE0D33E8143D520500959955 /* BouncyCube */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = BouncyCube; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CE0D3405143D521400959955 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CE0D3406143D521400959955 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CE0D33E8143D520500959955 /* BouncyCube */; + activeTarget = CE269CCA141BF49D00704362 /* BouncyCube */; + codeSenseManager = CE0D3406143D521400959955 /* Code sense */; + executables = ( + CE0D33E8143D520500959955 /* BouncyCube */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 341, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 339575115; + PBXWorkspaceStateSaveDate = 339575115; + }; + perUserProjectItems = { + CE4A5FDB143D817600DDBAE3 /* PBXTextBookmark */ = CE4A5FDB143D817600DDBAE3 /* PBXTextBookmark */; + CE4A5FDC143D817600DDBAE3 /* PBXTextBookmark */ = CE4A5FDC143D817600DDBAE3 /* PBXTextBookmark */; + }; + sourceControlManager = CE0D3405143D521400959955 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* BouncyCube */ = { + activeExec = 0; + executables = ( + CE0D33E8143D520500959955 /* BouncyCube */, + ); + }; + CE269D30141C261B00704362 /* BouncyCubeViewController.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {519, 219}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 262}"; + }; + }; + CE4A5FDB143D817600DDBAE3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = CE269D30141C261B00704362 /* BouncyCubeViewController.h */; + name = "BouncyCubeViewController.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 262; + vrLoc = 0; + }; + CE4A5FDC143D817600DDBAE3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = CE269D30141C261B00704362 /* BouncyCubeViewController.h */; + name = "BouncyCubeViewController.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 262; + vrLoc = 0; + }; +} diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncyCube.xcscheme b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncyCube.xcscheme new file mode 100644 index 0000000..85612cf --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncyCube.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..64cc3e7 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncyCube.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 3/BouncyCube/BouncyCube/.DS_Store b/Chapter 3/BouncyCube/BouncyCube/.DS_Store new file mode 100644 index 0000000..2aa0f9e Binary files /dev/null and b/Chapter 3/BouncyCube/BouncyCube/.DS_Store differ diff --git a/Chapter 3/BouncyCube/BouncyCube/BouncyCube-Info.plist b/Chapter 3/BouncyCube/BouncyCube/BouncyCube-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/BouncyCube-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 3/BouncyCube/BouncyCube/BouncyCube-Prefix.pch b/Chapter 3/BouncyCube/BouncyCube/BouncyCube-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/BouncyCube-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 3/BouncyCube/BouncyCube/BouncyCubeAppDelegate.h b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeAppDelegate.h new file mode 100644 index 0000000..b4de014 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncyCubeAppDelegate.h +// BouncyCube +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncyCubeAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 3/BouncyCube/BouncyCube/BouncyCubeAppDelegate.m b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeAppDelegate.m new file mode 100644 index 0000000..8522a36 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncyCubeAppDelegate.m +// BouncyCube +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyCubeAppDelegate.h" + +@implementation BouncyCubeAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 3/BouncyCube/BouncyCube/BouncyCubeViewController.h b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeViewController.h new file mode 100644 index 0000000..52cb4b2 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeViewController.h @@ -0,0 +1,14 @@ +// +// BouncyCubeViewController.h +// BouncyCube +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncyCubeViewController : GLKViewController + +@end diff --git a/Chapter 3/BouncyCube/BouncyCube/BouncyCubeViewController.m b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeViewController.m new file mode 100644 index 0000000..58bc3f6 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/BouncyCubeViewController.m @@ -0,0 +1,183 @@ +// +// BouncyCubeViewController.m +// BouncyCube +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyCubeViewController.h" + +@interface BouncyCubeViewController () +{ + + +} + +-(void)setClipping; + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncyCubeViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [EAGLContext setCurrentContext:self.context]; + + [self setClipping]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static int counter=0; + + static const GLfloat cubeVertices[] = //1 + { + -0.5f, 0.5f, 0.5f, //vertex 0 + 0.5f, 0.5f, 0.5f, // v1 + 0.5f,-0.5f, 0.5f, // v2 + -0.5f,-0.5f, 0.5f, // v3 + + -0.5f, 0.5f,-0.5f, // v4 + 0.5f, 0.5f,-0.5f, // v5 + 0.5f,-0.5f,-0.5f, // v6 + -0.5f,-0.5f,-0.5f, // v7 + }; + + static const GLubyte cubeColors[] = { //2 + 255, 255, 0, 255, + 0, 255, 255, 255, + 0, 0, 0, 0, + 255, 0, 255, 255, + + 255, 255, 0, 255, + 0, 255, 255, 255, + 0, 0, 0, 0, + 255, 0, 255, 255, + }; + + static const GLubyte tfan1[6 * 3] = //3 + { + 1,0,3, + 1,3,2, + 1,2,6, + 1,6,5, + 1,5,4, + 1,4,0 + }; + + static const GLubyte tfan2[6 * 3] = //4 + { + 7,4,5, + 7,5,6, + 7,6,2, + 7,2,3, + 7,3,0, + 7,0,4 + }; + + static GLfloat transY = 0.0f; + static GLfloat z=-2.0f; //1 + static GLfloat spinX=0; + static GLfloat spinY=0; + + glClearColor(0.5f, 0.5f, 0.5f, 1.0f); //2 + glClear(GL_COLOR_BUFFER_BIT); + + glEnable(GL_CULL_FACE); //3 + glCullFace(GL_FRONT); + + // glMatrixMode(GL_PROJECTION); //4 + // glLoadIdentity(); + + glMatrixMode(GL_MODELVIEW); //5 + glLoadIdentity(); + + //glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), 0.0f); + + + + glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), z); //6 + glRotatef(spinY, 0.0, 1.0, 0.0); + glRotatef(spinX, 1.0, 0.0, 0.0); + + + + transY += 0.075f; + + //glVertexPointer(2, GL_FLOAT, 0, squareVertices); + + glVertexPointer(3, GL_FLOAT, 0, cubeVertices); //7 + glEnableClientState(GL_VERTEX_ARRAY); + glColorPointer(4, GL_UNSIGNED_BYTE, 0, cubeColors); //8 + glEnableClientState(GL_COLOR_ARRAY); + + // glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + glDrawElements( GL_TRIANGLE_FAN, 6 * 3, GL_UNSIGNED_BYTE, tfan1); //9 + glDrawElements( GL_TRIANGLE_FAN, 6 * 3, GL_UNSIGNED_BYTE, tfan2); + + if(!(counter%100)) + NSLog(@"FPS: %d\n",self.framesPerSecond); + + counter++; + spinY+=.25; + spinX+=.25; + +} + +-(void)setClipping +{ + float aspectRatio; + const float zNear = 1.5; //1 + const float zFar = 1000.0f; //2 + const float fieldOfView = 60.0; //3 + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; //4 + + //height and width values clamp the fov to the height; flipping it would make it relative to the width. So if we + //want the field-of-view to be 60 degrees, similar to that of a wide angle lens, it will be + //based on the height of our window and not the width, Important to know when rendering to a + //non-square screen. + + aspectRatio=(float)frame.size.width/(float)frame.size.height; //5 + //Set the OpenGL projection matrix + + glMatrixMode(GL_PROJECTION); //6 + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (fieldOfView) / 2.0); //7 + + glFrustumf(-size, size, -size /aspectRatio, size /aspectRatio, zNear, zFar); //8 + glViewport(0, 0, frame.size.width, frame.size.height); //9 + + //Make the OpenGL ModelView matrix the default. + + glMatrixMode(GL_MODELVIEW); //10 +} + + +@end diff --git a/Chapter 3/BouncyCube/BouncyCube/en.lproj/InfoPlist.strings b/Chapter 3/BouncyCube/BouncyCube/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 3/BouncyCube/BouncyCube/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 3/BouncyCube/BouncyCube/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..96de79b --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 3/BouncyCube/BouncyCube/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 3/BouncyCube/BouncyCube/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..2a113a2 --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 3/BouncyCube/BouncyCube/main.m b/Chapter 3/BouncyCube/BouncyCube/main.m new file mode 100644 index 0000000..34a788a --- /dev/null +++ b/Chapter 3/BouncyCube/BouncyCube/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncyCubeAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncyCubeAppDelegate class])); + } +} diff --git a/Chapter 3/BouncySquare/.DS_Store b/Chapter 3/BouncySquare/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 3/BouncySquare/.DS_Store differ diff --git a/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.pbxproj b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f40ad64 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.pbxproj @@ -0,0 +1,306 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncySquareViewController.m */; }; + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* BouncySquare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncySquare.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BouncySquare-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BouncySquare-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareViewController.m; sourceTree = ""; }; + CEFD4907144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD4909144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncySquare */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncySquare.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncySquare */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */, + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */, + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncySquare */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncySquare; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncySquare.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncySquare */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4907144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4909144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..66783b2 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..7af9a85 Binary files /dev/null and b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..fe38545 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 3/BouncySquare/BouncySquare/BouncySquare-Info.plist b/Chapter 3/BouncySquare/BouncySquare/BouncySquare-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/BouncySquare-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 3/BouncySquare/BouncySquare/BouncySquare-Prefix.pch b/Chapter 3/BouncySquare/BouncySquare/BouncySquare-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/BouncySquare-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 3/BouncySquare/BouncySquare/BouncySquareAppDelegate.h b/Chapter 3/BouncySquare/BouncySquare/BouncySquareAppDelegate.h new file mode 100644 index 0000000..a208c69 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/BouncySquareAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncySquareAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncySquareAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 3/BouncySquare/BouncySquare/BouncySquareAppDelegate.m b/Chapter 3/BouncySquare/BouncySquare/BouncySquareAppDelegate.m new file mode 100644 index 0000000..983b5e5 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/BouncySquareAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncySquareAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareAppDelegate.h" + +@implementation BouncySquareAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 3/BouncySquare/BouncySquare/BouncySquareViewController.h b/Chapter 3/BouncySquare/BouncySquare/BouncySquareViewController.h new file mode 100644 index 0000000..fdcb962 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/BouncySquareViewController.h @@ -0,0 +1,14 @@ +// +// BouncySquareViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncySquareViewController : GLKViewController + +@end diff --git a/Chapter 3/BouncySquare/BouncySquare/BouncySquareViewController.m b/Chapter 3/BouncySquare/BouncySquare/BouncySquareViewController.m new file mode 100644 index 0000000..0176d8b --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/BouncySquareViewController.m @@ -0,0 +1,93 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareViewController.h" + +@interface BouncySquareViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncySquareViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + [EAGLContext setCurrentContext:self.context]; + +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static int counter=0; + + static const GLfloat squareVertices[] = { + -0.5f, -0.33f, + 0.5f, -0.33f, + -0.5f, 0.33f, + 0.5f, 0.33f, + }; + + static const GLubyte squareColors[] = { + 255, 255, 0, 255, + 0, 255, 255, 255, + 0, 0, 0, 0, + 255, 0, 255, 255, + }; + + static float transY = 0.0f; + + glClearColor(0.5f, 0.5f, 0.5f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), 0.0f); + + transY += 0.075f; + + glVertexPointer(2, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + glColorPointer(4, GL_UNSIGNED_BYTE, 0, squareColors); + glEnableClientState(GL_COLOR_ARRAY); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + if(!(counter%100)) + NSLog(@"FPS: %d\n",self.framesPerSecond); + + counter++; +} + + +@end diff --git a/Chapter 3/BouncySquare/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 3/BouncySquare/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 3/BouncySquare/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 3/BouncySquare/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1164b96 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 3/BouncySquare/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 3/BouncySquare/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..47e1785 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 3/BouncySquare/BouncySquare/main.m b/Chapter 3/BouncySquare/BouncySquare/main.m new file mode 100644 index 0000000..d3e3439 --- /dev/null +++ b/Chapter 3/BouncySquare/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncySquareAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncySquareAppDelegate class])); + } +} diff --git a/Chapter 3/OpenGLSolarSystem/.DS_Store b/Chapter 3/OpenGLSolarSystem/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 3/OpenGLSolarSystem/.DS_Store differ diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.pbxproj b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.pbxproj new file mode 100644 index 0000000..446f4ce --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.pbxproj @@ -0,0 +1,319 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */; }; + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */; }; + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE60A611141C652F000874FC /* InfoPlist.strings */; }; + CE60A616141C654B000874FC /* Planet.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A615141C654B000874FC /* Planet.m */; }; + CE96CD3A141C6671007DAAA7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD39141C6671007DAAA7 /* main.m */; }; + CE96CD3D141C6E82007DAAA7 /* SolarSystemController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD3C141C6E82007DAAA7 /* SolarSystemController.m */; }; + CEFD491914402B2100CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD491514402B2100CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD491A14402B2100CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD491714402B2100CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenGLSolarSystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemAppDelegate.h; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h; sourceTree = SOURCE_ROOT; }; + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemAppDelegate.m; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m; sourceTree = SOURCE_ROOT; }; + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemViewController.h; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.h; sourceTree = SOURCE_ROOT; }; + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemViewController.m; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.m; sourceTree = SOURCE_ROOT; }; + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "OpenGLSolarSystem-Info.plist"; path = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; sourceTree = SOURCE_ROOT; }; + CE60A612141C652F000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = OpenGLSolarSystem/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + CE60A614141C653E000874FC /* Planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Planet.h; path = OpenGLSolarSystem/Planet.h; sourceTree = SOURCE_ROOT; }; + CE60A615141C654B000874FC /* Planet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Planet.m; path = OpenGLSolarSystem/Planet.m; sourceTree = SOURCE_ROOT; }; + CE96CD39141C6671007DAAA7 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = OpenGLSolarSystem/main.m; sourceTree = SOURCE_ROOT; }; + CE96CD3B141C6E81007DAAA7 /* SolarSystemController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SolarSystemController.h; path = OpenGLSolarSystem/SolarSystemController.h; sourceTree = SOURCE_ROOT; }; + CE96CD3C141C6E82007DAAA7 /* SolarSystemController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SolarSystemController.m; path = OpenGLSolarSystem/SolarSystemController.m; sourceTree = SOURCE_ROOT; }; + CE96CD49141D5CB4007DAAA7 /* SolarSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SolarSystem.h; path = OpenGLSolarSystem/SolarSystem.h; sourceTree = SOURCE_ROOT; }; + CEFD491614402B2100CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; + CEFD491814402B2100CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXGroup; + children = ( + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */, + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */, + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */, + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */, + CE60A614141C653E000874FC /* Planet.h */, + CE60A615141C654B000874FC /* Planet.m */, + CE96CD3B141C6E81007DAAA7 /* SolarSystemController.h */, + CE96CD3C141C6E82007DAAA7 /* SolarSystemController.m */, + CE96CD49141D5CB4007DAAA7 /* SolarSystem.h */, + CEFD491514402B2100CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD491714402B2100CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = OpenGLSolarSystem; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE96CD39141C6671007DAAA7 /* main.m */, + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */, + CE60A611141C652F000874FC /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpenGLSolarSystem; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */, + CEFD491914402B2100CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD491A14402B2100CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */, + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */, + CE60A616141C654B000874FC /* Planet.m in Sources */, + CE96CD3A141C6671007DAAA7 /* main.m in Sources */, + CE96CD3D141C6E82007DAAA7 /* SolarSystemController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE60A611141C652F000874FC /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE60A612141C652F000874FC /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD491514402B2100CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD491614402B2100CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD491714402B2100CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD491814402B2100CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41c6fd1 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..67ecf5d Binary files /dev/null and b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/user.mode1v3 b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..cf456b3 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/user.mode1v3 @@ -0,0 +1,1363 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CEF317C6141C662400ADE1D0 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 404 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + CE269CD9141BF49D00704362 + CE269CDA141BF49D00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {404, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {421, 463}} + GroupTreeTableConfiguration + + MainColumn + 404 + + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXSmartGroupTreeModule + Proportion + 421pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {362, 277}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 277pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 282}, {362, 181}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + XCDetailModule + Proportion + 181pt + + + Proportion + 362pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CEF317C4141C662400ADE1D0 + 1CE0B1FE06471DED0097A5F4 + CEF317C5141C662400ADE1D0 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CEF317C7141C662400ADE1D0 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj + + WindowString + -1396 553 788 504 -1680 30 1680 1050 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CEF317C7141C662400ADE1D0 + CEF317C8141C662400ADE1D0 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + -1375 534 500 500 -1680 30 1680 1050 + WindowToolGUID + CEF317C7141C662400ADE1D0 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/user.pbxuser b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/user.pbxuser new file mode 100644 index 0000000..fa58c18 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */; + activeTarget = CE269CCA141BF49D00704362 /* OpenGLSolarSystem */; + codeSenseManager = CEF317CA141C662400ADE1D0 /* Code sense */; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 123, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337405452; + PBXWorkspaceStateSaveDate = 337405452; + }; + sourceControlManager = CEF317C9141C662400ADE1D0 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + activeExec = 0; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + }; + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = OpenGLSolarSystem; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CEF317C9141C662400ADE1D0 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CEF317CA141C662400ADE1D0 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme new file mode 100644 index 0000000..400a004 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e123ef3 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + OpenGLSolarSystem.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/.DS_Store b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/.DS_Store new file mode 100644 index 0000000..700305f Binary files /dev/null and b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/.DS_Store differ diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..c1338c5 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h @@ -0,0 +1,15 @@ +// +// OpenGLSolarSystemAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLSolarSystemAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..5947682 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m @@ -0,0 +1,60 @@ +// +// OpenGLSolarSystemAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystemAppDelegate.h" + +@implementation OpenGLSolarSystemAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemViewController.h b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..fa251cd --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemViewController.h @@ -0,0 +1,22 @@ +// +// OpenGLSolarSystemViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "SolarSystemController.h" + +@interface OpenGLSolarSystemViewController : GLKViewController +{ + SolarSystemController *m_SolarSystem; +}; + +-(void)viewDidLoad; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)setClipping; + +@end diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemViewController.m b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..9529898 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/OpenGLSolarSystemViewController.m @@ -0,0 +1,86 @@ +// +// OpenGLSolarSystemViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "SolarSystem.h" +#import "OpenGLSolarSystemViewController.h" + +@interface OpenGLSolarSystemViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation OpenGLSolarSystemViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + m_SolarSystem=[[SolarSystemController alloc] init]; + + [EAGLContext setCurrentContext:self.context]; + + [self setClipping]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + glClearColor(0.0f,0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + [m_SolarSystem execute]; +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .1; + const float zFar = 1000; + const float fieldOfView = 50.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + aspectRatio=(float)frame.size.width/(float)frame.size.height; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (fieldOfView) / 2.0); + + glFrustumf(-size, size, -size /aspectRatio, size /aspectRatio, zNear, zFar); + glViewport(0, 0, frame.size.width, frame.size.height); + + glMatrixMode(GL_MODELVIEW); +} + + +@end diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/Planet.h b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/Planet.h new file mode 100644 index 0000000..570ce70 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/Planet.h @@ -0,0 +1,22 @@ +/**************************************************************************************** + * Planet.h : lifted from the iPhone Touchfighter exmaple code. Thanks! Apple! * + ****************************************************************************************/ +#import +#import + + +@interface Planet : NSObject +{ + +@private + GLfloat *m_VertexData; + GLubyte *m_ColorData; + + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; +} +- (bool)execute; +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash; + +@end diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/Planet.m b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/Planet.m new file mode 100644 index 0000000..cc9b9bd --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/Planet.m @@ -0,0 +1,144 @@ +/* + +===== IMPORTANT ===== + +===================== + +File: Planet.m : taken from the Touchfighter example +Abstract: Planet. + +Version: 2.0 + + +*/ + +#import "Planet.h" + +GLshort *_texData=NULL; + +@implementation Planet + +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash +{ + unsigned int colorIncrment=0; //1 + unsigned int blue=0; + unsigned int red=255; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; //2 + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + + //vertices + + GLfloat *vPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); //3 + + + //color data + + GLubyte *cPtr = m_ColorData= + (GLubyte*)malloc(sizeof(GLubyte) * 4 * ((m_Slices *2+2) * (m_Stacks))); //4 + + unsigned int phiIdx, thetaIdx; + + //latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) //5 + { + //starts at -1.57 goes up to +1.57 radians + + //the first circle + //6 + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0f/(float)( m_Stacks)) - 0.5f); + + //the next, or second one. + //7 + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0f/(float)( m_Stacks)) - 0.5f); + float cosPhi0 = cos(phi0); //8 + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + //longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) //9 + { + //Increment along the longitude circle each "slice." + + float theta = 2.0f*M_PI * ((float)thetaIdx) * (1.0f/(float)( m_Slices -1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + //We're generating a vertical pair of points, such + //as the first point of stack 0 and the first point of stack 1 + //above it. This is how TRIANGLE_STRIPS work, + //taking a set of 4 vertices and essentially drawing two triangles + //at a time. The first is v0-v1-v2 and the next is v2-v1-v3, and so on. + + + //Get x-y-z for the first vertex of stack. + + vPtr [0] = m_Scale*cosPhi0 * cosTheta; //10 + vPtr [1] = m_Scale*sinPhi0*m_Squash; + vPtr [2] = m_Scale*cosPhi0 * sinTheta; + + + //The same but for the vertex immediately above the previous one. + + vPtr [3] = m_Scale*cosPhi1 * cosTheta; + vPtr [4] = m_Scale*sinPhi1*m_Squash; + vPtr [5] = m_Scale* cosPhi1 * sinTheta; + + cPtr [0] = red; //11 + cPtr [1] = 0; + cPtr [2] = blue; + cPtr [4] = red; + cPtr [5] = 0; + cPtr [6] = blue; + cPtr [3] = cPtr[7] = 255; + + cPtr += 2*4; //12 + + vPtr += 2*3; + } + + blue+=colorIncrment; //13 + red-=colorIncrment; + } + } + + return self; +} + +/**************************************************************************************** + * execute : strips out any stuff that I don't need from execute, used for testing * + * the moon. Rotation is in radians. * + ****************************************************************************************/ +- (bool)execute +{ + glMatrixMode(GL_MODELVIEW); //1 + glEnable(GL_CULL_FACE); //2 + glCullFace(GL_BACK); //3 + + glEnableClientState(GL_VERTEX_ARRAY); //4 + glEnableClientState(GL_COLOR_ARRAY); //5 + + glVertexPointer(3, GL_FLOAT, 0, m_VertexData); //6 + + glColorPointer(4, GL_UNSIGNED_BYTE, 0, m_ColorData); //7 + glDrawArrays(GL_TRIANGLE_STRIP, 0, (m_Slices +1)*2*(m_Stacks-1)+2); //8 + + return true; +} + + +@end \ No newline at end of file diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystem.h b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystem.h new file mode 100644 index 0000000..1b3a58e --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystem.h @@ -0,0 +1,15 @@ +// +// SolarSystem.h +// OpenGLSolarSystem +// +// Created by mike on 9/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef OpenGLSolarSystem_Header_h +#define OpenGLSolarSystem_Header_h + +#import +#define SS_SUNLIGHT GL_LIGHT0 //GL uses GL_LIGHTx + +#endif diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystemController.h b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystemController.h new file mode 100644 index 0000000..a44a5d2 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystemController.h @@ -0,0 +1,21 @@ +// +// SolarSystemController.h +// OpenGLSolarSystem +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// +#import +#import +#import "Planet.h" + +@interface SolarSystemController : NSObject +{ + Planet *m_Earth; +} + +-(void)execute; +-(id)init; +-(void)initGeometry; + +@end diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystemController.m b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystemController.m new file mode 100644 index 0000000..fa7c6ab --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/SolarSystemController.m @@ -0,0 +1,39 @@ +// +// SolarSystemController.m +// OpenGLSolarSystem +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "SolarSystemController.h" + +@implementation SolarSystemController + +-(id)init +{ + [self initGeometry]; + + return self; +} + +-(void)initGeometry +{ + m_Earth=[[Planet alloc] init:10 slices:10 radius:1.0 squash:1.0]; +} + +-(void)execute +{ + static GLfloat angle=0; + + glLoadIdentity(); + glTranslatef(0.0, -0.0, -3.0f); + + glRotatef(angle,0.0,1.0,0.0); + + [m_Earth execute]; + + angle+=.5; +} + +@end diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/InfoPlist.strings b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..6fe7ae9 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..e300eb5 --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/main.m b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/main.m new file mode 100644 index 0000000..60754fa --- /dev/null +++ b/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "OpenGLSolarSystemAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([OpenGLSolarSystemAppDelegate class])); + } +} diff --git a/Chapter 4/.DS_Store b/Chapter 4/.DS_Store new file mode 100644 index 0000000..6b1c132 Binary files /dev/null and b/Chapter 4/.DS_Store differ diff --git a/Chapter 4/OpenGLSolarSystem - final version/.DS_Store b/Chapter 4/OpenGLSolarSystem - final version/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 4/OpenGLSolarSystem - final version/.DS_Store differ diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.pbxproj b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1470468 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.pbxproj @@ -0,0 +1,319 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */; }; + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */; }; + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */; }; + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */; }; + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE60A611141C652F000874FC /* InfoPlist.strings */; }; + CE60A616141C654B000874FC /* Planet.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A615141C654B000874FC /* Planet.m */; }; + CE96CD3A141C6671007DAAA7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD39141C6671007DAAA7 /* main.m */; }; + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenGLSolarSystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystem.h; path = OpenGLSolarSystem/OpenGLSolarSystem.h; sourceTree = SOURCE_ROOT; }; + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemAppDelegate.h; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h; sourceTree = SOURCE_ROOT; }; + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemAppDelegate.m; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m; sourceTree = SOURCE_ROOT; }; + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemViewController.h; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.h; sourceTree = SOURCE_ROOT; }; + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemViewController.m; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.m; sourceTree = SOURCE_ROOT; }; + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "OpenGLSolarSystem-Info.plist"; path = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; sourceTree = SOURCE_ROOT; }; + CE60A60C141C6520000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A60F141C6527000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A612141C652F000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = OpenGLSolarSystem/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + CE60A614141C653E000874FC /* Planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Planet.h; path = OpenGLSolarSystem/Planet.h; sourceTree = SOURCE_ROOT; }; + CE60A615141C654B000874FC /* Planet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Planet.m; path = OpenGLSolarSystem/Planet.m; sourceTree = SOURCE_ROOT; }; + CE96CD39141C6671007DAAA7 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = OpenGLSolarSystem/main.m; sourceTree = SOURCE_ROOT; }; + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemController.h; path = OpenGLSolarSystem/OpenGLSolarSystemController.h; sourceTree = SOURCE_ROOT; }; + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemController.m; path = OpenGLSolarSystem/OpenGLSolarSystemController.m; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXGroup; + children = ( + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */, + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */, + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */, + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */, + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */, + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */, + CE60A614141C653E000874FC /* Planet.h */, + CE60A615141C654B000874FC /* Planet.m */, + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */, + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */, + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = OpenGLSolarSystem; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE96CD39141C6671007DAAA7 /* main.m */, + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */, + CE60A611141C652F000874FC /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpenGLSolarSystem; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */, + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */, + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */, + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */, + CE60A616141C654B000874FC /* Planet.m in Sources */, + CE96CD3A141C6671007DAAA7 /* main.m in Sources */, + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60C141C6520000874FC /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60F141C6527000874FC /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CE60A611141C652F000874FC /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE60A612141C652F000874FC /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41c6fd1 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..efbe9ac Binary files /dev/null and b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/user.mode1v3 b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..cf456b3 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/user.mode1v3 @@ -0,0 +1,1363 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CEF317C6141C662400ADE1D0 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 404 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + CE269CD9141BF49D00704362 + CE269CDA141BF49D00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {404, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {421, 463}} + GroupTreeTableConfiguration + + MainColumn + 404 + + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXSmartGroupTreeModule + Proportion + 421pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {362, 277}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 277pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 282}, {362, 181}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + XCDetailModule + Proportion + 181pt + + + Proportion + 362pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CEF317C4141C662400ADE1D0 + 1CE0B1FE06471DED0097A5F4 + CEF317C5141C662400ADE1D0 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CEF317C7141C662400ADE1D0 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj + + WindowString + -1396 553 788 504 -1680 30 1680 1050 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CEF317C7141C662400ADE1D0 + CEF317C8141C662400ADE1D0 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + -1375 534 500 500 -1680 30 1680 1050 + WindowToolGUID + CEF317C7141C662400ADE1D0 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/user.pbxuser b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/user.pbxuser new file mode 100644 index 0000000..fa58c18 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */; + activeTarget = CE269CCA141BF49D00704362 /* OpenGLSolarSystem */; + codeSenseManager = CEF317CA141C662400ADE1D0 /* Code sense */; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 123, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337405452; + PBXWorkspaceStateSaveDate = 337405452; + }; + sourceControlManager = CEF317C9141C662400ADE1D0 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + activeExec = 0; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + }; + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = OpenGLSolarSystem; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CEF317C9141C662400ADE1D0 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CEF317CA141C662400ADE1D0 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme new file mode 100644 index 0000000..400a004 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e123ef3 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + OpenGLSolarSystem.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem.h b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem.h new file mode 100644 index 0000000..fa8742a --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystem.h @@ -0,0 +1,17 @@ +// +// OpenGLSolarSystem.h +// OpenGLSolarSystem +// +// Created by mike on 9/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef OpenGLSolarSystem_OpenGLSolarSystem_h +#define OpenGLSolarSystem_OpenGLSolarSystem_h + +#import +#define SS_SUNLIGHT GL_LIGHT0 //GL uses GL_LIGHTx +#define SS_FILLLIGHT1 GL_LIGHT1 +#define SS_FILLLIGHT2 GL_LIGHT2 + +#endif diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..c1338c5 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h @@ -0,0 +1,15 @@ +// +// OpenGLSolarSystemAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLSolarSystemAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..5947682 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m @@ -0,0 +1,60 @@ +// +// OpenGLSolarSystemAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystemAppDelegate.h" + +@implementation OpenGLSolarSystemAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemController.h b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemController.h new file mode 100644 index 0000000..c5f9bee --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemController.h @@ -0,0 +1,29 @@ +// +// OpenGLSolarSystemController.h +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// +#import +#import "Planet.h" + +#define X_VALUE 0 +#define Y_VALUE 1 +#define Z_VALUE 2 + + +@interface OpenGLSolarSystemController : NSObject +{ + Planet *m_Earth; + Planet *m_Sun; + GLfloat m_Eyeposition[3]; +} + +-(void)execute; +-(void)executePlanet:(Planet *)planet; +-(id)init; +-(void)initGeometry; + +@end + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemController.m b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemController.m new file mode 100644 index 0000000..c31b51d --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemController.m @@ -0,0 +1,87 @@ +// +// OpenGLSolarSystemController.m +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" + +@implementation OpenGLSolarSystemController + +-(id)init +{ + [self initGeometry]; + + return self; +} + +-(void)initGeometry +{ + m_Eyeposition[X_VALUE]=0.0; //1 + m_Eyeposition[Y_VALUE]=0.0; + m_Eyeposition[Z_VALUE]=5.0; + + m_Earth=[[Planet alloc] init:50 slices:50 radius:.3 squash:1.0]; //2 + [m_Earth setPositionX:0.0 Y:0.0 Z:-2.0]; //3 + + m_Sun=[[Planet alloc] init:50 slices:50 radius:1.0 squash:1.0]; //4 + [m_Sun setPositionX:0.0 Y:0.0 Z:0.0]; +} +-(void)execute +{ + GLfloat paleYellow[]={1.0,1.0,0.3,1.0}; //1 + GLfloat white[]={1.0,1.0,1.0,1.0}; + GLfloat cyan[]={0.0,1.0,1.0,1.0}; + GLfloat black[]={0.0,0.0,0.0,0.0}; //2 + static GLfloat angle=0.0; + GLfloat orbitalIncrement=1.25; //3 + GLfloat sunPos[4]={0.0,0.0,0.0,1.0}; + + glPushMatrix(); //4 + + glTranslatef(-m_Eyeposition[X_VALUE],-m_Eyeposition[Y_VALUE], //5 + -m_Eyeposition[Z_VALUE]); + + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); //6 + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cyan); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white); + + glPushMatrix(); //7 + + angle+=orbitalIncrement; //8 + + glRotatef(angle,0.0,1.0,0.0); //9 + + [self executePlanet:m_Earth]; //10 + + glPopMatrix(); //11 + + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, paleYellow); //12 + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, black); //13 + + [self executePlanet:m_Sun]; //14 + + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, black); //15 + + glPopMatrix(); //16 +} + +-(void)executePlanet:(Planet *)planet +{ + GLfloat posX, posY, posZ; + + glPushMatrix(); + + [planet getPositionX:&posX Y:&posY Z:&posZ]; //17 + + glTranslatef(posX,posY,posZ); //18 + + [planet execute]; //19 + + glPopMatrix(); +} + +@end diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemViewController.h b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..7a6e8c7 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemViewController.h @@ -0,0 +1,24 @@ +// +// OpenGLSolarSystemViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" + +@interface OpenGLSolarSystemViewController : GLKViewController +{ + OpenGLSolarSystemController *m_SolarSystem; + +}; + +-(void)viewDidLoad; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)setClipping; +-(void)initLighting; +@end diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemViewController.m b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..823931d --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/OpenGLSolarSystemViewController.m @@ -0,0 +1,139 @@ +// +// OpenGL_SolarSystemViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemViewController.h" + +@interface OpenGLSolarSystemViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation OpenGLSolarSystemViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [EAGLContext setCurrentContext:self.context]; + + + m_SolarSystem=[[OpenGLSolarSystemController alloc] init]; + + [self setClipping]; + + [self initLighting]; + +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + glEnable(GL_DEPTH_TEST); + + glClearColor(0.0f,0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + [m_SolarSystem execute]; +} + +-(void)initLighting +{ + GLfloat sunPos[]={0.0,0.0,0.0,1.0}; + GLfloat posFill1[]={-15.0,15.0,0.0,1.0}; + GLfloat posFill2[]={-10.0,-4.0,1.0,1.0}; + + GLfloat white[]={1.0,1.0,1.0,1.0}; + GLfloat dimblue[]={0.0,0.0,.2,1.0}; + + GLfloat cyan[]={0.0,1.0,1.0,1.0}; + GLfloat yellow[]={1.0,1.0,0.0,1.0}; + GLfloat dimmagenta[]={.75,0.0,.25,1.0}; + + GLfloat dimcyan[]={0.0,.5,.5,1.0}; + + //lights go here + + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); + glLightfv(SS_SUNLIGHT,GL_DIFFUSE,white); + glLightfv(SS_SUNLIGHT,GL_SPECULAR,yellow); + + glLightfv(SS_FILLLIGHT1,GL_POSITION,posFill1); + glLightfv(SS_FILLLIGHT1,GL_DIFFUSE,dimblue); + glLightfv(SS_FILLLIGHT1,GL_SPECULAR,dimcyan); + + glLightfv(SS_FILLLIGHT2,GL_POSITION,posFill2); + glLightfv(SS_FILLLIGHT2,GL_SPECULAR,dimmagenta); + glLightfv(SS_FILLLIGHT2,GL_DIFFUSE,dimblue); + + //materials go here + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cyan); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white); + + glLightf(SS_SUNLIGHT,GL_QUADRATIC_ATTENUATION,.001); + + glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,25); + + glShadeModel(GL_SMOOTH); + glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,0.0); + + glEnable(GL_LIGHTING); + glEnable(SS_SUNLIGHT); + glEnable(SS_FILLLIGHT1); + glEnable(SS_FILLLIGHT2); +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .1; + const float zFar = 1000; + const float fieldOfView = 60.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + aspectRatio=(float)frame.size.width/(float)frame.size.height; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (fieldOfView) / 2.0); + + glFrustumf(-size, size, -size /aspectRatio, size /aspectRatio, zNear, zFar); + glViewport(0, 0, frame.size.width, frame.size.height); + + glMatrixMode(GL_MODELVIEW); +} + + +@end diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/Planet.h b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/Planet.h new file mode 100644 index 0000000..f7fdb9b --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/Planet.h @@ -0,0 +1,33 @@ +/**************************************************************************************** + * Planet.h : lifted from the iPhone Touchfighter exmaple code. Thanks! Apple! * + ****************************************************************************************/ +#import +#import + + +@interface Planet : NSObject +{ + +@private + GLfloat *m_VertexData; + GLubyte *m_ColorData; + GLfloat *m_NormalData; + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; + GLfloat m_Angle; + GLfloat m_Pos[3]; + GLfloat m_RotationalIncrement; +} + +-(bool)execute; +-(id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z; +-(GLfloat)getRotation; +-(void)setRotation:(GLfloat)angle; +-(GLfloat)getRotationalIncrement; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; + +@end diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/Planet.m b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/Planet.m new file mode 100644 index 0000000..8cfe8d9 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/Planet.m @@ -0,0 +1,199 @@ +/* + +===== IMPORTANT ===== + +===================== + +File: Planet.m : taken from the Touchfighter example +Abstract: Planet. + +Version: 2.0 + + +*/ + +#import "Planet.h" + +GLshort *_texData=NULL; + +@implementation Planet + +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash +{ + unsigned int colorIncrment=0; + unsigned int blue=0; + unsigned int red=255; + int numVertices=0; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + + // Vertices + + GLfloat *vPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); + + // Color data + + GLubyte *cPtr = m_ColorData = + (GLubyte*)malloc(sizeof(GLubyte) * 4 * ((m_Slices*2+2) * (m_Stacks))); + + // Normal pointers for lighting + + GLfloat *nPtr = m_NormalData = //1 + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); + unsigned int phiIdx, thetaIdx; + + // Latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) + { + // Starts at -1.57 goes up to +1.57 radians + + // The first circle + + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0/(float)(m_Stacks)) - 0.5); + + // The next, or second one. + + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0/(float)(m_Stacks)) - 0.5); + float cosPhi0 = cos(phi0); + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + // Longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) + { + // Increment along the longitude circle each "slice" + + float theta = 2.0*M_PI * ((float)thetaIdx) * (1.0/(float)(m_Slices-1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + // We're generating a vertical pair of points, such + // as the first point of stack 0 and the first point of stack 1 + // above it. This is how TRIANGLE_STRIPS work, + // taking a set of 4 vertices and essentially drawing two triangles + // at a time. The first is v0-v1-v2 and the next is v2-v1-v3, etc. + + + // Get x-y-z for the first vertex of stack. + + vPtr[0] = m_Scale*cosPhi0 * cosTheta; + vPtr[1] = m_Scale*sinPhi0*m_Squash; + vPtr[2] = m_Scale*cosPhi0 * sinTheta; + + // The same but for the vertex immediately above the previous one + + vPtr[3] = m_Scale*cosPhi1 * cosTheta; + vPtr[4] = m_Scale*sinPhi1*m_Squash; + vPtr[5] = m_Scale* cosPhi1 * sinTheta; + + // Normal pointers for lighting + + nPtr[0] = cosPhi0 * cosTheta; //2 + nPtr[1] = sinPhi0; + nPtr[2] = cosPhi0 * sinTheta; + + nPtr[3] = cosPhi1 * cosTheta; //3 + nPtr[4] = sinPhi1; + nPtr[5] = cosPhi1 * sinTheta; + + cPtr[0] = red; + cPtr[1] = 0; + cPtr[2] = blue; + cPtr[4] = red; + cPtr[5] = 0; + cPtr[6] = blue; + cPtr[3] = cPtr[7] = 255; + + cPtr += 2*4; + vPtr += 2*3; + nPtr +=2*3; //4 + + } + + blue+=colorIncrment; + red-=colorIncrment; + } + + numVertices=(vPtr-m_VertexData)/6; + } + + return self; +} + +/**************************************************************************************** + * execute : strips out any stuff that I don't need from execute, used for testing * + * the moon. Rotation is in radians. * + ****************************************************************************************/ +- (bool)execute +{ + glMatrixMode(GL_MODELVIEW); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + glEnableClientState(GL_NORMAL_ARRAY); //1 + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + glVertexPointer(3, GL_FLOAT, 0, m_VertexData); + glNormalPointer(GL_FLOAT, 0, m_NormalData); //2 + + glColorPointer(4, GL_UNSIGNED_BYTE, 0, m_ColorData); + glDrawArrays(GL_TRIANGLE_STRIP, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + return true; +} + +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z +{ + *x=m_Pos[0]; + *y=m_Pos[1]; + *z=m_Pos[2]; +} + +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z +{ + m_Pos[0]=x; + m_Pos[1]=y; + m_Pos[2]=z; +} + +-(GLfloat)getRotation +{ + return m_Angle; +} + +-(void)setRotation:(GLfloat)angle +{ + m_Angle=angle; +} + +-(void)incrementRotation +{ + m_Angle+=m_RotationalIncrement; +} + +-(GLfloat)getRotationalIncrement +{ + return m_RotationalIncrement; +} + +-(void)setRotationalIncrement:(GLfloat)inc +{ + m_RotationalIncrement=inc; +} +@end \ No newline at end of file diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/InfoPlist.strings b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..6fe7ae9 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..d77a83e --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/main.m b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/main.m new file mode 100644 index 0000000..60754fa --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "OpenGLSolarSystemAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([OpenGLSolarSystemAppDelegate class])); + } +} diff --git a/Chapter 4/OpenGLSolarSystem - first light/.DS_Store b/Chapter 4/OpenGLSolarSystem - first light/.DS_Store new file mode 100644 index 0000000..edb5c5a Binary files /dev/null and b/Chapter 4/OpenGLSolarSystem - first light/.DS_Store differ diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.pbxproj b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1470468 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.pbxproj @@ -0,0 +1,319 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */; }; + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */; }; + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */; }; + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */; }; + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE60A611141C652F000874FC /* InfoPlist.strings */; }; + CE60A616141C654B000874FC /* Planet.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A615141C654B000874FC /* Planet.m */; }; + CE96CD3A141C6671007DAAA7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD39141C6671007DAAA7 /* main.m */; }; + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenGLSolarSystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystem.h; path = OpenGLSolarSystem/OpenGLSolarSystem.h; sourceTree = SOURCE_ROOT; }; + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemAppDelegate.h; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h; sourceTree = SOURCE_ROOT; }; + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemAppDelegate.m; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m; sourceTree = SOURCE_ROOT; }; + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemViewController.h; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.h; sourceTree = SOURCE_ROOT; }; + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemViewController.m; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.m; sourceTree = SOURCE_ROOT; }; + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "OpenGLSolarSystem-Info.plist"; path = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; sourceTree = SOURCE_ROOT; }; + CE60A60C141C6520000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A60F141C6527000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A612141C652F000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = OpenGLSolarSystem/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + CE60A614141C653E000874FC /* Planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Planet.h; path = OpenGLSolarSystem/Planet.h; sourceTree = SOURCE_ROOT; }; + CE60A615141C654B000874FC /* Planet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Planet.m; path = OpenGLSolarSystem/Planet.m; sourceTree = SOURCE_ROOT; }; + CE96CD39141C6671007DAAA7 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = OpenGLSolarSystem/main.m; sourceTree = SOURCE_ROOT; }; + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemController.h; path = OpenGLSolarSystem/OpenGLSolarSystemController.h; sourceTree = SOURCE_ROOT; }; + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemController.m; path = OpenGLSolarSystem/OpenGLSolarSystemController.m; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXGroup; + children = ( + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */, + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */, + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */, + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */, + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */, + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */, + CE60A614141C653E000874FC /* Planet.h */, + CE60A615141C654B000874FC /* Planet.m */, + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */, + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */, + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = OpenGLSolarSystem; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE96CD39141C6671007DAAA7 /* main.m */, + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */, + CE60A611141C652F000874FC /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpenGLSolarSystem; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */, + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */, + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */, + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */, + CE60A616141C654B000874FC /* Planet.m in Sources */, + CE96CD3A141C6671007DAAA7 /* main.m in Sources */, + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60C141C6520000874FC /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60F141C6527000874FC /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CE60A611141C652F000874FC /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE60A612141C652F000874FC /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41c6fd1 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..8118399 Binary files /dev/null and b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/user.mode1v3 b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..cf456b3 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/user.mode1v3 @@ -0,0 +1,1363 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CEF317C6141C662400ADE1D0 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 404 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + CE269CD9141BF49D00704362 + CE269CDA141BF49D00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {404, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {421, 463}} + GroupTreeTableConfiguration + + MainColumn + 404 + + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXSmartGroupTreeModule + Proportion + 421pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {362, 277}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 277pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 282}, {362, 181}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + XCDetailModule + Proportion + 181pt + + + Proportion + 362pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CEF317C4141C662400ADE1D0 + 1CE0B1FE06471DED0097A5F4 + CEF317C5141C662400ADE1D0 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CEF317C7141C662400ADE1D0 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj + + WindowString + -1396 553 788 504 -1680 30 1680 1050 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CEF317C7141C662400ADE1D0 + CEF317C8141C662400ADE1D0 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + -1375 534 500 500 -1680 30 1680 1050 + WindowToolGUID + CEF317C7141C662400ADE1D0 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/user.pbxuser b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/user.pbxuser new file mode 100644 index 0000000..fa58c18 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */; + activeTarget = CE269CCA141BF49D00704362 /* OpenGLSolarSystem */; + codeSenseManager = CEF317CA141C662400ADE1D0 /* Code sense */; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 123, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337405452; + PBXWorkspaceStateSaveDate = 337405452; + }; + sourceControlManager = CEF317C9141C662400ADE1D0 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + activeExec = 0; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + }; + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = OpenGLSolarSystem; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CEF317C9141C662400ADE1D0 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CEF317CA141C662400ADE1D0 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..0f6eb20 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,49 @@ + + + + + + + + + + + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme new file mode 100644 index 0000000..400a004 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e123ef3 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + OpenGLSolarSystem.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem.h b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem.h new file mode 100644 index 0000000..adc9cb6 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystem.h @@ -0,0 +1,15 @@ +// +// OpenGLSolarSystem.h +// OpenGLSolarSystem +// +// Created by mike on 9/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef OpenGLSolarSystem_OpenGLSolarSystem_h +#define OpenGLSolarSystem_OpenGLSolarSystem_h + +#import +#define SS_SUNLIGHT GL_LIGHT0 //GL uses GL_LIGHTx + +#endif diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..c1338c5 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h @@ -0,0 +1,15 @@ +// +// OpenGLSolarSystemAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLSolarSystemAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..5947682 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m @@ -0,0 +1,60 @@ +// +// OpenGLSolarSystemAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystemAppDelegate.h" + +@implementation OpenGLSolarSystemAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemController.h b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemController.h new file mode 100644 index 0000000..431c714 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemController.h @@ -0,0 +1,22 @@ +// +// OpenGLSolarSystemController.h +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// +#import +#import +#import "Planet.h" + +@interface OpenGLSolarSystemController : NSObject +{ + Planet *m_Earth; +} + +-(void)execute; +-(id)init; +-(void)initGeometry; + +@end + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemController.m b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemController.m new file mode 100644 index 0000000..e8bf288 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemController.m @@ -0,0 +1,40 @@ +// +// OpenGLSolarSystemController.m +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystemController.h" + +@implementation OpenGLSolarSystemController + +-(id)init +{ + [self initGeometry]; + + return self; +} + +-(void)initGeometry +{ + m_Earth=[[Planet alloc] init:10 slices:10 radius:1.0 squash:1.0]; +} + +-(void)execute +{ + static GLfloat angle=0; + + glLoadIdentity(); + glTranslatef(0.0, -0.0, -3.0f); + + glRotatef(angle,0.0,1.0,0.0); + + [m_Earth execute]; + + angle+=.5; +} + + +@end diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemViewController.h b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..2e357db --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemViewController.h @@ -0,0 +1,23 @@ +// +// OpenGLSolarSystemViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "OpenGLSolarSystemController.h" + +@interface OpenGLSolarSystemViewController : GLKViewController +{ + OpenGLSolarSystemController *m_SolarSystem; + +}; + +-(void)viewDidLoad; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)setClipping; +-(void)initLighting; +@end diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemViewController.m b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..9788be3 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/OpenGLSolarSystemViewController.m @@ -0,0 +1,103 @@ +// +// OpenGL_SolarSystemViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemViewController.h" + +@interface OpenGLSolarSystemViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation OpenGLSolarSystemViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + m_SolarSystem=[[OpenGLSolarSystemController alloc] init]; + + [EAGLContext setCurrentContext:self.context]; + + [self initLighting]; + [self setClipping]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + glClearColor(0.0f,0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + [m_SolarSystem execute]; +} + +-(void)initLighting +{ + + + GLfloat diffuse[]={0.0,1.0,0.0,1.0}; //1 + GLfloat pos[]={0.0,10.0,0.0,1.0}; //2 + + glLightfv(SS_SUNLIGHT,GL_POSITION,pos); //3 + glLightfv(SS_SUNLIGHT,GL_DIFFUSE,diffuse); //4 + + glShadeModel(GL_FLAT); //5 + + glEnable(GL_LIGHTING); //6 + glEnable(SS_SUNLIGHT); //7 +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .1; + const float zFar = 1000; + const float fieldOfView = 60.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + aspectRatio=(float)frame.size.width/(float)frame.size.height; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (fieldOfView) / 2.0); + + glFrustumf(-size, size, -size /aspectRatio, size /aspectRatio, zNear, zFar); + glViewport(0, 0, frame.size.width, frame.size.height); + + glMatrixMode(GL_MODELVIEW); +} + + +@end diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/Planet.h b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/Planet.h new file mode 100644 index 0000000..ab9125c --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/Planet.h @@ -0,0 +1,24 @@ +/**************************************************************************************** + * Planet.h : lifted from the iPhone Touchfighter exmaple code. Thanks! Apple! * + ****************************************************************************************/ +#import +#import + + +@interface Planet : NSObject +{ + +@private + GLfloat *m_VertexData; + GLubyte *m_ColorData; + GLfloat *m_NormalData; + + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; + +} +- (bool)execute; +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash; + +@end diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/Planet.m b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/Planet.m new file mode 100644 index 0000000..695eb23 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/Planet.m @@ -0,0 +1,162 @@ +/* + +===== IMPORTANT ===== + +===================== + +File: Planet.m : taken from the Touchfighter example +Abstract: Planet. + +Version: 2.0 + + +*/ + +#import "Planet.h" + +GLshort *_texData=NULL; + +@implementation Planet + +- (id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat) squash +{ + unsigned int colorIncrment=0; + unsigned int blue=0; + unsigned int red=255; + int numVertices=0; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + + // Vertices + + GLfloat *vPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); + + // Color data + + GLubyte *cPtr = m_ColorData = + (GLubyte*)malloc(sizeof(GLubyte) * 4 * ((m_Slices*2+2) * (m_Stacks))); + + // Normal pointers for lighting + + GLfloat *nPtr = m_NormalData = //1 + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); + unsigned int phiIdx, thetaIdx; + + // Latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) + { + // Starts at -1.57 goes up to +1.57 radians + + // The first circle + + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0/(float)(m_Stacks)) - 0.5); + + // The next, or second one. + + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0/(float)(m_Stacks)) - 0.5); + float cosPhi0 = cos(phi0); + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + // Longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) + { + // Increment along the longitude circle each "slice" + + float theta = 2.0*M_PI * ((float)thetaIdx) * (1.0/(float)(m_Slices-1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + // We're generating a vertical pair of points, such + // as the first point of stack 0 and the first point of stack 1 + // above it. This is how TRIANGLE_STRIPS work, + // taking a set of 4 vertices and essentially drawing two triangles + // at a time. The first is v0-v1-v2 and the next is v2-v1-v3, etc. + + + // Get x-y-z for the first vertex of stack. + + vPtr[0] = m_Scale*cosPhi0 * cosTheta; + vPtr[1] = m_Scale*sinPhi0*m_Squash; + vPtr[2] = m_Scale*cosPhi0 * sinTheta; + + // The same but for the vertex immediately above the previous one + + vPtr[3] = m_Scale*cosPhi1 * cosTheta; + vPtr[4] = m_Scale*sinPhi1*m_Squash; + vPtr[5] = m_Scale* cosPhi1 * sinTheta; + + // Normal pointers for lighting + + nPtr[0] = cosPhi0 * cosTheta; //2 + nPtr[1] = sinPhi0; + nPtr[2] = cosPhi0 * sinTheta; + + nPtr[3] = cosPhi1 * cosTheta; //3 + nPtr[4] = sinPhi1; + nPtr[5] = cosPhi1 * sinTheta; + + cPtr[0] = red; + cPtr[1] = 0; + cPtr[2] = blue; + cPtr[4] = red; + cPtr[5] = 0; + cPtr[6] = blue; + cPtr[3] = cPtr[7] = 255; + + cPtr += 2*4; + vPtr += 2*3; + nPtr +=2*3; //4 + + } + + blue+=colorIncrment; + red-=colorIncrment; + } + + numVertices=(vPtr-m_VertexData)/6; + } + + return self; +} + +/**************************************************************************************** + * execute : strips out any stuff that I don't need from execute, used for testing * + * the moon. Rotation is in radians. * + ****************************************************************************************/ +- (bool)execute +{ + glMatrixMode(GL_MODELVIEW); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + glEnableClientState(GL_NORMAL_ARRAY); //1 + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + glVertexPointer(3, GL_FLOAT, 0, m_VertexData); + glNormalPointer(GL_FLOAT, 0, m_NormalData); //2 + + glColorPointer(4, GL_UNSIGNED_BYTE, 0, m_ColorData); + glDrawArrays(GL_TRIANGLE_STRIP, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + return true; +} + + +@end \ No newline at end of file diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/InfoPlist.strings b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..6fe7ae9 --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..d77a83e --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/main.m b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/main.m new file mode 100644 index 0000000..60754fa --- /dev/null +++ b/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "OpenGLSolarSystemAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([OpenGLSolarSystemAppDelegate class])); + } +} diff --git a/Chapter 6/.DS_Store b/Chapter 6/.DS_Store new file mode 100644 index 0000000..af3df53 Binary files /dev/null and b/Chapter 6/.DS_Store differ diff --git a/Chapter 6/Bumpmapping/.DS_Store b/Chapter 6/Bumpmapping/.DS_Store new file mode 100644 index 0000000..9d2584d Binary files /dev/null and b/Chapter 6/Bumpmapping/.DS_Store differ diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.pbxproj b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8e3b426 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.pbxproj @@ -0,0 +1,330 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE12758B142056DF00664BE3 /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CE12758A142056DF00664BE3 /* hedly.png */; }; + CE12758E142056EC00664BE3 /* ggate_bridge.256.png in Resources */ = {isa = PBXBuildFile; fileRef = CE12758D142056EC00664BE3 /* ggate_bridge.256.png */; }; + CE1275901420821D00664BE3 /* rgb_splats.256.color.png in Resources */ = {isa = PBXBuildFile; fileRef = CE12758F1420821D00664BE3 /* rgb_splats.256.color.png */; }; + CE1275941420853400664BE3 /* rgb_splats_masked.256.color.png in Resources */ = {isa = PBXBuildFile; fileRef = CE1275931420853400664BE3 /* rgb_splats_masked.256.color.png */; }; + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */; }; + CE269CE7141BF49D00704362 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE269CE5141BF49D00704362 /* MainStoryboard_iPhone.storyboard */; }; + CE269CEA141BF49D00704362 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE269CE8141BF49D00704362 /* MainStoryboard_iPad.storyboard */; }; + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncySquareViewController.m */; }; + CEB161C114208F610031B034 /* usa_normal_really_hc.png in Resources */ = {isa = PBXBuildFile; fileRef = CEB161BF14208F610031B034 /* usa_normal_really_hc.png */; }; + CEB161C214208F610031B034 /* usa_texture.png in Resources */ = {isa = PBXBuildFile; fileRef = CEB161C014208F610031B034 /* usa_texture.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE12758A142056DF00664BE3 /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; + CE12758D142056EC00664BE3 /* ggate_bridge.256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ggate_bridge.256.png; path = assets/ggate_bridge.256.png; sourceTree = ""; }; + CE12758F1420821D00664BE3 /* rgb_splats.256.color.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = rgb_splats.256.color.png; path = assets/rgb_splats.256.color.png; sourceTree = ""; }; + CE1275931420853400664BE3 /* rgb_splats_masked.256.color.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = rgb_splats_masked.256.color.png; path = assets/rgb_splats_masked.256.color.png; sourceTree = ""; }; + CE269CCB141BF49D00704362 /* BouncySquare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncySquare.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BouncySquare-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BouncySquare-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareAppDelegate.m; sourceTree = ""; }; + CE269CE6141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + CE269CE9141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareViewController.m; sourceTree = ""; }; + CEB161BF14208F610031B034 /* usa_normal_really_hc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = usa_normal_really_hc.png; path = assets/usa_normal_really_hc.png; sourceTree = ""; }; + CEB161C014208F610031B034 /* usa_texture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = usa_texture.png; path = assets/usa_texture.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncySquare */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncySquare.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncySquare */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */, + CE269CE5141BF49D00704362 /* MainStoryboard_iPhone.storyboard */, + CE269CE8141BF49D00704362 /* MainStoryboard_iPad.storyboard */, + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */, + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CEB161BF14208F610031B034 /* usa_normal_really_hc.png */, + CEB161C014208F610031B034 /* usa_texture.png */, + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */, + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */, + CE12758D142056EC00664BE3 /* ggate_bridge.256.png */, + CE12758A142056DF00664BE3 /* hedly.png */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE12758F1420821D00664BE3 /* rgb_splats.256.color.png */, + CE1275931420853400664BE3 /* rgb_splats_masked.256.color.png */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncySquare */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncySquare; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncySquare.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncySquare */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CE269CE7141BF49D00704362 /* MainStoryboard_iPhone.storyboard in Resources */, + CE269CEA141BF49D00704362 /* MainStoryboard_iPad.storyboard in Resources */, + CE12758B142056DF00664BE3 /* hedly.png in Resources */, + CE12758E142056EC00664BE3 /* ggate_bridge.256.png in Resources */, + CE1275901420821D00664BE3 /* rgb_splats.256.color.png in Resources */, + CE1275941420853400664BE3 /* rgb_splats_masked.256.color.png in Resources */, + CEB161C114208F610031B034 /* usa_normal_really_hc.png in Resources */, + CEB161C214208F610031B034 /* usa_texture.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CE269CE5141BF49D00704362 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE269CE6141BF49D00704362 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE269CE8141BF49D00704362 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE269CE9141BF49D00704362 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..66783b2 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..02c582b Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/user.mode1v3 b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..a6964c3 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/user.mode1v3 @@ -0,0 +1,1361 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CE89B38D14208DC5004D9E09 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 463}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 566 428 788 504 0 0 1920 1058 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {580, 277}} + RubberWindowFrame + 566 428 788 504 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 277pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 282}, {580, 181}} + RubberWindowFrame + 566 428 788 504 0 0 1920 1058 + + Module + XCDetailModule + Proportion + 181pt + + + Proportion + 580pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CE89B38B14208DC5004D9E09 + 1CE0B1FE06471DED0097A5F4 + CE89B38C14208DC5004D9E09 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CE89B38E14208DC5004D9E09 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 6/BouncyBlendingSquare/BouncySquare.xcodeproj + + WindowString + 566 428 788 504 0 0 1920 1058 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + 587 409 500 500 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + 587 409 500 500 0 0 1920 1058 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CE89B38E14208DC5004D9E09 + CE89B38F14208DC5004D9E09 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 587 409 500 500 0 0 1920 1058 + WindowToolGUID + CE89B38E14208DC5004D9E09 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/user.pbxuser b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/user.pbxuser new file mode 100644 index 0000000..fb2c8cc --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CE89B37A14208DBA004D9E09 /* BouncySquare */; + activeTarget = CE269CCA141BF49D00704362 /* BouncySquare */; + codeSenseManager = CE89B39114208DC5004D9E09 /* Code sense */; + executables = ( + CE89B37A14208DBA004D9E09 /* BouncySquare */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 341, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337677754; + PBXWorkspaceStateSaveDate = 337677754; + }; + sourceControlManager = CE89B39014208DC5004D9E09 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* BouncySquare */ = { + activeExec = 0; + executables = ( + CE89B37A14208DBA004D9E09 /* BouncySquare */, + ); + }; + CE89B37A14208DBA004D9E09 /* BouncySquare */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = BouncySquare; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CE89B39014208DC5004D9E09 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CE89B39114208DC5004D9E09 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..7d7bcad --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 6/Bumpmapping/BouncySquare/.DS_Store b/Chapter 6/Bumpmapping/BouncySquare/.DS_Store new file mode 100644 index 0000000..9684d26 Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/.DS_Store differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/BouncySquare-Info.plist b/Chapter 6/Bumpmapping/BouncySquare/BouncySquare-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/BouncySquare-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 6/Bumpmapping/BouncySquare/BouncySquare-Prefix.pch b/Chapter 6/Bumpmapping/BouncySquare/BouncySquare-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/BouncySquare-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 6/Bumpmapping/BouncySquare/BouncySquareAppDelegate.h b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareAppDelegate.h new file mode 100644 index 0000000..a208c69 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncySquareAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncySquareAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 6/Bumpmapping/BouncySquare/BouncySquareAppDelegate.m b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareAppDelegate.m new file mode 100644 index 0000000..983b5e5 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncySquareAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareAppDelegate.h" + +@implementation BouncySquareAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 6/Bumpmapping/BouncySquare/BouncySquareViewController.h b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareViewController.h new file mode 100644 index 0000000..6293e56 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareViewController.h @@ -0,0 +1,22 @@ +// +// BouncySquareViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncySquareViewController : GLKViewController +{ + GLKTextureInfo *m_Texture0; + GLKTextureInfo *m_Texture1; +} + +-(void)setClipping; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +-(void)multiTexture:(GLuint)tex0 tex1:(GLuint)tex1; +-(void)multiTextureBumpMap:(GLuint)tex0 tex1:(GLuint)tex1; +@end diff --git a/Chapter 6/Bumpmapping/BouncySquare/BouncySquareViewController.m b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareViewController.m new file mode 100644 index 0000000..3e8d1e2 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/BouncySquareViewController.m @@ -0,0 +1,225 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareViewController.h" + +@interface BouncySquareViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncySquareViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [EAGLContext setCurrentContext:self.context]; + [self setClipping]; + + m_Texture0=[self loadTexture:@"usa_normal_really_hc.png"]; + m_Texture1=[self loadTexture:@"usa_texture.png"]; +} + +#pragma mark - GLKView and GLKViewController delegate methods +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = + { + -0.5, -0.5, 0.0, + 0.5, -0.5, 0.0, + -0.5, 0.5, 0.0, + 0.5, 0.5, 0.0 + }; + + static GLfloat textureCoords[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + static GLfloat textureCoords2[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + static float transY = 0.0; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + [self setClipping]; + + glClearColor(0.0, 0.0,0.0, 1.0); + + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //Set up for using textures. + + glEnable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glClientActiveTexture(GL_TEXTURE0); //1 + glTexCoordPointer(2, GL_FLOAT,0,textureCoords); + + glClientActiveTexture(GL_TEXTURE1); //2 + glTexCoordPointer(2, GL_FLOAT,0,textureCoords2); + + glLoadIdentity(); + glTranslatef(0.0, (GLfloat)(sinf(transY)/2.0), -2.5); + + [self multiTextureBumpMap:m_Texture0.name tex1:m_Texture1.name]; + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + // transY += 0.075f; +} +-(void)multiTexture:(GLuint)tex0 tex1:(GLuint)tex1 +{ + GLfloat combineParameter=GL_DECAL; //1 + + // Set up the First Texture. + + glActiveTexture(GL_TEXTURE0); //2 + glBindTexture(GL_TEXTURE_2D, tex0); //3 + + // Set up the Second Texture. + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, tex1); + + // Set the texture environment mode for this texture to combine. + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, combineParameter); //4 +} + +-(void)multiTextureBumpMap:(GLuint)tex0 tex1:(GLuint)tex1 +{ + GLfloat x,y,z; + static float lightAngle=0.0; + + lightAngle+=1.0; //1 + + if(lightAngle>180) + lightAngle=0; + + // Set up the light vector. + + x = sin(lightAngle * (3.14159 / 180.0)); //2 + y = 0.0; + z = cos(lightAngle * (3.14159 / 180.0)); + + // Half shifting to have a value between 0.0 and 1.0. + + x = x * 0.5 + 0.5; //3 + y = y * 0.5 + 0.5; + z = z * 0.5 + 0.5; + + glColor4f(x, y, z, 1.0); //4 + + //The color and normal map are combined. + + glActiveTexture(GL_TEXTURE0); //5 + glBindTexture(GL_TEXTURE_2D, tex0); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); //6 + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB); //7 + glTexEnvf(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE); //8 + glTexEnvf(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS); //9 + + // Set up the Second Texture, and combine it with the result of the Dot3 combination. + + glActiveTexture(GL_TEXTURE1); //10 + glBindTexture(GL_TEXTURE_2D, tex1); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); //11 + +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .01; + const float zFar = 100; + const float fieldOfView =30.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + //h/w clamps the fov to the height; flipping it would make it relative to the width. + + aspectRatio=(float)frame.size.height/(float)frame.size.width; + + //Set the OpenGL projection matrix. + + glMatrixMode(GL_PROJECTION); + + size = zNear * tanf((fieldOfView/57.3)/ 2.0); + + glFrustumf(-size, size, -size *aspectRatio, + size *aspectRatio, zNear, zFar); + + glViewport(0, 0, frame.size.width, frame.size.height); + + //Make the OpenGL modelview matrix the default. + + glMatrixMode(GL_MODELVIEW); +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} +@end diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/earth_normal_hc_square_thumb.png b/Chapter 6/Bumpmapping/BouncySquare/assets/earth_normal_hc_square_thumb.png new file mode 100644 index 0000000..9bf8440 Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/earth_normal_hc_square_thumb.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/earth_texture_square.png b/Chapter 6/Bumpmapping/BouncySquare/assets/earth_texture_square.png new file mode 100644 index 0000000..9f88f14 Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/earth_texture_square.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/ggate_bridge.256.png b/Chapter 6/Bumpmapping/BouncySquare/assets/ggate_bridge.256.png new file mode 100644 index 0000000..d6fa2c2 Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/ggate_bridge.256.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/hedly.png b/Chapter 6/Bumpmapping/BouncySquare/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/hedly.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/rgb_splats.256.color.png b/Chapter 6/Bumpmapping/BouncySquare/assets/rgb_splats.256.color.png new file mode 100644 index 0000000..898c27e Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/rgb_splats.256.color.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/rgb_splats_masked.256.color.png b/Chapter 6/Bumpmapping/BouncySquare/assets/rgb_splats_masked.256.color.png new file mode 100644 index 0000000..5b35ab0 Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/rgb_splats_masked.256.color.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/usa_normal_really_hc.png b/Chapter 6/Bumpmapping/BouncySquare/assets/usa_normal_really_hc.png new file mode 100644 index 0000000..838e8bc Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/usa_normal_really_hc.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/assets/usa_texture.png b/Chapter 6/Bumpmapping/BouncySquare/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/Chapter 6/Bumpmapping/BouncySquare/assets/usa_texture.png differ diff --git a/Chapter 6/Bumpmapping/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 6/Bumpmapping/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 6/Bumpmapping/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 6/Bumpmapping/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1164b96 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/Bumpmapping/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 6/Bumpmapping/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..47e1785 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/Bumpmapping/BouncySquare/main.m b/Chapter 6/Bumpmapping/BouncySquare/main.m new file mode 100644 index 0000000..d3e3439 --- /dev/null +++ b/Chapter 6/Bumpmapping/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncySquareAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncySquareAppDelegate class])); + } +} diff --git a/Chapter 6/MultiTextureAnimation/.DS_Store b/Chapter 6/MultiTextureAnimation/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/.DS_Store differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.pbxproj b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.pbxproj new file mode 100644 index 0000000..20af4a0 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.pbxproj @@ -0,0 +1,318 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncySquareViewController.m */; }; + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */; }; + CEFD49911440CD3F00CEB597 /* ggate_bridge.256.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */; }; + CEFD49921440CD3F00CEB597 /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD49901440CD3E00CEB597 /* hedly.png */; }; + CEFD49A01440CF8700CEB597 /* rgb_splats.256.color.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD499F1440CF8700CEB597 /* rgb_splats.256.color.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* BouncySquare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncySquare.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BouncySquare-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BouncySquare-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareViewController.m; sourceTree = ""; }; + CEFD4907144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD4909144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ggate_bridge.256.png; path = assets/ggate_bridge.256.png; sourceTree = ""; }; + CEFD49901440CD3E00CEB597 /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; + CEFD499F1440CF8700CEB597 /* rgb_splats.256.color.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = rgb_splats.256.color.png; path = assets/rgb_splats.256.color.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncySquare */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncySquare.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncySquare */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */, + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */, + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CEFD499F1440CF8700CEB597 /* rgb_splats.256.color.png */, + CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */, + CEFD49901440CD3E00CEB597 /* hedly.png */, + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncySquare */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncySquare; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncySquare.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncySquare */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + CEFD49911440CD3F00CEB597 /* ggate_bridge.256.png in Resources */, + CEFD49921440CD3F00CEB597 /* hedly.png in Resources */, + CEFD49A01440CF8700CEB597 /* rgb_splats.256.color.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4907144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4909144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..66783b2 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c82caa7 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..fe38545 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/.DS_Store b/Chapter 6/MultiTextureAnimation/BouncySquare/.DS_Store new file mode 100644 index 0000000..ceceb31 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/.DS_Store differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquare-Info.plist b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquare-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquare-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquare-Prefix.pch b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquare-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquare-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareAppDelegate.h b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareAppDelegate.h new file mode 100644 index 0000000..a208c69 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncySquareAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncySquareAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareAppDelegate.m b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareAppDelegate.m new file mode 100644 index 0000000..983b5e5 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncySquareAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareAppDelegate.h" + +@implementation BouncySquareAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareViewController.h b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareViewController.h new file mode 100644 index 0000000..7f76851 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareViewController.h @@ -0,0 +1,23 @@ +// +// BouncySquareViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncySquareViewController : GLKViewController +{ + GLKTextureInfo *m_Texture0; + GLKTextureInfo *m_Texture1; +} + +-(void)setClipping; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)multiTexture:(GLuint)tex0 tex1:(GLuint)tex1; + +@end diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareViewController.m b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareViewController.m new file mode 100644 index 0000000..7ed84f7 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/BouncySquareViewController.m @@ -0,0 +1,191 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareViewController.h" + +@interface BouncySquareViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncySquareViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + [EAGLContext setCurrentContext:self.context]; + + [self setClipping]; + + [EAGLContext setCurrentContext:self.context]; + m_Texture0=[self loadTexture:@"hedly.png"]; + m_Texture1=[self loadTexture:@"rgb_splats.256.color.png"]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = + { + -0.5, -0.5, 0.0, + 0.5, -0.5, 0.0, + -0.5, 0.5, 0.0, + 0.5, 0.5, 0.0 + }; + + static GLfloat textureCoords1[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + static GLfloat textureCoords2[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + int i=0; + + static float transY = 0.0; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + [self setClipping]; + + glClearColor(0.0, 0.0,0.0, 1.0); + + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //Set up for using textures. + + glEnable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glClientActiveTexture(GL_TEXTURE0); //1 + glTexCoordPointer(2, GL_FLOAT,0,textureCoords1); + + glClientActiveTexture(GL_TEXTURE1); //2 + glTexCoordPointer(2, GL_FLOAT,0,textureCoords2); + + glLoadIdentity(); + glTranslatef(0.0, (GLfloat)(sinf(transY)/2.0), -2.5); + + [self multiTexture:m_Texture0.name tex1:m_Texture1.name]; + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + for(i=0;i<8;i++) + { + textureCoords2[i]+=.01; + } + + transY += 0.075f; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +-(void)multiTexture:(GLuint)tex0 tex1:(GLuint)tex1 +{ + GLfloat combineParameter=GL_MODULATE; //1 + + // Set up the First Texture. + + glActiveTexture(GL_TEXTURE0); //2 + glBindTexture(GL_TEXTURE_2D, tex0); //3 + + // Set up the Second Texture. + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, tex1); + + // Set the texture environment mode for this texture to combine. + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, combineParameter); //4 +} + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .01; + const float zFar = 100; + const float fieldOfView =30.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + //h/w clamps the fov to the height; flipping it would make it relative to the width. + + aspectRatio=(float)frame.size.height/(float)frame.size.width; + + //Set the OpenGL projection matrix. + + glMatrixMode(GL_PROJECTION); + + size = zNear * tanf((fieldOfView/57.3)/ 2.0); + + glFrustumf(-size, size, -size *aspectRatio, + size *aspectRatio, zNear, zFar); + + glViewport(0, 0, frame.size.width, frame.size.height); + + //Make the OpenGL modelview matrix the default. + + glMatrixMode(GL_MODELVIEW); +} + +@end diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/earth_normal_hc_square_thumb.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/earth_normal_hc_square_thumb.png new file mode 100644 index 0000000..9bf8440 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/earth_normal_hc_square_thumb.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/earth_texture_square.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/earth_texture_square.png new file mode 100644 index 0000000..9f88f14 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/earth_texture_square.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/ggate_bridge.256.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/ggate_bridge.256.png new file mode 100644 index 0000000..d6fa2c2 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/ggate_bridge.256.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/hedly.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/hedly.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/rgb_splats.256.color.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/rgb_splats.256.color.png new file mode 100644 index 0000000..898c27e Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/rgb_splats.256.color.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/rgb_splats_masked.256.color.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/rgb_splats_masked.256.color.png new file mode 100644 index 0000000..5b35ab0 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/rgb_splats_masked.256.color.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/usa_normal_really_hc.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/usa_normal_really_hc.png new file mode 100644 index 0000000..838e8bc Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/usa_normal_really_hc.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/assets/usa_texture.png b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/Chapter 6/MultiTextureAnimation/BouncySquare/assets/usa_texture.png differ diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1164b96 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..47e1785 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/MultiTextureAnimation/BouncySquare/main.m b/Chapter 6/MultiTextureAnimation/BouncySquare/main.m new file mode 100644 index 0000000..d3e3439 --- /dev/null +++ b/Chapter 6/MultiTextureAnimation/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncySquareAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncySquareAppDelegate class])); + } +} diff --git a/Chapter 6/MultiTextureCombining/.DS_Store b/Chapter 6/MultiTextureCombining/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/.DS_Store differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.pbxproj b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.pbxproj new file mode 100644 index 0000000..20af4a0 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.pbxproj @@ -0,0 +1,318 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncySquareViewController.m */; }; + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */; }; + CEFD49911440CD3F00CEB597 /* ggate_bridge.256.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */; }; + CEFD49921440CD3F00CEB597 /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD49901440CD3E00CEB597 /* hedly.png */; }; + CEFD49A01440CF8700CEB597 /* rgb_splats.256.color.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD499F1440CF8700CEB597 /* rgb_splats.256.color.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* BouncySquare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncySquare.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BouncySquare-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BouncySquare-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareViewController.m; sourceTree = ""; }; + CEFD4907144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD4909144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ggate_bridge.256.png; path = assets/ggate_bridge.256.png; sourceTree = ""; }; + CEFD49901440CD3E00CEB597 /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; + CEFD499F1440CF8700CEB597 /* rgb_splats.256.color.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = rgb_splats.256.color.png; path = assets/rgb_splats.256.color.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncySquare */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncySquare.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncySquare */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */, + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */, + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CEFD499F1440CF8700CEB597 /* rgb_splats.256.color.png */, + CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */, + CEFD49901440CD3E00CEB597 /* hedly.png */, + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncySquare */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncySquare; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncySquare.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncySquare */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + CEFD49911440CD3F00CEB597 /* ggate_bridge.256.png in Resources */, + CEFD49921440CD3F00CEB597 /* hedly.png in Resources */, + CEFD49A01440CF8700CEB597 /* rgb_splats.256.color.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4907144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4909144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..66783b2 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..dfeaf7c Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..fe38545 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/.DS_Store b/Chapter 6/MultiTextureCombining/BouncySquare/.DS_Store new file mode 100644 index 0000000..ceceb31 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/.DS_Store differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquare-Info.plist b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquare-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquare-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquare-Prefix.pch b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquare-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquare-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareAppDelegate.h b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareAppDelegate.h new file mode 100644 index 0000000..a208c69 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncySquareAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncySquareAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareAppDelegate.m b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareAppDelegate.m new file mode 100644 index 0000000..983b5e5 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncySquareAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareAppDelegate.h" + +@implementation BouncySquareAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareViewController.h b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareViewController.h new file mode 100644 index 0000000..7f76851 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareViewController.h @@ -0,0 +1,23 @@ +// +// BouncySquareViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncySquareViewController : GLKViewController +{ + GLKTextureInfo *m_Texture0; + GLKTextureInfo *m_Texture1; +} + +-(void)setClipping; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)multiTexture:(GLuint)tex0 tex1:(GLuint)tex1; + +@end diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareViewController.m b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareViewController.m new file mode 100644 index 0000000..5b95739 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/BouncySquareViewController.m @@ -0,0 +1,176 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareViewController.h" + +@interface BouncySquareViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncySquareViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + [EAGLContext setCurrentContext:self.context]; + + [self setClipping]; + + [EAGLContext setCurrentContext:self.context]; + m_Texture0=[self loadTexture:@"hedly.png"]; + m_Texture1=[self loadTexture:@"rgb_splats.256.color.png"]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = + { + -0.5, -0.5, 0.0, + 0.5, -0.5, 0.0, + -0.5, 0.5, 0.0, + 0.5, 0.5, 0.0 + }; + + static GLfloat textureCoords[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + static float transY = 0.0; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + [self setClipping]; + + glClearColor(0.0, 0.0,0.0, 1.0); + + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //Set up for using textures. + + glEnable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glClientActiveTexture(GL_TEXTURE0); //1 + glTexCoordPointer(2, GL_FLOAT,0,textureCoords); + + glClientActiveTexture(GL_TEXTURE1); //2 + glTexCoordPointer(2, GL_FLOAT,0,textureCoords); + + glLoadIdentity(); + glTranslatef(0.0, (GLfloat)(sinf(transY)/2.0), -2.5); + + [self multiTexture:m_Texture0.name tex1:m_Texture1.name]; + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + transY += 0.075f; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +-(void)multiTexture:(GLuint)tex0 tex1:(GLuint)tex1 +{ + GLfloat combineParameter=GL_MODULATE; //1 + + // Set up the First Texture. + + glActiveTexture(GL_TEXTURE0); //2 + glBindTexture(GL_TEXTURE_2D, tex0); //3 + + // Set up the Second Texture. + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, tex1); + + // Set the texture environment mode for this texture to combine. + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, combineParameter); //4 +} + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .01; + const float zFar = 100; + const float fieldOfView =30.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + //h/w clamps the fov to the height; flipping it would make it relative to the width. + + aspectRatio=(float)frame.size.height/(float)frame.size.width; + + //Set the OpenGL projection matrix. + + glMatrixMode(GL_PROJECTION); + + size = zNear * tanf((fieldOfView/57.3)/ 2.0); + + glFrustumf(-size, size, -size *aspectRatio, + size *aspectRatio, zNear, zFar); + + glViewport(0, 0, frame.size.width, frame.size.height); + + //Make the OpenGL modelview matrix the default. + + glMatrixMode(GL_MODELVIEW); +} + +@end diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/earth_normal_hc_square_thumb.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/earth_normal_hc_square_thumb.png new file mode 100644 index 0000000..9bf8440 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/earth_normal_hc_square_thumb.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/earth_texture_square.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/earth_texture_square.png new file mode 100644 index 0000000..9f88f14 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/earth_texture_square.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/ggate_bridge.256.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/ggate_bridge.256.png new file mode 100644 index 0000000..d6fa2c2 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/ggate_bridge.256.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/hedly.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/hedly.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/rgb_splats.256.color.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/rgb_splats.256.color.png new file mode 100644 index 0000000..898c27e Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/rgb_splats.256.color.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/rgb_splats_masked.256.color.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/rgb_splats_masked.256.color.png new file mode 100644 index 0000000..5b35ab0 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/rgb_splats_masked.256.color.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/usa_normal_really_hc.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/usa_normal_really_hc.png new file mode 100644 index 0000000..838e8bc Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/usa_normal_really_hc.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/assets/usa_texture.png b/Chapter 6/MultiTextureCombining/BouncySquare/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/Chapter 6/MultiTextureCombining/BouncySquare/assets/usa_texture.png differ diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1164b96 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..47e1785 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/MultiTextureCombining/BouncySquare/main.m b/Chapter 6/MultiTextureCombining/BouncySquare/main.m new file mode 100644 index 0000000..d3e3439 --- /dev/null +++ b/Chapter 6/MultiTextureCombining/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncySquareAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncySquareAppDelegate class])); + } +} diff --git a/Chapter 6/MulticolorBlending/.DS_Store b/Chapter 6/MulticolorBlending/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 6/MulticolorBlending/.DS_Store differ diff --git a/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.pbxproj b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f40ad64 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.pbxproj @@ -0,0 +1,306 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncySquareViewController.m */; }; + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* BouncySquare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncySquare.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BouncySquare-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BouncySquare-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareViewController.m; sourceTree = ""; }; + CEFD4907144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD4909144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncySquare */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncySquare.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncySquare */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */, + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */, + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncySquare */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncySquare; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncySquare.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncySquare */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4907144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4909144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..66783b2 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0da3433 Binary files /dev/null and b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..fe38545 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 6/MulticolorBlending/BouncySquare/BouncySquare-Info.plist b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquare-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquare-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 6/MulticolorBlending/BouncySquare/BouncySquare-Prefix.pch b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquare-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquare-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareAppDelegate.h b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareAppDelegate.h new file mode 100644 index 0000000..a208c69 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncySquareAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncySquareAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareAppDelegate.m b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareAppDelegate.m new file mode 100644 index 0000000..983b5e5 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncySquareAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareAppDelegate.h" + +@implementation BouncySquareAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareViewController.h b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareViewController.h new file mode 100644 index 0000000..7dce5a2 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareViewController.h @@ -0,0 +1,16 @@ +// +// BouncySquareViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncySquareViewController : GLKViewController + +-(void)setClipping; + +@end diff --git a/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareViewController.m b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareViewController.m new file mode 100644 index 0000000..1e0e996 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/BouncySquareViewController.m @@ -0,0 +1,145 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareViewController.h" + +@interface BouncySquareViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncySquareViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + [EAGLContext setCurrentContext:self.context]; + + [self setClipping]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = //1 + { + -0.5, -0.5, 0.0, + 0.5, -0.5, 0.0, + -0.5, 0.5, 0.0, + 0.5, 0.5, 0.0 + }; + + static const GLfloat squareColorsYMCA[] = + { + 1.0, 1.0, 0, 1.0, + 0, 1.0, 1.0, 1.0, + 0, 0, 0, 1.0, + 1.0, 0, 1.0, 1.0, + }; + + static const GLfloat squareColorsRGBA[] = + { + 1.0, 0, 0, 1.0, + 0, 1.0, 0, 1.0, + 0, 0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + }; + + static float transY = 0.0; + + glClearColor(0.0, 0.0, 0.0, 1.0); //2 + + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //Do square one bouncing up and down. + + glTranslatef(0.0, (GLfloat)(sinf(transY)/2.0), -4.0); //3 + + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + + glEnableClientState(GL_COLOR_ARRAY); + + ////The Complementary colors + + //SQUARE 1 + + glColorPointer(4, GL_FLOAT, 0, squareColorsYMCA); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + //SQUARE 2 + + glColorPointer(4, GL_FLOAT, 0, squareColorsRGBA); + + glLoadIdentity(); + glTranslatef( (GLfloat)(sinf(transY)/2.0),0.0, -3.0); //6 + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); //7 + + transY += 0.075; //8 +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .01; + const float zFar = 100; + const float fieldOfView =30.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + //h/w clamps the fov to the height; flipping it would make it relative to the width. + + aspectRatio=(float)frame.size.height/(float)frame.size.width; + + //Set the OpenGL projection matrix. + + glMatrixMode(GL_PROJECTION); + + size = zNear * tanf((fieldOfView/57.3)/ 2.0); + + glFrustumf(-size, size, -size *aspectRatio, + size *aspectRatio, zNear, zFar); + + glViewport(0, 0, frame.size.width, frame.size.height); + + //Make the OpenGL modelview matrix the default. + + glMatrixMode(GL_MODELVIEW); +} + +@end diff --git a/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1164b96 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..47e1785 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/MulticolorBlending/BouncySquare/main.m b/Chapter 6/MulticolorBlending/BouncySquare/main.m new file mode 100644 index 0000000..d3e3439 --- /dev/null +++ b/Chapter 6/MulticolorBlending/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncySquareAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncySquareAppDelegate class])); + } +} diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/.DS_Store b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/.DS_Store new file mode 100644 index 0000000..ca3424f Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/.DS_Store differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.pbxproj b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5464c74 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.pbxproj @@ -0,0 +1,327 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE0E3F43141EFE0900799C5F /* earth_light.png in Resources */ = {isa = PBXBuildFile; fileRef = CE0E3F42141EFE0900799C5F /* earth_light.png */; }; + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */; }; + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */; }; + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */; }; + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */; }; + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE60A611141C652F000874FC /* InfoPlist.strings */; }; + CE60A616141C654B000874FC /* Planet.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A615141C654B000874FC /* Planet.m */; }; + CE96CD3A141C6671007DAAA7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD39141C6671007DAAA7 /* main.m */; }; + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */; }; + CEB161DD1420AF640031B034 /* earth_normal_hc.png in Resources */ = {isa = PBXBuildFile; fileRef = CEB161DC1420AF640031B034 /* earth_normal_hc.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE0E3F42141EFE0900799C5F /* earth_light.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = earth_light.png; path = OpenGLSolarSystem/assets/earth_light.png; sourceTree = SOURCE_ROOT; }; + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenGLSolarSystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystem.h; path = OpenGLSolarSystem/OpenGLSolarSystem.h; sourceTree = SOURCE_ROOT; }; + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemAppDelegate.h; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h; sourceTree = SOURCE_ROOT; }; + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemAppDelegate.m; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m; sourceTree = SOURCE_ROOT; }; + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemViewController.h; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.h; sourceTree = SOURCE_ROOT; }; + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemViewController.m; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.m; sourceTree = SOURCE_ROOT; }; + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "OpenGLSolarSystem-Info.plist"; path = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; sourceTree = SOURCE_ROOT; }; + CE60A60C141C6520000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A60F141C6527000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; + CE60A612141C652F000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = OpenGLSolarSystem/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + CE60A614141C653E000874FC /* Planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Planet.h; path = OpenGLSolarSystem/Planet.h; sourceTree = SOURCE_ROOT; }; + CE60A615141C654B000874FC /* Planet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Planet.m; path = OpenGLSolarSystem/Planet.m; sourceTree = SOURCE_ROOT; }; + CE96CD39141C6671007DAAA7 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = OpenGLSolarSystem/main.m; sourceTree = SOURCE_ROOT; }; + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemController.h; path = OpenGLSolarSystem/OpenGLSolarSystemController.h; sourceTree = SOURCE_ROOT; }; + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemController.m; path = OpenGLSolarSystem/OpenGLSolarSystemController.m; sourceTree = SOURCE_ROOT; }; + CEB161DC1420AF640031B034 /* earth_normal_hc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = earth_normal_hc.png; path = OpenGLSolarSystem/assets/assets/earth_normal_hc.png; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXGroup; + children = ( + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */, + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */, + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */, + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.m */, + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */, + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */, + CE60A614141C653E000874FC /* Planet.h */, + CE60A615141C654B000874FC /* Planet.m */, + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */, + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.m */, + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = OpenGLSolarSystem; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE0E3F42141EFE0900799C5F /* earth_light.png */, + CEB161DC1420AF640031B034 /* earth_normal_hc.png */, + CE96CD39141C6671007DAAA7 /* main.m */, + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */, + CE60A611141C652F000874FC /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpenGLSolarSystem; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A60D141C6521000874FC /* MainStoryboard_iPhone.storyboard in Resources */, + CE60A610141C6527000874FC /* MainStoryboard_iPad.storyboard in Resources */, + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */, + CE0E3F43141EFE0900799C5F /* earth_light.png in Resources */, + CEB161DD1420AF640031B034 /* earth_normal_hc.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */, + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.m in Sources */, + CE60A616141C654B000874FC /* Planet.m in Sources */, + CE96CD3A141C6671007DAAA7 /* main.m in Sources */, + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE60A60B141C6520000874FC /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60C141C6520000874FC /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; + CE60A60E141C6527000874FC /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CE60A60F141C6527000874FC /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CE60A611141C652F000874FC /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE60A612141C652F000874FC /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41c6fd1 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..bcd33fc Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/user.mode1v3 b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..cf456b3 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/user.mode1v3 @@ -0,0 +1,1363 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CEF317C6141C662400ADE1D0 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 404 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + CE269CD9141BF49D00704362 + CE269CDA141BF49D00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {404, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {421, 463}} + GroupTreeTableConfiguration + + MainColumn + 404 + + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXSmartGroupTreeModule + Proportion + 421pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {362, 277}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 277pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 282}, {362, 181}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + XCDetailModule + Proportion + 181pt + + + Proportion + 362pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CEF317C4141C662400ADE1D0 + 1CE0B1FE06471DED0097A5F4 + CEF317C5141C662400ADE1D0 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CEF317C7141C662400ADE1D0 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem.xcodeproj + + WindowString + -1396 553 788 504 -1680 30 1680 1050 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CEF317C7141C662400ADE1D0 + CEF317C8141C662400ADE1D0 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + -1375 534 500 500 -1680 30 1680 1050 + WindowToolGUID + CEF317C7141C662400ADE1D0 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/user.pbxuser b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/user.pbxuser new file mode 100644 index 0000000..fa58c18 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */; + activeTarget = CE269CCA141BF49D00704362 /* OpenGLSolarSystem */; + codeSenseManager = CEF317CA141C662400ADE1D0 /* Code sense */; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 123, + 20, + 48.16259765625, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337405452; + PBXWorkspaceStateSaveDate = 337405452; + }; + sourceControlManager = CEF317C9141C662400ADE1D0 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + activeExec = 0; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + }; + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = OpenGLSolarSystem; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CEF317C9141C662400ADE1D0 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CEF317CA141C662400ADE1D0 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme new file mode 100644 index 0000000..d1a3e4a --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e123ef3 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + OpenGLSolarSystem.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/.DS_Store b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/.DS_Store new file mode 100644 index 0000000..8d8d089 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/.DS_Store differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem.h b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem.h new file mode 100644 index 0000000..fa8742a --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystem.h @@ -0,0 +1,17 @@ +// +// OpenGLSolarSystem.h +// OpenGLSolarSystem +// +// Created by mike on 9/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef OpenGLSolarSystem_OpenGLSolarSystem_h +#define OpenGLSolarSystem_OpenGLSolarSystem_h + +#import +#define SS_SUNLIGHT GL_LIGHT0 //GL uses GL_LIGHTx +#define SS_FILLLIGHT1 GL_LIGHT1 +#define SS_FILLLIGHT2 GL_LIGHT2 + +#endif diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..c1338c5 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h @@ -0,0 +1,15 @@ +// +// OpenGLSolarSystemAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLSolarSystemAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..5947682 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m @@ -0,0 +1,60 @@ +// +// OpenGLSolarSystemAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystemAppDelegate.h" + +@implementation OpenGLSolarSystemAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemController.h b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemController.h new file mode 100644 index 0000000..c5f9bee --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemController.h @@ -0,0 +1,29 @@ +// +// OpenGLSolarSystemController.h +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// +#import +#import "Planet.h" + +#define X_VALUE 0 +#define Y_VALUE 1 +#define Z_VALUE 2 + + +@interface OpenGLSolarSystemController : NSObject +{ + Planet *m_Earth; + Planet *m_Sun; + GLfloat m_Eyeposition[3]; +} + +-(void)execute; +-(void)executePlanet:(Planet *)planet; +-(id)init; +-(void)initGeometry; + +@end + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemController.m b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemController.m new file mode 100644 index 0000000..9633464 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemController.m @@ -0,0 +1,100 @@ +// +// OpenGLSolarSystemController.m +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" + +@implementation OpenGLSolarSystemController + +-(id)init +{ + [self initGeometry]; + + return self; +} + +-(void)initGeometry +{ + m_Eyeposition[X_VALUE]=0.0; + m_Eyeposition[Y_VALUE]=0.0; + m_Eyeposition[Z_VALUE]=3.0; + + m_Earth=[[Planet alloc] init:50 slices:50 radius:1.0 squash:1.0 textureFile:@"earth_light.png" bumpmapFile:@"earth_normal_hc.png"]; + [m_Earth setPositionX:0.0 Y:0.0 Z:0.0]; +} + +-(void)execute +{ + GLfloat posFill1[]={-8.0,0.0,5.0,1.0}; + static GLfloat angle=0.0; + GLfloat orbitalIncrement=.5; + GLfloat sunPos[4]={0.0,0.0,0.0,1.0}; + + glLightfv(SS_FILLLIGHT1,GL_POSITION,posFill1); + + glEnable(GL_DEPTH_TEST); + + glClearColor(0.0, 0.25f, 0.35f, 1.0); + glClear(GL_COLOR_BUFFER_BIT); + + glPushMatrix(); + + glTranslatef(-m_Eyeposition[X_VALUE],-m_Eyeposition[Y_VALUE],-m_Eyeposition[Z_VALUE]); + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); + + glEnable(SS_FILLLIGHT1); + glDisable(SS_FILLLIGHT2); + + glPushMatrix(); + + angle+=orbitalIncrement; + + [self executePlanet:m_Earth]; + + glPopMatrix(); + + glPopMatrix(); +} + +-(void)executePlanet:(Planet *)planet +{ + GLfloat posX, posY, posZ; + static GLfloat angle=0.0; + + glPushMatrix(); + + [planet getPositionX:&posX Y:&posY Z:&posZ]; + + glTranslatef(posX,posY,posZ); + + glRotatef(angle,0.0,1.0,0.0); + + [planet execute]; + + glPopMatrix(); + + angle+=.4; +} +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:NULL error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +@end diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemViewController.h b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..7a6e8c7 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemViewController.h @@ -0,0 +1,24 @@ +// +// OpenGLSolarSystemViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" + +@interface OpenGLSolarSystemViewController : GLKViewController +{ + OpenGLSolarSystemController *m_SolarSystem; + +}; + +-(void)viewDidLoad; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)setClipping; +-(void)initLighting; +@end diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemViewController.m b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..3723b0c --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/OpenGLSolarSystemViewController.m @@ -0,0 +1,128 @@ +// +// OpenGL_SolarSystemViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemViewController.h" + +@interface OpenGLSolarSystemViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation OpenGLSolarSystemViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [EAGLContext setCurrentContext:self.context]; + + m_SolarSystem=[[OpenGLSolarSystemController alloc] init]; + + [self initLighting]; + [self setClipping]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + glEnable(GL_DEPTH_TEST); + + glClearColor(0.0f,0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + [m_SolarSystem execute]; +} + +-(void)initLighting +{ + GLfloat sunPos[]={0.0,0.0,0.0,1.0}; + GLfloat posFill1[]={-15.0,15.0,0.0,1.0}; + GLfloat posFill2[]={-10.0,-4.0,1.0,1.0}; + + GLfloat white[]={1.0,1.0,1.0,1.0}; + GLfloat dimblue[]={0.0,0.0,.2,1.0}; + + GLfloat cyan[]={0.0,1.0,1.0,1.0}; + + //lights go here + + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); + glLightfv(SS_SUNLIGHT,GL_DIFFUSE,white); + + glLightfv(SS_FILLLIGHT1,GL_POSITION,posFill1); + glLightfv(SS_FILLLIGHT1,GL_DIFFUSE,dimblue); + + glLightfv(SS_FILLLIGHT2,GL_POSITION,posFill2); + glLightfv(SS_FILLLIGHT2,GL_DIFFUSE,dimblue); + + //materials go here + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cyan); + + glLightf(SS_SUNLIGHT,GL_QUADRATIC_ATTENUATION,.001); + + glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,25); + + glShadeModel(GL_SMOOTH); + glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,0.0); + + glEnable(GL_LIGHTING); + glEnable(SS_SUNLIGHT); + glEnable(SS_FILLLIGHT1); + glEnable(SS_FILLLIGHT2); +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .1; + const float zFar = 1000; + const float fieldOfView = 60.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + aspectRatio=(float)frame.size.width/(float)frame.size.height; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (fieldOfView) / 2.0); + + glFrustumf(-size, size, -size /aspectRatio, size /aspectRatio, zNear, zFar); + glViewport(0, 0, frame.size.width, frame.size.height); + + glMatrixMode(GL_MODELVIEW); +} + + +@end diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/Planet.h b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/Planet.h new file mode 100644 index 0000000..1b6b0f8 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/Planet.h @@ -0,0 +1,41 @@ +/**************************************************************************************** + * Planet.h : lifted from the iPhone Touchfighter exmaple code. Thanks! Apple! * + ****************************************************************************************/ +#import +#import +#import + +@interface Planet : NSObject +{ + +@private + GLfloat *m_VertexData; + GLubyte *m_ColorData; + GLfloat *m_NormalData; + GLfloat *m_TexCoordsData; + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; + GLfloat m_Angle; + GLfloat m_Pos[3]; + GLfloat m_RotationalIncrement; + + GLKTextureInfo *m_TextureInfo; + GLKTextureInfo *m_BumpMapInfo; + +} + +-(bool)execute; +-(id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat)squash +textureFile:(NSString *)textureFile bumpmapFile:(NSString *)bumpmapFile; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z; +-(GLfloat)getRotation; +-(void)setRotation:(GLfloat)angle; +-(GLfloat)getRotationalIncrement; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +-(void)multiTextureBumpMap:(GLuint)tex0 tex1:(GLuint)tex1; + +@end diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/Planet.m b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/Planet.m new file mode 100644 index 0000000..a554afc --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/Planet.m @@ -0,0 +1,345 @@ +/* + +===== IMPORTANT ===== + +===================== + +File: Planet.m : taken from the Touchfighter example +Abstract: Planet. + +Version: 2.0 + + +*/ + +#import "Planet.h" + +GLshort *_texData=NULL; + +@implementation Planet + + + +-(id) init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat)squash + textureFile:(NSString *)textureFile bumpmapFile:(NSString *)bumpmapFile +{ + unsigned int colorIncrment=0; + unsigned int blue=0; + unsigned int red=255; + int numVertices=0; + + if(textureFile!=nil) + m_TextureInfo=[self loadTexture:textureFile]; + + if(bumpmapFile!=nil) + m_BumpMapInfo=[self loadTexture:bumpmapFile]; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + m_TexCoordsData = nil; + + //vertices + + GLfloat *vPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * + (m_Stacks))); + + //color data + + GLubyte *cPtr = m_ColorData = + (GLubyte*)malloc(sizeof(GLubyte) * 4 * ((m_Slices*2+2) * + (m_Stacks))); + + //normal pointers for lighting + + GLfloat *nPtr = m_NormalData = (GLfloat*) + malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); + + GLfloat *tPtr=nil; //3 + + if(textureFile!=nil) + { + tPtr=m_TexCoordsData = + (GLfloat *)malloc(sizeof(GLfloat) * 2 * ((m_Slices*2+2) * + (m_Stacks))); + } + + unsigned int phiIdx, thetaIdx; + + //latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) + { + //starts at -1.57 goes up to +1.57 radians + + //the first circle + + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0/(float) + (m_Stacks)) - 0.5); + + //the next, or second one. + + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0/(float) + (m_Stacks)) - 0.5); + float cosPhi0 = cos(phi0); + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + //longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) + { + //Increment along the longitude circle each "slice." + + float theta = -2.0*M_PI * ((float)thetaIdx) * + (1.0/(float)(m_Slices-1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + //We're generating a vertical pair of points, such + //as the first point of stack 0 and the first point + //of stack 1 + //above it. This is how TRIANGLE_STRIPS work, + //taking a set of 4 vertices and essentially drawing + //two triangles + //at a time. The first is v0-v1-v2 and the next is + //v2-v1-v3. Etc. + + //Get x-y-z for the first vertex of stack. + + vPtr[0] = m_Scale*cosPhi0 * cosTheta; + vPtr[1] = m_Scale*sinPhi0*m_Squash; + vPtr[2] = m_Scale*(cosPhi0 * sinTheta); + + //the same but for the vertex immediately above the + //previous one + + vPtr[3] = m_Scale*cosPhi1 * cosTheta; + vPtr[4] = m_Scale*sinPhi1*m_Squash; + vPtr[5] = m_Scale*(cosPhi1 * sinTheta); + + //normal pointers for lighting + + nPtr[0] = cosPhi0 * cosTheta; + nPtr[2] = cosPhi0 * sinTheta; + nPtr[1] = sinPhi0; + + nPtr[3] = cosPhi1 * cosTheta; + nPtr[5] = cosPhi1 * sinTheta; + nPtr[4] = sinPhi1; + + if(tPtr!=nil) //4 + { + GLfloat texX = (float)thetaIdx * + (1.0f/(float)(m_Slices-1)); + tPtr[0] = texX; + tPtr[1] = (float)(phiIdx+0) * + (1.0f/(float)(m_Stacks)); + tPtr[2] = texX; + tPtr[3] = (float)(phiIdx+1) * + (1.0f/(float)(m_Stacks)); + } + + cPtr[0] = red; + cPtr[1] = 0; + cPtr[2] = blue; + cPtr[4] = red; + cPtr[5] = 0; + cPtr[6] = blue; + cPtr[3] = cPtr[7] = 255; + + cPtr += 2*4; + vPtr += 2*3; + nPtr += 2*3; + + + if(tPtr!=nil) //5 + tPtr += 2*2; + } + + blue+=colorIncrment; + red-=colorIncrment; + + // Degenerate triangle to connect stacks and maintain + //winding order. + + vPtr[0] = vPtr[3] = vPtr[-3]; + vPtr[1] = vPtr[4] = vPtr[-2]; + vPtr[2] = vPtr[5] = vPtr[-1]; + + nPtr[0] = nPtr[3] = nPtr[-3]; + nPtr[1] = nPtr[4] = nPtr[-2]; + nPtr[2] = nPtr[5] = nPtr[-1]; + + if(tPtr!=nil) + { + tPtr[0] = tPtr[2] = tPtr[-2]; //6 + tPtr[1] = tPtr[3] = tPtr[-1]; + } + + } + + numVertices=(vPtr-m_VertexData)/6; + } + + m_Angle=0.0; + m_RotationalIncrement=0.0; + + m_Pos[0]=0.0; + m_Pos[1]=0.0; + m_Pos[2]=0.0; + + return self; +} + +-(bool)execute +{ + glMatrixMode(GL_MODELVIEW); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glEnable(GL_LIGHTING); + + glFrontFace(GL_CW); + + glEnable(GL_TEXTURE_2D); + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(3, GL_FLOAT, 0, m_VertexData); + + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glClientActiveTexture(GL_TEXTURE0); + + glBindTexture(GL_TEXTURE_2D, m_TextureInfo.name); + + glTexCoordPointer(2, GL_FLOAT, 0, m_TexCoordsData); + + glClientActiveTexture(GL_TEXTURE1); + glTexCoordPointer(2, GL_FLOAT,0,m_TexCoordsData); + + glMatrixMode(GL_MODELVIEW); + + glEnableClientState(GL_NORMAL_ARRAY); + glNormalPointer(GL_FLOAT, 0, m_NormalData); + + glColorPointer(4, GL_UNSIGNED_BYTE, 0, m_ColorData); + + [self multiTextureBumpMap:m_BumpMapInfo.name tex1:m_TextureInfo.name]; + + glDrawArrays(GL_TRIANGLE_STRIP, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + return true; +} + +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z +{ + *x=m_Pos[0]; + *y=m_Pos[1]; + *z=m_Pos[2]; +} + +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z +{ + m_Pos[0]=x; + m_Pos[1]=y; + m_Pos[2]=z; +} + +-(GLfloat)getRotation +{ + return m_Angle; +} + +-(void)setRotation:(GLfloat)angle +{ + m_Angle=angle; +} + +-(void)incrementRotation +{ + m_Angle+=m_RotationalIncrement; +} + +-(GLfloat)getRotationalIncrement +{ + return m_RotationalIncrement; +} + +-(void)setRotationalIncrement:(GLfloat)inc +{ + m_RotationalIncrement=inc; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft, + [NSNumber numberWithBool:TRUE],GLKTextureLoaderGenerateMipmaps,nil]; + + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +-(void)multiTextureBumpMap:(GLuint)tex0 tex1:(GLuint)tex1 +{ + GLfloat x,y,z; + static float lightAngle=0.0; + + lightAngle+=1.0; //1 + + if(lightAngle>180) + lightAngle=0; + + // Set up the light vector. + + x = sin(lightAngle * (3.14159 / 180.0)); //2 + y = 0.0; + z = cos(lightAngle * (3.14159 / 180.0)); + + // Half shifting to have a value between 0.0 and 1.0. + + x = x * 0.5 + 0.5; //3 + y = y * 0.5 + 0.5; + z = z * 0.5 + 0.5; + + glColor4f(x, y, z, 1.0); //4 + + //The color and normal map are combined. + + glActiveTexture(GL_TEXTURE0); //5 + glBindTexture(GL_TEXTURE_2D, tex0); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); //6 + glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB); //7 + glTexEnvf(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE); //8 + glTexEnvf(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS); //9 + + // Set up the Second Texture, and combine it with the result of the Dot3 combination. + + glActiveTexture(GL_TEXTURE1); //10 + glBindTexture(GL_TEXTURE_2D, tex1); + + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); //11 +} + +@end \ No newline at end of file diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/.DS_Store b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/.DS_Store new file mode 100644 index 0000000..29b1a3a Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/.DS_Store differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_normal_hc.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_normal_hc.png new file mode 100644 index 0000000..4b8292f Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_normal_hc.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_normal_hc_square_thumb.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_normal_hc_square_thumb.png new file mode 100644 index 0000000..9bf8440 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_normal_hc_square_thumb.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_texture_square.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_texture_square.png new file mode 100644 index 0000000..9f88f14 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/earth_texture_square.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/ggate_bridge.256.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/ggate_bridge.256.png new file mode 100644 index 0000000..d6fa2c2 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/ggate_bridge.256.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/hedly.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/hedly.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/rgb_splats.256.color.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/rgb_splats.256.color.png new file mode 100644 index 0000000..898c27e Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/rgb_splats.256.color.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/rgb_splats_masked.256.color.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/rgb_splats_masked.256.color.png new file mode 100644 index 0000000..5b35ab0 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/rgb_splats_masked.256.color.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/usa_normal_really_hc.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/usa_normal_really_hc.png new file mode 100644 index 0000000..838e8bc Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/usa_normal_really_hc.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/usa_texture.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/usa_texture.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/earth_light.png b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/earth_light.png new file mode 100644 index 0000000..ff12df7 Binary files /dev/null and b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/earth_light.png differ diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/InfoPlist.strings b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..6fe7ae9 --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..d77a83e --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/main.m b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/main.m new file mode 100644 index 0000000..60754fa --- /dev/null +++ b/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "OpenGLSolarSystemAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([OpenGLSolarSystemAppDelegate class])); + } +} diff --git a/Chapter 6/SolidSquares/.DS_Store b/Chapter 6/SolidSquares/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 6/SolidSquares/.DS_Store differ diff --git a/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.pbxproj b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f40ad64 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.pbxproj @@ -0,0 +1,306 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncySquareViewController.m */; }; + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* BouncySquare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncySquare.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BouncySquare-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BouncySquare-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareViewController.m; sourceTree = ""; }; + CEFD4907144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD4909144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncySquare */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncySquare.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncySquare */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */, + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */, + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncySquare */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncySquare; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncySquare.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncySquare */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4907144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4909144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..66783b2 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..84753e7 Binary files /dev/null and b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..fe38545 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 6/SolidSquares/BouncySquare/BouncySquare-Info.plist b/Chapter 6/SolidSquares/BouncySquare/BouncySquare-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/BouncySquare-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 6/SolidSquares/BouncySquare/BouncySquare-Prefix.pch b/Chapter 6/SolidSquares/BouncySquare/BouncySquare-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/BouncySquare-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 6/SolidSquares/BouncySquare/BouncySquareAppDelegate.h b/Chapter 6/SolidSquares/BouncySquare/BouncySquareAppDelegate.h new file mode 100644 index 0000000..a208c69 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/BouncySquareAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncySquareAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncySquareAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 6/SolidSquares/BouncySquare/BouncySquareAppDelegate.m b/Chapter 6/SolidSquares/BouncySquare/BouncySquareAppDelegate.m new file mode 100644 index 0000000..983b5e5 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/BouncySquareAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncySquareAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareAppDelegate.h" + +@implementation BouncySquareAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 6/SolidSquares/BouncySquare/BouncySquareViewController.h b/Chapter 6/SolidSquares/BouncySquare/BouncySquareViewController.h new file mode 100644 index 0000000..7dce5a2 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/BouncySquareViewController.h @@ -0,0 +1,16 @@ +// +// BouncySquareViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncySquareViewController : GLKViewController + +-(void)setClipping; + +@end diff --git a/Chapter 6/SolidSquares/BouncySquare/BouncySquareViewController.m b/Chapter 6/SolidSquares/BouncySquare/BouncySquareViewController.m new file mode 100644 index 0000000..38a8e3a --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/BouncySquareViewController.m @@ -0,0 +1,127 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareViewController.h" + +@interface BouncySquareViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncySquareViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + [EAGLContext setCurrentContext:self.context]; + + [self setClipping]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = //1 + { + -0.5, -0.5, 0.0, + 0.5, -0.5, 0.0, + -0.5, 0.5, 0.0, + 0.5, 0.5, 0.0 + }; + + static float transY = 0.0; + + glClearColor(0.0, 0.0, 0.0, 1.0); //2 + + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //Do square one bouncing up and down. + + glTranslatef(0.0, (GLfloat)(sinf(transY)/2.0), -4.0); //3 + + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + + ////The Complementary colors + + //SQUARE 1 + + glColor4f(0.0, 0.0,1.0,1.0); //4 + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + //SQUARE 2 + + glColor4f(1.0, 0.0,0.0, .5); //5 + + glLoadIdentity(); + glTranslatef( (GLfloat)(sinf(transY)/2.0),0.0, -3.0); //6 + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); //7 + + transY += 0.075; //8 +} + + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .01; + const float zFar = 100; + const float fieldOfView =30.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + //h/w clamps the fov to the height; flipping it would make it relative to the width. + + aspectRatio=(float)frame.size.height/(float)frame.size.width; + + //Set the OpenGL projection matrix. + + glMatrixMode(GL_PROJECTION); + + size = zNear * tanf((fieldOfView/57.3)/ 2.0); + + glFrustumf(-size, size, -size *aspectRatio, + size *aspectRatio, zNear, zFar); + + glViewport(0, 0, frame.size.width, frame.size.height); + + //Make the OpenGL modelview matrix the default. + + glMatrixMode(GL_MODELVIEW); +} + +@end diff --git a/Chapter 6/SolidSquares/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 6/SolidSquares/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 6/SolidSquares/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 6/SolidSquares/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1164b96 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/SolidSquares/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 6/SolidSquares/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..47e1785 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/SolidSquares/BouncySquare/main.m b/Chapter 6/SolidSquares/BouncySquare/main.m new file mode 100644 index 0000000..d3e3439 --- /dev/null +++ b/Chapter 6/SolidSquares/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncySquareAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncySquareAppDelegate class])); + } +} diff --git a/Chapter 6/TextureBlending/.DS_Store b/Chapter 6/TextureBlending/.DS_Store new file mode 100644 index 0000000..e1978d4 Binary files /dev/null and b/Chapter 6/TextureBlending/.DS_Store differ diff --git a/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.pbxproj b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.pbxproj new file mode 100644 index 0000000..dd07aa1 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.pbxproj @@ -0,0 +1,314 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncySquareViewController.m */; }; + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */; }; + CEFD49911440CD3F00CEB597 /* ggate_bridge.256.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */; }; + CEFD49921440CD3F00CEB597 /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFD49901440CD3E00CEB597 /* hedly.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* BouncySquare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BouncySquare.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BouncySquare-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BouncySquare-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncySquareViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncySquareViewController.m; sourceTree = ""; }; + CEFD4907144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD4909144029AD00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ggate_bridge.256.png; path = assets/ggate_bridge.256.png; sourceTree = ""; }; + CEFD49901440CD3E00CEB597 /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* BouncySquare */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* BouncySquare.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* BouncySquare */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncySquareAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncySquareAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncySquareViewController.h */, + CE269CF0141BF49D00704362 /* BouncySquareViewController.m */, + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CEFD498F1440CD3E00CEB597 /* ggate_bridge.256.png */, + CEFD49901440CD3E00CEB597 /* hedly.png */, + CE269CDB141BF49D00704362 /* BouncySquare-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* BouncySquare-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* BouncySquare */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BouncySquare; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* BouncySquare.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* BouncySquare */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CEFD490A144029AD00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD490B144029AD00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + CEFD49911440CD3F00CEB597 /* ggate_bridge.256.png in Resources */, + CEFD49921440CD3F00CEB597 /* hedly.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncySquareAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncySquareViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD4906144029AD00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4907144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD4908144029AD00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD4909144029AD00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/BouncySquare-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/BouncySquare-Info.plist"; + PRODUCT_NAME = BouncySquare; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "BouncySquare" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..66783b2 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..100abff Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme new file mode 100644 index 0000000..fe38545 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/BouncySquare.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..f0a4282 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + BouncySquare.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 6/TextureBlending/BouncySquare/.DS_Store b/Chapter 6/TextureBlending/BouncySquare/.DS_Store new file mode 100644 index 0000000..bd9082e Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/.DS_Store differ diff --git a/Chapter 6/TextureBlending/BouncySquare/BouncySquare-Info.plist b/Chapter 6/TextureBlending/BouncySquare/BouncySquare-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/BouncySquare-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 6/TextureBlending/BouncySquare/BouncySquare-Prefix.pch b/Chapter 6/TextureBlending/BouncySquare/BouncySquare-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/BouncySquare-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 6/TextureBlending/BouncySquare/BouncySquareAppDelegate.h b/Chapter 6/TextureBlending/BouncySquare/BouncySquareAppDelegate.h new file mode 100644 index 0000000..a208c69 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/BouncySquareAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncySquareAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncySquareAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 6/TextureBlending/BouncySquare/BouncySquareAppDelegate.m b/Chapter 6/TextureBlending/BouncySquare/BouncySquareAppDelegate.m new file mode 100644 index 0000000..983b5e5 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/BouncySquareAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncySquareAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareAppDelegate.h" + +@implementation BouncySquareAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 6/TextureBlending/BouncySquare/BouncySquareViewController.h b/Chapter 6/TextureBlending/BouncySquare/BouncySquareViewController.h new file mode 100644 index 0000000..f710204 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/BouncySquareViewController.h @@ -0,0 +1,22 @@ +// +// BouncySquareViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface BouncySquareViewController : GLKViewController +{ + GLKTextureInfo *m_Texture0; + GLKTextureInfo *m_Texture1; +} + +-(void)setClipping; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; + +@end diff --git a/Chapter 6/TextureBlending/BouncySquare/BouncySquareViewController.m b/Chapter 6/TextureBlending/BouncySquare/BouncySquareViewController.m new file mode 100644 index 0000000..91558f5 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/BouncySquareViewController.m @@ -0,0 +1,189 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncySquareViewController.h" + +@interface BouncySquareViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncySquareViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + [EAGLContext setCurrentContext:self.context]; + + [self setClipping]; + + [EAGLContext setCurrentContext:self.context]; + m_Texture0=[self loadTexture:@"hedly.png"]; + m_Texture1=[self loadTexture:@"ggate_bridge.256.png"]; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = + { + -0.5, -0.5, 0.0, + 0.5, -0.5, 0.0, + -0.5, 0.5, 0.0, + 0.5, 0.5, 0.0 + }; + + static const GLfloat squareColorsYMCA[] = + { + 1.0, 1.0, 0, 1.0, + 0, 1.0, 1.0, 1.0, + 0, 0, 0, 1.0, + 1.0, 0, 1.0, 1.0, + }; + + static const GLfloat squareColorsRGBA[] = + { + 1.0, 0, 0, 1.0, + 0, 1.0, 0, 1.0, + 0, 0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, + }; + + static GLfloat textureCoords[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + static float transY = 0.0; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + [self setClipping]; + + glClearColor(0.0, 0.0,0.0, 1.0); + + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //Set up for using textures. + + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,m_Texture0.name); + glTexCoordPointer(2, GL_FLOAT,0,textureCoords); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + //Do square one bouncing up and down. + + glTranslatef(0.0, (GLfloat)(sinf(transY)/2.0), -4.0); + + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + + //glEnable(GL_BLEND); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + //SQUARE 1 + + // glEnableClientState(GL_COLOR_ARRAY); //uncommenting this will blend the vertex colors with the array + + glColorPointer(4, GL_FLOAT, 0, squareColorsYMCA); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + //SQUARE 2 + + glLoadIdentity(); + glTranslatef( (GLfloat)(sinf(transY)/2.0),0.0, -3.0); + + glColorPointer(4, GL_FLOAT, 0, squareColorsRGBA); + glBindTexture(GL_TEXTURE_2D,m_Texture1.name); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + transY += 0.075f; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .01; + const float zFar = 100; + const float fieldOfView =30.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + //h/w clamps the fov to the height; flipping it would make it relative to the width. + + aspectRatio=(float)frame.size.height/(float)frame.size.width; + + //Set the OpenGL projection matrix. + + glMatrixMode(GL_PROJECTION); + + size = zNear * tanf((fieldOfView/57.3)/ 2.0); + + glFrustumf(-size, size, -size *aspectRatio, + size *aspectRatio, zNear, zFar); + + glViewport(0, 0, frame.size.width, frame.size.height); + + //Make the OpenGL modelview matrix the default. + + glMatrixMode(GL_MODELVIEW); +} + +@end diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/earth_normal_hc_square_thumb.png b/Chapter 6/TextureBlending/BouncySquare/assets/earth_normal_hc_square_thumb.png new file mode 100644 index 0000000..9bf8440 Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/earth_normal_hc_square_thumb.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/earth_texture_square.png b/Chapter 6/TextureBlending/BouncySquare/assets/earth_texture_square.png new file mode 100644 index 0000000..9f88f14 Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/earth_texture_square.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/ggate_bridge.256.png b/Chapter 6/TextureBlending/BouncySquare/assets/ggate_bridge.256.png new file mode 100644 index 0000000..d6fa2c2 Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/ggate_bridge.256.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/hedly.png b/Chapter 6/TextureBlending/BouncySquare/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/hedly.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/rgb_splats.256.color.png b/Chapter 6/TextureBlending/BouncySquare/assets/rgb_splats.256.color.png new file mode 100644 index 0000000..898c27e Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/rgb_splats.256.color.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/rgb_splats_masked.256.color.png b/Chapter 6/TextureBlending/BouncySquare/assets/rgb_splats_masked.256.color.png new file mode 100644 index 0000000..5b35ab0 Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/rgb_splats_masked.256.color.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/usa_normal_really_hc.png b/Chapter 6/TextureBlending/BouncySquare/assets/usa_normal_really_hc.png new file mode 100644 index 0000000..838e8bc Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/usa_normal_really_hc.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/assets/usa_texture.png b/Chapter 6/TextureBlending/BouncySquare/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/Chapter 6/TextureBlending/BouncySquare/assets/usa_texture.png differ diff --git a/Chapter 6/TextureBlending/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 6/TextureBlending/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 6/TextureBlending/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 6/TextureBlending/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..1164b96 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/TextureBlending/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 6/TextureBlending/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..47e1785 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 6/TextureBlending/BouncySquare/main.m b/Chapter 6/TextureBlending/BouncySquare/main.m new file mode 100644 index 0000000..d3e3439 --- /dev/null +++ b/Chapter 6/TextureBlending/BouncySquare/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncySquareAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncySquareAppDelegate class])); + } +} diff --git a/Chapter 7/.DS_Store b/Chapter 7/.DS_Store new file mode 100644 index 0000000..1492e79 Binary files /dev/null and b/Chapter 7/.DS_Store differ diff --git a/Chapter 7/FrameBufferObject/.DS_Store b/Chapter 7/FrameBufferObject/.DS_Store new file mode 100644 index 0000000..70a8489 Binary files /dev/null and b/Chapter 7/FrameBufferObject/.DS_Store differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/.DS_Store b/Chapter 7/FrameBufferObject/BouncySquare/.DS_Store new file mode 100644 index 0000000..78a4a48 Binary files /dev/null and b/Chapter 7/FrameBufferObject/BouncySquare/.DS_Store differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureAppDelegate.h b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureAppDelegate.h new file mode 100644 index 0000000..f16fd30 --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureAppDelegate.h @@ -0,0 +1,15 @@ +// +// BouncyTextureAppDelegate.h +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface BouncyTextureAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureAppDelegate.m b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureAppDelegate.m new file mode 100644 index 0000000..ad6e0ad --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureAppDelegate.m @@ -0,0 +1,60 @@ +// +// BouncyTextureAppDelegate.m +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyTextureAppDelegate.h" + +@implementation BouncyTextureAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureViewController.h b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureViewController.h new file mode 100644 index 0000000..15337a4 --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureViewController.h @@ -0,0 +1,25 @@ +// +// BouncyTextureViewController.h +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "FBOController.h" + +@interface BouncyTextureViewController : GLKViewController +{ + GLKTextureInfo *m_Texture; + FBOController *m_FBOController; + float m_FBOHeight; + float m_FBOWidth; + GLint m_DefaultFBO; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +-(void)setClipping; + +@end diff --git a/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureViewController.m b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureViewController.m new file mode 100644 index 0000000..4e6013a --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/BouncyTextureViewController.m @@ -0,0 +1,184 @@ +// +// BouncySquareViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "BouncyTextureViewController.h" + +@interface BouncyTextureViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation BouncyTextureViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + [EAGLContext setCurrentContext:self.context]; + + m_Texture=[self loadTexture:@"hedly.png"]; + [self setClipping]; + + m_FBOHeight=480; + m_FBOWidth=320; + + m_FBOController=[[FBOController alloc]initWidth:m_FBOWidth height:m_FBOHeight]; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft,nil]; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + + + return info; +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + static const GLfloat squareVertices[] = + { + -0.5f, -0.5f, 0.0f, + 0.5f, -0.5f, 0.0f, + -0.5f, 0.5f, 0.0f, + 0.5f, 0.5f, 0.0f + }; + + static const GLfloat fboVertices[] = //1 + { + -0.5f, -0.75f, 0.0f, + 0.5f, -0.75f, 0.0f, + -0.5f, 0.75f, 0.0f, + 0.5f, 0.75f, 0.0f + }; + + static GLfloat textureCoords1[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + static float transY = 0.0f; + static float rotZ = 0.0f; + static float z = -1.5; + + if(m_DefaultFBO==0) + glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &m_DefaultFBO); //2 + + glDisableClientState(GL_COLOR_ARRAY|GL_DEPTH_BUFFER_BIT); + + //Draw to the off-screen FBO first. + + glBindFramebufferOES(GL_FRAMEBUFFER_OES, [m_FBOController getFBOName]); //2 + + glClearColor(0.0f, 0.0f, 1.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), z); + glRotatef(rotZ, 0, 0, 1.0); //3 + + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, m_Texture.name); + + glTexCoordPointer(2, GL_FLOAT,0,textureCoords1); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); //4 + + glBindFramebufferOES(GL_FRAMEBUFFER_OES, m_DefaultFBO); //5 + + glLoadIdentity(); //6 + + glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f),z); + glRotatef(rotZ, 1, 0, 0.0); + + + glBindTexture(GL_TEXTURE_2D, [m_FBOController getTextureName]); //7 + + glClearColor(1.0f, 0.0f, 0.0f, 1.0f); //8 + glClear(GL_COLOR_BUFFER_BIT); + + glTexCoordPointer(2, GL_FLOAT,0,textureCoords1); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glVertexPointer(3, GL_FLOAT, 0, fboVertices); //9 + glEnableClientState(GL_VERTEX_ARRAY); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + transY += 0.075f; + rotZ+=1.0; +} + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .1; + const float zFar = 1000; + const float fieldOfView = 60.0; + GLfloat size; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + aspectRatio=(float)frame.size.width/(float)frame.size.height; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (fieldOfView) / 2.0); + + glFrustumf(-size, size, -size /aspectRatio, size /aspectRatio, zNear, zFar); + glViewport(0, 0, frame.size.width, frame.size.height); + + glMatrixMode(GL_MODELVIEW); +} + +@end diff --git a/Chapter 7/FrameBufferObject/BouncySquare/FBOController.h b/Chapter 7/FrameBufferObject/BouncySquare/FBOController.h new file mode 100644 index 0000000..a57766e --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/FBOController.h @@ -0,0 +1,26 @@ +// +// FBOController.h +// Bouncy Texture +// +// Created by mike on 9/14/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + + +#import +#import +#import + +@interface FBOController : NSObject +{ + GLuint m_Texture; + GLuint m_FBO1; +} + +-(GLint)getFBOName; +-(GLuint)getTextureName; +-(id)initWidth:(float)width height:(float)height; + +@end + + diff --git a/Chapter 7/FrameBufferObject/BouncySquare/FBOController.m b/Chapter 7/FrameBufferObject/BouncySquare/FBOController.m new file mode 100644 index 0000000..a886b0d --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/FBOController.m @@ -0,0 +1,88 @@ +// +// FBOController.m +// Bouncy Texture +// +// Created by mike on 9/14/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "FBOController.h" + + +@implementation FBOController + +-(id)initWidth:(float)width height:(float)height +{ + GLint originalFBO; + GLuint depthBuffer; + + //Cache the original FBO, and restore it later. + + glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &originalFBO); //1 + + glGenRenderbuffersOES(1, &depthBuffer); //2 + glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthBuffer); + + glRenderbufferStorageOES(GL_RENDERBUFFER_OES, //3 + GL_DEPTH_COMPONENT16_OES, width, height); + + //Make the texture to render to. + + glGenTextures(1, &m_Texture); //4 + glBindTexture(GL_TEXTURE_2D, m_Texture); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, + GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + //Now create the actual FBO. + + glGenFramebuffersOES(1, &m_FBO1); //5 + glBindFramebufferOES(GL_FRAMEBUFFER_OES, m_FBO1); + + // Attach the texture to the FBO. + + glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, //6 + GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, m_Texture, 0); + + // Attach the depth buffer we created earlier to our FBO. + + glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, //7 + GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthBuffer); + + // Check that our FBO creation was successful. + + glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); //8 + + GLuint uStatus = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); + + if(uStatus != GL_FRAMEBUFFER_COMPLETE_OES) + { + NSLog(@ "ERROR: Failed to initialise FBO"); + return 0; + } + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glBindFramebufferOES(GL_FRAMEBUFFER_OES, originalFBO); //9 + + return self; +} + +-(GLint)getFBOName //10 +{ + return m_FBO1; +} + +-(GLuint)getTextureName //11 +{ + return m_Texture; +} + +@end diff --git a/Chapter 7/FrameBufferObject/BouncySquare/FrameBufferObject-Info.plist b/Chapter 7/FrameBufferObject/BouncySquare/FrameBufferObject-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/FrameBufferObject-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 7/FrameBufferObject/BouncySquare/FrameBufferObject-Prefix.pch b/Chapter 7/FrameBufferObject/BouncySquare/FrameBufferObject-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/FrameBufferObject-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 7/FrameBufferObject/BouncySquare/assets/hedly.png b/Chapter 7/FrameBufferObject/BouncySquare/assets/hedly.png new file mode 100644 index 0000000..aad5072 Binary files /dev/null and b/Chapter 7/FrameBufferObject/BouncySquare/assets/hedly.png differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/assets/hedly_marked.pvr b/Chapter 7/FrameBufferObject/BouncySquare/assets/hedly_marked.pvr new file mode 100644 index 0000000..ac9e943 Binary files /dev/null and b/Chapter 7/FrameBufferObject/BouncySquare/assets/hedly_marked.pvr differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/assets/moon_highlands.png b/Chapter 7/FrameBufferObject/BouncySquare/assets/moon_highlands.png new file mode 100644 index 0000000..e90cff0 Binary files /dev/null and b/Chapter 7/FrameBufferObject/BouncySquare/assets/moon_highlands.png differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/assets/moon_normal.highlands.png b/Chapter 7/FrameBufferObject/BouncySquare/assets/moon_normal.highlands.png new file mode 100644 index 0000000..bb28687 Binary files /dev/null and b/Chapter 7/FrameBufferObject/BouncySquare/assets/moon_normal.highlands.png differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/assets/usa_normal_hc.png b/Chapter 7/FrameBufferObject/BouncySquare/assets/usa_normal_hc.png new file mode 100644 index 0000000..6755355 Binary files /dev/null and b/Chapter 7/FrameBufferObject/BouncySquare/assets/usa_normal_hc.png differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/assets/usa_texture.png b/Chapter 7/FrameBufferObject/BouncySquare/assets/usa_texture.png new file mode 100644 index 0000000..124f022 Binary files /dev/null and b/Chapter 7/FrameBufferObject/BouncySquare/assets/usa_texture.png differ diff --git a/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/InfoPlist.strings b/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..38ef246 --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..2a0dde6 --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 7/FrameBufferObject/BouncySquare/main.m b/Chapter 7/FrameBufferObject/BouncySquare/main.m new file mode 100644 index 0000000..3dab093 --- /dev/null +++ b/Chapter 7/FrameBufferObject/BouncySquare/main.m @@ -0,0 +1,31 @@ +// +// main.m +// BouncyTexture +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "BouncyTextureAppDelegate.h" + +int main(int argc, char *argv[]) +{ + NSException *exception2; + + @try + { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncyTextureAppDelegate class])); + } + @catch(NSException *exception) + { + exception2=exception; + + NSLog(@"Crash! %@",exception2.reason); + } + + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BouncyTextureAppDelegate class])); + } +} diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.pbxproj b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c450570 --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.pbxproj @@ -0,0 +1,321 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE183220142134520067F631 /* FBOController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE18321F142134520067F631 /* FBOController.m */; }; + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE269CDC141BF49D00704362 /* InfoPlist.strings */; }; + CE269CE0141BF49D00704362 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CDF141BF49D00704362 /* main.m */; }; + CE269CE4141BF49D00704362 /* BouncyTextureAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */; }; + CE269CF1141BF49D00704362 /* BouncyTextureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */; }; + CE59F65D141E880600B8160A /* hedly.png in Resources */ = {isa = PBXBuildFile; fileRef = CE59F65C141E880600B8160A /* hedly.png */; }; + CE59F663141E99FA00B8160A /* hedly_marked.pvr in Resources */ = {isa = PBXBuildFile; fileRef = CE59F662141E99FA00B8160A /* hedly_marked.pvr */; }; + CEFD494F144033F900CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD494B144033F900CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD4950144033F900CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD494D144033F900CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE18321E142134520067F631 /* FBOController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBOController.h; sourceTree = ""; }; + CE18321F142134520067F631 /* FBOController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBOController.m; sourceTree = ""; }; + CE269CCB141BF49D00704362 /* FrameBufferObject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FrameBufferObject.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE269CDB141BF49D00704362 /* FrameBufferObject-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FrameBufferObject-Info.plist"; sourceTree = ""; }; + CE269CDD141BF49D00704362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + CE269CDF141BF49D00704362 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + CE269CE1141BF49D00704362 /* FrameBufferObject-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FrameBufferObject-Prefix.pch"; sourceTree = ""; }; + CE269CE2141BF49D00704362 /* BouncyTextureAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncyTextureAppDelegate.h; sourceTree = ""; }; + CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncyTextureAppDelegate.m; sourceTree = ""; }; + CE269CEF141BF49D00704362 /* BouncyTextureViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BouncyTextureViewController.h; sourceTree = ""; }; + CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BouncyTextureViewController.m; sourceTree = ""; }; + CE59F65C141E880600B8160A /* hedly.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hedly.png; path = assets/hedly.png; sourceTree = ""; }; + CE59F662141E99FA00B8160A /* hedly_marked.pvr */ = {isa = PBXFileReference; lastKnownFileType = file; name = hedly_marked.pvr; path = assets/hedly_marked.pvr; sourceTree = ""; }; + CEFD494C144033F900CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; + CEFD494E144033F900CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE269CD9141BF49D00704362 /* Bouncy Texture */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* FrameBufferObject.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* Bouncy Texture */ = { + isa = PBXGroup; + children = ( + CE269CE2141BF49D00704362 /* BouncyTextureAppDelegate.h */, + CE269CE3141BF49D00704362 /* BouncyTextureAppDelegate.m */, + CE269CEF141BF49D00704362 /* BouncyTextureViewController.h */, + CE269CF0141BF49D00704362 /* BouncyTextureViewController.m */, + CE18321E142134520067F631 /* FBOController.h */, + CE18321F142134520067F631 /* FBOController.m */, + CEFD494B144033F900CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD494D144033F900CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = "Bouncy Texture"; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE59F662141E99FA00B8160A /* hedly_marked.pvr */, + CE59F65C141E880600B8160A /* hedly.png */, + CE269CDB141BF49D00704362 /* FrameBufferObject-Info.plist */, + CE269CDC141BF49D00704362 /* InfoPlist.strings */, + CE269CDF141BF49D00704362 /* main.m */, + CE269CE1141BF49D00704362 /* FrameBufferObject-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* FrameBufferObject */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "FrameBufferObject" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FrameBufferObject; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* FrameBufferObject.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "FrameBufferObject" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* FrameBufferObject */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CDE141BF49D00704362 /* InfoPlist.strings in Resources */, + CE59F65D141E880600B8160A /* hedly.png in Resources */, + CE59F663141E99FA00B8160A /* hedly_marked.pvr in Resources */, + CEFD494F144033F900CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD4950144033F900CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CE0141BF49D00704362 /* main.m in Sources */, + CE269CE4141BF49D00704362 /* BouncyTextureAppDelegate.m in Sources */, + CE269CF1141BF49D00704362 /* BouncyTextureViewController.m in Sources */, + CE183220142134520067F631 /* FBOController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE269CDC141BF49D00704362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE269CDD141BF49D00704362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD494B144033F900CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD494C144033F900CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD494D144033F900CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD494E144033F900CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/FrameBufferObject-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/FrameBufferObject-Info.plist"; + PRODUCT_NAME = FrameBufferObject; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BouncySquare/FrameBufferObject-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "BouncySquare/FrameBufferObject-Info.plist"; + PRODUCT_NAME = FrameBufferObject; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "FrameBufferObject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "FrameBufferObject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3eeb592 --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..90f3bc4 Binary files /dev/null and b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/user.mode1v3 b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..ec122dc --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/user.mode1v3 @@ -0,0 +1,1361 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CE210997141EB78B00FB3E04 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 302 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {302, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {319, 463}} + GroupTreeTableConfiguration + + MainColumn + 302 + + RubberWindowFrame + 169 396 788 504 0 0 1920 1058 + + Module + PBXSmartGroupTreeModule + Proportion + 319pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {464, 260}} + RubberWindowFrame + 169 396 788 504 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 260pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 265}, {464, 198}} + RubberWindowFrame + 169 396 788 504 0 0 1920 1058 + + Module + XCDetailModule + Proportion + 198pt + + + Proportion + 464pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CE0A4E08143111DC00DA368D + 1CE0B1FE06471DED0097A5F4 + CE0A4E09143111DC00DA368D + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CE210998141EB78B00FB3E04 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj + + WindowString + 169 396 788 504 0 0 1920 1058 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + 848 235 500 500 0 0 1920 1058 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + 848 235 500 500 0 0 1920 1058 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CE210998141EB78B00FB3E04 + CE0A4E0A143111DC00DA368D + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 848 235 500 500 0 0 1920 1058 + WindowToolGUID + CE210998141EB78B00FB3E04 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/user.pbxuser b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/user.pbxuser new file mode 100644 index 0000000..2b2b5e1 --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE210986141EB78200FB3E04 /* Bouncy Texture */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = "Bouncy Texture"; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CE21099A141EB78B00FB3E04 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CE21099B141EB78B00FB3E04 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CE210986141EB78200FB3E04 /* Bouncy Texture */; + activeTarget = CE269CCA141BF49D00704362 /* FrameBufferObject */; + codeSenseManager = CE21099B141EB78B00FB3E04 /* Code sense */; + executables = ( + CE210986141EB78200FB3E04 /* Bouncy Texture */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 225, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 338760134; + PBXWorkspaceStateSaveDate = 338760134; + }; + sourceControlManager = CE21099A141EB78B00FB3E04 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* FrameBufferObject */ = { + activeExec = 0; + executables = ( + CE210986141EB78200FB3E04 /* Bouncy Texture */, + ); + }; +} diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/FrameBufferObject.xcscheme b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/FrameBufferObject.xcscheme new file mode 100644 index 0000000..7fe0073 --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/FrameBufferObject.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..9ee4fb7 --- /dev/null +++ b/Chapter 7/FrameBufferObject/FrameBufferObject.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + FrameBufferObject.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 7/OpenGL Lens Flare b/Chapter 7/OpenGL Lens Flare new file mode 160000 index 0000000..4e04b39 --- /dev/null +++ b/Chapter 7/OpenGL Lens Flare @@ -0,0 +1 @@ +Subproject commit 4e04b3900a1dbfb0c0c30965b4dff1653daff0ba diff --git a/Chapter 7/OpenGL_Reflection b/Chapter 7/OpenGL_Reflection new file mode 160000 index 0000000..46f9cd4 --- /dev/null +++ b/Chapter 7/OpenGL_Reflection @@ -0,0 +1 @@ +Subproject commit 46f9cd440831f077bf8bc9f86402f093b220b005 diff --git a/Chapter 7/ShadowCasting b/Chapter 7/ShadowCasting new file mode 160000 index 0000000..055e8a1 --- /dev/null +++ b/Chapter 7/ShadowCasting @@ -0,0 +1 @@ +Subproject commit 055e8a1d95ca9980cb02410c1dba87f54dde764d diff --git a/Chapter 8/.DS_Store b/Chapter 8/.DS_Store new file mode 100644 index 0000000..343f228 Binary files /dev/null and b/Chapter 8/.DS_Store differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/.DS_Store b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/.DS_Store new file mode 100644 index 0000000..15de08c Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/.DS_Store differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.pbxproj b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.pbxproj new file mode 100644 index 0000000..39cc0ac --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.pbxproj @@ -0,0 +1,572 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CCF141BF49D00704362 /* UIKit.framework */; }; + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD1141BF49D00704362 /* Foundation.framework */; }; + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD3141BF49D00704362 /* CoreGraphics.framework */; }; + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD5141BF49D00704362 /* GLKit.framework */; }; + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE269CD7141BF49D00704362 /* OpenGLES.framework */; }; + CE55562614273B8700155657 /* Flare.m in Sources */ = {isa = PBXBuildFile; fileRef = CE55562514273B8700155657 /* Flare.m */; }; + CE55562914273B9100155657 /* LensFlare.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE55562814273B9100155657 /* LensFlare.mm */; }; + CE5556461427F56400155657 /* OpenGLConstellations.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE5556451427F56400155657 /* OpenGLConstellations.mm */; }; + CE5556491427F63F00155657 /* OpenGLStars.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE5556481427F63E00155657 /* OpenGLStars.mm */; }; + CE55564F142800D900155657 /* outlines.plist in Resources */ = {isa = PBXBuildFile; fileRef = CE55564E142800D900155657 /* outlines.plist */; }; + CE555651142800E400155657 /* stars.plist in Resources */ = {isa = PBXBuildFile; fileRef = CE555650142800E400155657 /* stars.plist */; }; + CE55565D142807FE00155657 /* OpenGLOutlines.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE55565C142807FD00155657 /* OpenGLOutlines.mm */; }; + CE555665142809B200155657 /* OpenGLText.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE555662142809B200155657 /* OpenGLText.mm */; }; + CE555666142809B200155657 /* OpenGLUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE555664142809B200155657 /* OpenGLUtils.mm */; }; + CE555669142809C400155657 /* OpenGLCreateTexture.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE555668142809C400155657 /* OpenGLCreateTexture.mm */; }; + CE5556F71428F72500155657 /* flare1.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556DE1428F72500155657 /* flare1.png */; }; + CE5556F81428F72500155657 /* flare2.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556DF1428F72500155657 /* flare2.png */; }; + CE5556F91428F72500155657 /* flare3.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E01428F72500155657 /* flare3.png */; }; + CE5556FA1428F72500155657 /* flare_fuzzy.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E11428F72500155657 /* flare_fuzzy.png */; }; + CE5556FB1428F72500155657 /* flare_spikey.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E21428F72500155657 /* flare_spikey.png */; }; + CE5556FC1428F72500155657 /* gimp_sun.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E31428F72500155657 /* gimp_sun.png */; }; + CE5556FD1428F72500155657 /* gimp_sun1.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E41428F72500155657 /* gimp_sun1.png */; }; + CE5556FE1428F72500155657 /* gimp_sun2.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E51428F72500155657 /* gimp_sun2.png */; }; + CE5556FF1428F72500155657 /* gimp_sun3.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E61428F72500155657 /* gimp_sun3.png */; }; + CE5557001428F72500155657 /* glow.bmp in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E71428F72500155657 /* glow.bmp */; }; + CE5557011428F72500155657 /* glow.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E81428F72500155657 /* glow.png */; }; + CE5557021428F72500155657 /* halo.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556E91428F72500155657 /* halo.png */; }; + CE5557031428F72500155657 /* halo1.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556EA1428F72500155657 /* halo1.png */; }; + CE5557041428F72500155657 /* hexagon.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556EB1428F72500155657 /* hexagon.png */; }; + CE5557051428F72500155657 /* hexagon1.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556EC1428F72500155657 /* hexagon1.png */; }; + CE5557061428F72500155657 /* hexagon_blur.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556ED1428F72500155657 /* hexagon_blur.png */; }; + CE5557071428F72500155657 /* lens_flare_masked.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556EE1428F72500155657 /* lens_flare_masked.png */; }; + CE5557081428F72500155657 /* pentagon.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556EF1428F72500155657 /* pentagon.png */; }; + CE5557091428F72500155657 /* pentagon_blur.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556F01428F72500155657 /* pentagon_blur.png */; }; + CE55570A1428F72500155657 /* solar-glare1.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556F11428F72500155657 /* solar-glare1.png */; }; + CE55570B1428F72500155657 /* sun_surface.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556F21428F72500155657 /* sun_surface.png */; }; + CE55570C1428F72500155657 /* sunglow.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556F31428F72500155657 /* sunglow.png */; }; + CE55570D1428F72500155657 /* sunglow2.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556F41428F72500155657 /* sunglow2.png */; }; + CE55570E1428F72500155657 /* sunglow2.pxm in Resources */ = {isa = PBXBuildFile; fileRef = CE5556F51428F72500155657 /* sunglow2.pxm */; }; + CE55570F1428F72500155657 /* sunglow_hc.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5556F61428F72500155657 /* sunglow_hc.png */; }; + CE55571C1428F73900155657 /* bluebutton-100x35-clipped.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557111428F73900155657 /* bluebutton-100x35-clipped.png */; }; + CE55571D1428F73900155657 /* bluebutton-100x35.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557121428F73900155657 /* bluebutton-100x35.png */; }; + CE55571E1428F73900155657 /* bluebutton.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557131428F73900155657 /* bluebutton.png */; }; + CE55571F1428F73900155657 /* green_dot.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557141428F73900155657 /* green_dot.png */; }; + CE5557201428F73900155657 /* greenbutton-100x35-clipped.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557151428F73900155657 /* greenbutton-100x35-clipped.png */; }; + CE5557211428F73900155657 /* greenbutton-100x35.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557161428F73900155657 /* greenbutton-100x35.png */; }; + CE5557221428F73900155657 /* New UIButton Builder Image.eml in Resources */ = {isa = PBXBuildFile; fileRef = CE5557171428F73900155657 /* New UIButton Builder Image.eml */; }; + CE5557231428F73900155657 /* purplebutton-100x35-clipped.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557181428F73900155657 /* purplebutton-100x35-clipped.png */; }; + CE5557241428F73900155657 /* purplebutton-100x35.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557191428F73900155657 /* purplebutton-100x35.png */; }; + CE5557251428F73900155657 /* redbutton-100x35-clipped.png in Resources */ = {isa = PBXBuildFile; fileRef = CE55571A1428F73900155657 /* redbutton-100x35-clipped.png */; }; + CE5557261428F73900155657 /* redbutton-100x35.png in Resources */ = {isa = PBXBuildFile; fileRef = CE55571B1428F73900155657 /* redbutton-100x35.png */; }; + CE5557281428F78200155657 /* earth_light.png in Resources */ = {isa = PBXBuildFile; fileRef = CE5557271428F78200155657 /* earth_light.png */; }; + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */; }; + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.mm */; }; + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE60A611141C652F000874FC /* InfoPlist.strings */; }; + CE60A616141C654B000874FC /* Planet.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60A615141C654B000874FC /* Planet.m */; }; + CE96CD3A141C6671007DAAA7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD39141C6671007DAAA7 /* main.m */; }; + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.mm */; }; + CECF6233142580CE000B44F7 /* miniglu.mm in Sources */ = {isa = PBXBuildFile; fileRef = CECF6232142580CE000B44F7 /* miniglu.mm */; }; + CEFD48E71440252D00CEB597 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD48E31440252D00CEB597 /* MainStoryboard_iPad.storyboard */; }; + CEFD48E81440252D00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEFD48E51440252D00CEB597 /* MainStoryboard_iPhone.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenGLSolarSystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CE269CCF141BF49D00704362 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CE269CD1141BF49D00704362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + CE269CD3141BF49D00704362 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + CE269CD5141BF49D00704362 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + CE269CD7141BF49D00704362 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystem.h; path = OpenGLSolarSystem/OpenGLSolarSystem.h; sourceTree = SOURCE_ROOT; }; + CE55562414273B8700155657 /* Flare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Flare.h; path = OpenGLSolarSystem/Flare.h; sourceTree = SOURCE_ROOT; }; + CE55562514273B8700155657 /* Flare.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Flare.m; path = OpenGLSolarSystem/Flare.m; sourceTree = SOURCE_ROOT; }; + CE55562714273B9100155657 /* LensFlare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LensFlare.h; path = OpenGLSolarSystem/LensFlare.h; sourceTree = SOURCE_ROOT; }; + CE55562814273B9100155657 /* LensFlare.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LensFlare.mm; path = OpenGLSolarSystem/LensFlare.mm; sourceTree = SOURCE_ROOT; }; + CE5556441427F56400155657 /* OpenGLConstellations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLConstellations.h; path = OpenGLSolarSystem/OpenGLConstellations.h; sourceTree = SOURCE_ROOT; }; + CE5556451427F56400155657 /* OpenGLConstellations.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLConstellations.mm; path = OpenGLSolarSystem/OpenGLConstellations.mm; sourceTree = SOURCE_ROOT; }; + CE5556471427F63E00155657 /* OpenGLStars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLStars.h; path = OpenGLSolarSystem/OpenGLStars.h; sourceTree = SOURCE_ROOT; }; + CE5556481427F63E00155657 /* OpenGLStars.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLStars.mm; path = OpenGLSolarSystem/OpenGLStars.mm; sourceTree = SOURCE_ROOT; }; + CE55564E142800D900155657 /* outlines.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = outlines.plist; path = OpenGLSolarSystem/data/outlines.plist; sourceTree = ""; }; + CE555650142800E400155657 /* stars.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = stars.plist; path = OpenGLSolarSystem/data/stars.plist; sourceTree = ""; }; + CE55565B142807FD00155657 /* OpenGLOutlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLOutlines.h; path = OpenGLSolarSystem/OpenGLOutlines.h; sourceTree = SOURCE_ROOT; }; + CE55565C142807FD00155657 /* OpenGLOutlines.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLOutlines.mm; path = OpenGLSolarSystem/OpenGLOutlines.mm; sourceTree = SOURCE_ROOT; }; + CE555661142809B200155657 /* OpenGLText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLText.h; path = OpenGLSolarSystem/OpenGLText.h; sourceTree = SOURCE_ROOT; }; + CE555662142809B200155657 /* OpenGLText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLText.mm; path = OpenGLSolarSystem/OpenGLText.mm; sourceTree = SOURCE_ROOT; }; + CE555663142809B200155657 /* OpenGLUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLUtils.h; path = OpenGLSolarSystem/OpenGLUtils.h; sourceTree = SOURCE_ROOT; }; + CE555664142809B200155657 /* OpenGLUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLUtils.mm; path = OpenGLSolarSystem/OpenGLUtils.mm; sourceTree = SOURCE_ROOT; }; + CE555667142809C400155657 /* OpenGLCreateTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLCreateTexture.h; path = OpenGLSolarSystem/OpenGLCreateTexture.h; sourceTree = SOURCE_ROOT; }; + CE555668142809C400155657 /* OpenGLCreateTexture.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLCreateTexture.mm; path = OpenGLSolarSystem/OpenGLCreateTexture.mm; sourceTree = SOURCE_ROOT; }; + CE5556DE1428F72500155657 /* flare1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = flare1.png; sourceTree = ""; }; + CE5556DF1428F72500155657 /* flare2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = flare2.png; sourceTree = ""; }; + CE5556E01428F72500155657 /* flare3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = flare3.png; sourceTree = ""; }; + CE5556E11428F72500155657 /* flare_fuzzy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = flare_fuzzy.png; sourceTree = ""; }; + CE5556E21428F72500155657 /* flare_spikey.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = flare_spikey.png; sourceTree = ""; }; + CE5556E31428F72500155657 /* gimp_sun.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gimp_sun.png; sourceTree = ""; }; + CE5556E41428F72500155657 /* gimp_sun1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gimp_sun1.png; sourceTree = ""; }; + CE5556E51428F72500155657 /* gimp_sun2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gimp_sun2.png; sourceTree = ""; }; + CE5556E61428F72500155657 /* gimp_sun3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gimp_sun3.png; sourceTree = ""; }; + CE5556E71428F72500155657 /* glow.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = glow.bmp; sourceTree = ""; }; + CE5556E81428F72500155657 /* glow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = glow.png; sourceTree = ""; }; + CE5556E91428F72500155657 /* halo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo.png; sourceTree = ""; }; + CE5556EA1428F72500155657 /* halo1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo1.png; sourceTree = ""; }; + CE5556EB1428F72500155657 /* hexagon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = hexagon.png; sourceTree = ""; }; + CE5556EC1428F72500155657 /* hexagon1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = hexagon1.png; sourceTree = ""; }; + CE5556ED1428F72500155657 /* hexagon_blur.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = hexagon_blur.png; sourceTree = ""; }; + CE5556EE1428F72500155657 /* lens_flare_masked.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lens_flare_masked.png; sourceTree = ""; }; + CE5556EF1428F72500155657 /* pentagon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pentagon.png; sourceTree = ""; }; + CE5556F01428F72500155657 /* pentagon_blur.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pentagon_blur.png; sourceTree = ""; }; + CE5556F11428F72500155657 /* solar-glare1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "solar-glare1.png"; sourceTree = ""; }; + CE5556F21428F72500155657 /* sun_surface.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sun_surface.png; sourceTree = ""; }; + CE5556F31428F72500155657 /* sunglow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sunglow.png; sourceTree = ""; }; + CE5556F41428F72500155657 /* sunglow2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sunglow2.png; sourceTree = ""; }; + CE5556F51428F72500155657 /* sunglow2.pxm */ = {isa = PBXFileReference; lastKnownFileType = file; path = sunglow2.pxm; sourceTree = ""; }; + CE5556F61428F72500155657 /* sunglow_hc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sunglow_hc.png; sourceTree = ""; }; + CE5557111428F73900155657 /* bluebutton-100x35-clipped.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bluebutton-100x35-clipped.png"; sourceTree = ""; }; + CE5557121428F73900155657 /* bluebutton-100x35.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bluebutton-100x35.png"; sourceTree = ""; }; + CE5557131428F73900155657 /* bluebutton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bluebutton.png; sourceTree = ""; }; + CE5557141428F73900155657 /* green_dot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = green_dot.png; sourceTree = ""; }; + CE5557151428F73900155657 /* greenbutton-100x35-clipped.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "greenbutton-100x35-clipped.png"; sourceTree = ""; }; + CE5557161428F73900155657 /* greenbutton-100x35.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "greenbutton-100x35.png"; sourceTree = ""; }; + CE5557171428F73900155657 /* New UIButton Builder Image.eml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "New UIButton Builder Image.eml"; sourceTree = ""; }; + CE5557181428F73900155657 /* purplebutton-100x35-clipped.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "purplebutton-100x35-clipped.png"; sourceTree = ""; }; + CE5557191428F73900155657 /* purplebutton-100x35.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "purplebutton-100x35.png"; sourceTree = ""; }; + CE55571A1428F73900155657 /* redbutton-100x35-clipped.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "redbutton-100x35-clipped.png"; sourceTree = ""; }; + CE55571B1428F73900155657 /* redbutton-100x35.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "redbutton-100x35.png"; sourceTree = ""; }; + CE5557271428F78200155657 /* earth_light.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = earth_light.png; path = OpenGLSolarSystem/assets/images/earth_light.png; sourceTree = SOURCE_ROOT; }; + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemAppDelegate.h; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h; sourceTree = SOURCE_ROOT; }; + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OpenGLSolarSystemAppDelegate.m; path = OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m; sourceTree = SOURCE_ROOT; }; + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemViewController.h; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.h; sourceTree = SOURCE_ROOT; }; + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLSolarSystemViewController.mm; path = OpenGLSolarSystem/OpenGLSolarSystemViewController.mm; sourceTree = SOURCE_ROOT; }; + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "OpenGLSolarSystem-Info.plist"; path = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; sourceTree = SOURCE_ROOT; }; + CE60A612141C652F000874FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = OpenGLSolarSystem/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; + CE60A614141C653E000874FC /* Planet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Planet.h; path = OpenGLSolarSystem/Planet.h; sourceTree = SOURCE_ROOT; }; + CE60A615141C654B000874FC /* Planet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Planet.m; path = OpenGLSolarSystem/Planet.m; sourceTree = SOURCE_ROOT; }; + CE96CD39141C6671007DAAA7 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = OpenGLSolarSystem/main.m; sourceTree = SOURCE_ROOT; }; + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenGLSolarSystemController.h; path = OpenGLSolarSystem/OpenGLSolarSystemController.h; sourceTree = SOURCE_ROOT; }; + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenGLSolarSystemController.mm; path = OpenGLSolarSystem/OpenGLSolarSystemController.mm; sourceTree = SOURCE_ROOT; }; + CECF6231142580CE000B44F7 /* miniglu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = miniglu.h; path = OpenGLSolarSystem/miniglu.h; sourceTree = SOURCE_ROOT; }; + CECF6232142580CE000B44F7 /* miniglu.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = miniglu.mm; path = OpenGLSolarSystem/miniglu.mm; sourceTree = SOURCE_ROOT; }; + CEFD48E41440252D00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard; sourceTree = SOURCE_ROOT; }; + CEFD48E61440252D00CEB597 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CE269CC8141BF49D00704362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE269CD0141BF49D00704362 /* UIKit.framework in Frameworks */, + CE269CD2141BF49D00704362 /* Foundation.framework in Frameworks */, + CE269CD4141BF49D00704362 /* CoreGraphics.framework in Frameworks */, + CE269CD6141BF49D00704362 /* GLKit.framework in Frameworks */, + CE269CD8141BF49D00704362 /* OpenGLES.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE269CC0141BF49C00704362 = { + isa = PBXGroup; + children = ( + CE5557291428F7BE00155657 /* resources */, + CE55564D1428006A00155657 /* data */, + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */, + CE269CCE141BF49D00704362 /* Frameworks */, + CE269CCC141BF49D00704362 /* Products */, + ); + sourceTree = ""; + }; + CE269CCC141BF49D00704362 /* Products */ = { + isa = PBXGroup; + children = ( + CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */, + ); + name = Products; + sourceTree = ""; + }; + CE269CCE141BF49D00704362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CE269CCF141BF49D00704362 /* UIKit.framework */, + CE269CD1141BF49D00704362 /* Foundation.framework */, + CE269CD3141BF49D00704362 /* CoreGraphics.framework */, + CE269CD5141BF49D00704362 /* GLKit.framework */, + CE269CD7141BF49D00704362 /* OpenGLES.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CE269CD9141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXGroup; + children = ( + CE55562414273B8700155657 /* Flare.h */, + CE55562514273B8700155657 /* Flare.m */, + CE55562714273B9100155657 /* LensFlare.h */, + CE55562814273B9100155657 /* LensFlare.mm */, + CECF6231142580CE000B44F7 /* miniglu.h */, + CECF6232142580CE000B44F7 /* miniglu.mm */, + CE555667142809C400155657 /* OpenGLCreateTexture.h */, + CE555668142809C400155657 /* OpenGLCreateTexture.mm */, + CE5556451427F56400155657 /* OpenGLConstellations.mm */, + CE55565B142807FD00155657 /* OpenGLOutlines.h */, + CE55565C142807FD00155657 /* OpenGLOutlines.mm */, + CE30C32B141DA0FB00CB13FD /* OpenGLSolarSystem.h */, + CE60A5F5141C630E000874FC /* OpenGLSolarSystemAppDelegate.h */, + CE60A5F6141C630E000874FC /* OpenGLSolarSystemAppDelegate.m */, + CE96CD3B141C6E81007DAAA7 /* OpenGLSolarSystemController.h */, + CE96CD3C141C6E82007DAAA7 /* OpenGLSolarSystemController.mm */, + CE60A5F7141C630E000874FC /* OpenGLSolarSystemViewController.h */, + CE60A5F8141C630E000874FC /* OpenGLSolarSystemViewController.mm */, + CE5556441427F56400155657 /* OpenGLConstellations.h */, + CE5556471427F63E00155657 /* OpenGLStars.h */, + CE5556481427F63E00155657 /* OpenGLStars.mm */, + CE555661142809B200155657 /* OpenGLText.h */, + CE555662142809B200155657 /* OpenGLText.mm */, + CE555663142809B200155657 /* OpenGLUtils.h */, + CE555664142809B200155657 /* OpenGLUtils.mm */, + CE60A614141C653E000874FC /* Planet.h */, + CE60A615141C654B000874FC /* Planet.m */, + CEFD48E31440252D00CEB597 /* MainStoryboard_iPad.storyboard */, + CEFD48E51440252D00CEB597 /* MainStoryboard_iPhone.storyboard */, + CE269CDA141BF49D00704362 /* Supporting Files */, + ); + name = OpenGLSolarSystem; + path = BouncySquare; + sourceTree = ""; + }; + CE269CDA141BF49D00704362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + CE96CD39141C6671007DAAA7 /* main.m */, + CE60A600141C6342000874FC /* OpenGLSolarSystem-Info.plist */, + CE60A611141C652F000874FC /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CE5555F314273B7800155657 /* images */ = { + isa = PBXGroup; + children = ( + CE5556DD1428F72500155657 /* Flare */, + CE5557101428F73900155657 /* UI */, + ); + name = images; + path = OpenGLSolarSystem/images; + sourceTree = SOURCE_ROOT; + }; + CE55564D1428006A00155657 /* data */ = { + isa = PBXGroup; + children = ( + CE55564E142800D900155657 /* outlines.plist */, + CE555650142800E400155657 /* stars.plist */, + ); + name = data; + sourceTree = ""; + }; + CE5556DD1428F72500155657 /* Flare */ = { + isa = PBXGroup; + children = ( + CE5556DE1428F72500155657 /* flare1.png */, + CE5556DF1428F72500155657 /* flare2.png */, + CE5556E01428F72500155657 /* flare3.png */, + CE5556E11428F72500155657 /* flare_fuzzy.png */, + CE5556E21428F72500155657 /* flare_spikey.png */, + CE5556E31428F72500155657 /* gimp_sun.png */, + CE5556E41428F72500155657 /* gimp_sun1.png */, + CE5556E51428F72500155657 /* gimp_sun2.png */, + CE5556E61428F72500155657 /* gimp_sun3.png */, + CE5556E71428F72500155657 /* glow.bmp */, + CE5556E81428F72500155657 /* glow.png */, + CE5556E91428F72500155657 /* halo.png */, + CE5556EA1428F72500155657 /* halo1.png */, + CE5556EB1428F72500155657 /* hexagon.png */, + CE5556EC1428F72500155657 /* hexagon1.png */, + CE5556ED1428F72500155657 /* hexagon_blur.png */, + CE5556EE1428F72500155657 /* lens_flare_masked.png */, + CE5556EF1428F72500155657 /* pentagon.png */, + CE5556F01428F72500155657 /* pentagon_blur.png */, + CE5556F11428F72500155657 /* solar-glare1.png */, + CE5556F21428F72500155657 /* sun_surface.png */, + CE5556F31428F72500155657 /* sunglow.png */, + CE5556F41428F72500155657 /* sunglow2.png */, + CE5556F51428F72500155657 /* sunglow2.pxm */, + CE5556F61428F72500155657 /* sunglow_hc.png */, + ); + name = Flare; + path = OpenGLSolarSystem/assets/images/Flare; + sourceTree = SOURCE_ROOT; + }; + CE5557101428F73900155657 /* UI */ = { + isa = PBXGroup; + children = ( + CE5557111428F73900155657 /* bluebutton-100x35-clipped.png */, + CE5557121428F73900155657 /* bluebutton-100x35.png */, + CE5557131428F73900155657 /* bluebutton.png */, + CE5557141428F73900155657 /* green_dot.png */, + CE5557151428F73900155657 /* greenbutton-100x35-clipped.png */, + CE5557161428F73900155657 /* greenbutton-100x35.png */, + CE5557171428F73900155657 /* New UIButton Builder Image.eml */, + CE5557181428F73900155657 /* purplebutton-100x35-clipped.png */, + CE5557191428F73900155657 /* purplebutton-100x35.png */, + CE55571A1428F73900155657 /* redbutton-100x35-clipped.png */, + CE55571B1428F73900155657 /* redbutton-100x35.png */, + ); + name = UI; + path = OpenGLSolarSystem/assets/images/UI; + sourceTree = SOURCE_ROOT; + }; + CE5557291428F7BE00155657 /* resources */ = { + isa = PBXGroup; + children = ( + CE5557271428F78200155657 /* earth_light.png */, + CE5555F314273B7800155657 /* images */, + ); + name = resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + isa = PBXNativeTarget; + buildConfigurationList = CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */; + buildPhases = ( + CE269CC7141BF49D00704362 /* Sources */, + CE269CC8141BF49D00704362 /* Frameworks */, + CE269CC9141BF49D00704362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpenGLSolarSystem; + productName = BouncySquare; + productReference = CE269CCB141BF49D00704362 /* OpenGLSolarSystem.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CE269CC2141BF49C00704362 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CE269CC0141BF49C00704362; + productRefGroup = CE269CCC141BF49D00704362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CE269CC9141BF49D00704362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A613141C652F000874FC /* InfoPlist.strings in Resources */, + CE55564F142800D900155657 /* outlines.plist in Resources */, + CE555651142800E400155657 /* stars.plist in Resources */, + CE5556F71428F72500155657 /* flare1.png in Resources */, + CE5556F81428F72500155657 /* flare2.png in Resources */, + CE5556F91428F72500155657 /* flare3.png in Resources */, + CE5556FA1428F72500155657 /* flare_fuzzy.png in Resources */, + CE5556FB1428F72500155657 /* flare_spikey.png in Resources */, + CE5556FC1428F72500155657 /* gimp_sun.png in Resources */, + CE5556FD1428F72500155657 /* gimp_sun1.png in Resources */, + CE5556FE1428F72500155657 /* gimp_sun2.png in Resources */, + CE5556FF1428F72500155657 /* gimp_sun3.png in Resources */, + CE5557001428F72500155657 /* glow.bmp in Resources */, + CE5557011428F72500155657 /* glow.png in Resources */, + CE5557021428F72500155657 /* halo.png in Resources */, + CE5557031428F72500155657 /* halo1.png in Resources */, + CE5557041428F72500155657 /* hexagon.png in Resources */, + CE5557051428F72500155657 /* hexagon1.png in Resources */, + CE5557061428F72500155657 /* hexagon_blur.png in Resources */, + CE5557071428F72500155657 /* lens_flare_masked.png in Resources */, + CE5557081428F72500155657 /* pentagon.png in Resources */, + CE5557091428F72500155657 /* pentagon_blur.png in Resources */, + CE55570A1428F72500155657 /* solar-glare1.png in Resources */, + CE55570B1428F72500155657 /* sun_surface.png in Resources */, + CE55570C1428F72500155657 /* sunglow.png in Resources */, + CE55570D1428F72500155657 /* sunglow2.png in Resources */, + CE55570E1428F72500155657 /* sunglow2.pxm in Resources */, + CE55570F1428F72500155657 /* sunglow_hc.png in Resources */, + CE55571C1428F73900155657 /* bluebutton-100x35-clipped.png in Resources */, + CE55571D1428F73900155657 /* bluebutton-100x35.png in Resources */, + CE55571E1428F73900155657 /* bluebutton.png in Resources */, + CE55571F1428F73900155657 /* green_dot.png in Resources */, + CE5557201428F73900155657 /* greenbutton-100x35-clipped.png in Resources */, + CE5557211428F73900155657 /* greenbutton-100x35.png in Resources */, + CE5557221428F73900155657 /* New UIButton Builder Image.eml in Resources */, + CE5557231428F73900155657 /* purplebutton-100x35-clipped.png in Resources */, + CE5557241428F73900155657 /* purplebutton-100x35.png in Resources */, + CE5557251428F73900155657 /* redbutton-100x35-clipped.png in Resources */, + CE5557261428F73900155657 /* redbutton-100x35.png in Resources */, + CE5557281428F78200155657 /* earth_light.png in Resources */, + CEFD48E71440252D00CEB597 /* MainStoryboard_iPad.storyboard in Resources */, + CEFD48E81440252D00CEB597 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CE269CC7141BF49D00704362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE60A5F9141C630E000874FC /* OpenGLSolarSystemAppDelegate.m in Sources */, + CE60A5FA141C630E000874FC /* OpenGLSolarSystemViewController.mm in Sources */, + CE60A616141C654B000874FC /* Planet.m in Sources */, + CE96CD3A141C6671007DAAA7 /* main.m in Sources */, + CE96CD3D141C6E82007DAAA7 /* OpenGLSolarSystemController.mm in Sources */, + CECF6233142580CE000B44F7 /* miniglu.mm in Sources */, + CE55562614273B8700155657 /* Flare.m in Sources */, + CE55562914273B9100155657 /* LensFlare.mm in Sources */, + CE5556461427F56400155657 /* OpenGLConstellations.mm in Sources */, + CE5556491427F63F00155657 /* OpenGLStars.mm in Sources */, + CE55565D142807FE00155657 /* OpenGLOutlines.mm in Sources */, + CE555665142809B200155657 /* OpenGLText.mm in Sources */, + CE555666142809B200155657 /* OpenGLUtils.mm in Sources */, + CE555669142809C400155657 /* OpenGLCreateTexture.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + CE60A611141C652F000874FC /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + CE60A612141C652F000874FC /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + CEFD48E31440252D00CEB597 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD48E41440252D00CEB597 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + CEFD48E51440252D00CEB597 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEFD48E61440252D00CEB597 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CE269CF2141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CE269CF3141BF49D00704362 /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CE269CF5141BF49D00704362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + CE269CF6141BF49D00704362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch"; + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + INFOPLIST_FILE = "OpenGLSolarSystem/OpenGLSolarSystem-Info.plist"; + PRODUCT_NAME = OpenGLSolarSystem; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CE269CC5141BF49C00704362 /* Build configuration list for PBXProject "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF2141BF49D00704362 /* Debug */, + CE269CF3141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CE269CF4141BF49D00704362 /* Build configuration list for PBXNativeTarget "OpenGLSolarSystem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CE269CF5141BF49D00704362 /* Debug */, + CE269CF6141BF49D00704362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CE269CC2141BF49C00704362 /* Project object */; +} diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41c6fd1 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ba75e6f Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..6ff33e6 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/user.mode1v3 b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/user.mode1v3 new file mode 100644 index 0000000..aefe527 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/user.mode1v3 @@ -0,0 +1,1363 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + CEF317C6141C662400ADE1D0 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + clean-target + debugger-enable-breakpoints + buildOrClean + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + takeSnapshot + servicesModuleSnapshots + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 404 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + CE269CC0141BF49C00704362 + CE269CD9141BF49D00704362 + CE269CDA141BF49D00704362 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {404, 445}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {421, 463}} + GroupTreeTableConfiguration + + MainColumn + 404 + + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXSmartGroupTreeModule + Proportion + 421pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + MyNewFile14.java + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {362, 269}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 269pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 274}, {362, 189}} + RubberWindowFrame + -1396 553 788 504 -1680 30 1680 1050 + + Module + XCDetailModule + Proportion + 189pt + + + Proportion + 362pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + CEC41BFA1425589D00B160CA + 1CE0B1FE06471DED0097A5F4 + CEC41BFB1425589D00B160CA + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer 4.3/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 2 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + CEF317C7141C662400ADE1D0 + /Users/user/iPhoneProjects1/OpenGL Book/Re-tweak Exercises/Chapter 8/OpenGLSolarSystem-with texture/OpenGLSolarSystem.xcodeproj + + WindowString + -1396 553 788 504 -1680 30 1680 1050 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {500, 218}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 223}, {500, 236}} + RubberWindowFrame + -1375 534 500 500 -1680 30 1680 1050 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 459pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + CEF317C7141C662400ADE1D0 + CEC41BFC1425589D00B160CA + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + -1375 534 500 500 -1680 30 1680 1050 + WindowToolGUID + CEF317C7141C662400ADE1D0 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + Identifier + windowTool.debuggerConsole + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 250}} + RubberWindowFrame + 516 632 650 250 0 0 1680 1027 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAAD065D492600B07095 + 1C78EAAE065D492600B07095 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 650 41 650 250 0 0 1280 1002 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/user.pbxuser b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/user.pbxuser new file mode 100644 index 0000000..82dda4a --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/user.pbxuser @@ -0,0 +1,88 @@ +// !$*UTF8*$! +{ + CE269CC2141BF49C00704362 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */; + activeTarget = CE269CCA141BF49D00704362 /* OpenGLSolarSystem */; + codeSenseManager = CEF317CA141C662400ADE1D0 /* Code sense */; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 123, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 337991822; + PBXWorkspaceStateSaveDate = 337991822; + }; + sourceControlManager = CEF317C9141C662400ADE1D0 /* Source Control */; + userBuildSettings = { + }; + }; + CE269CCA141BF49D00704362 /* OpenGLSolarSystem */ = { + activeExec = 0; + executables = ( + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */, + ); + }; + CEF317BB141C660B00ADE1D0 /* OpenGLSolarSystem */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = OpenGLSolarSystem; + showTypeColumn = 0; + sourceDirectories = ( + ); + }; + CEF317C9141C662400ADE1D0 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + CEF317CA141C662400ADE1D0 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; +} diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme new file mode 100644 index 0000000..d1a3e4a --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/OpenGLSolarSystem.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e123ef3 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + OpenGLSolarSystem.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE269CCA141BF49D00704362 + + primary + + + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/.DS_Store b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/.DS_Store new file mode 100644 index 0000000..4e07fdf Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/.DS_Store differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Flare.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Flare.h new file mode 100644 index 0000000..597cbb9 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Flare.h @@ -0,0 +1,32 @@ +// +// Flare.h +// OpenGL Lens Flare +// +// Created by mike on 7/25/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import +#import +#import +#import +#import + +@interface Flare : NSObject +{ + GLfloat m_Size; + GLfloat m_Red; + GLfloat m_Green; + GLfloat m_Blue; + GLfloat m_Alpha; + GLfloat m_VectorPosition; + GLuint m_Name; +} + +-(id)init:(NSString *)filename size:(GLfloat)size vectorPosition:(GLfloat)vectorPosition r:(GLfloat)r g:(GLfloat)g b:(GLfloat)b a:(GLfloat)a; +-(void)renderFlareAt:(CGPoint)position scale:(float)scale alpha:(float)alpha; +-(GLfloat)getVectorPosition; + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Flare.m b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Flare.m new file mode 100644 index 0000000..823348a --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Flare.m @@ -0,0 +1,66 @@ +// +// Flare.m +// OpenGL Lens Flare +// +// Created by mike on 7/25/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLCreateTexture.h" + +#import "Flare.h" +//#import "OpenGLCreateTexture.h" + +@implementation Flare + +/************************************************************************************ + * init: initializes an individual flare. * + ************************************************************************************ + * filename: the filename, duh. No path needed. * + * size: the "basic" core size. Used to vary the sizes of duplicate bitmaps * + * opacity: alpha. * + * position: position along the light vector. The sum total of positions across all * + * the flares should be 2, going from -1 to 1. * + * r,g,b: normalized. * + ************************************************************************************/ +-(id)init:(NSString *)filename size:(GLfloat)size vectorPosition:(GLfloat)vectorPosition r:(GLfloat)r g:(GLfloat)g b:(GLfloat)b a:(GLfloat)a +{ + OpenGLCreateTexture *ct; + GLKTextureInfo *texture; + + self = [super init]; + + if (self) + { + ct=[OpenGLCreateTexture getObject]; + + texture=[ct loadTexture:filename]; + + m_Name=texture.name; + m_Size=size; + m_VectorPosition=vectorPosition; + m_Red=r; + m_Green=g; + m_Blue=b; + m_Alpha=a; + + m_Red*=m_Alpha; + m_Green*=m_Alpha; + m_Blue*=m_Alpha; + } + + return self; +} + +-(GLfloat)getVectorPosition +{ + return m_VectorPosition; +} + +-(void)renderFlareAt:(CGPoint)position scale:(float)scale alpha:(float)alpha +{ + [[OpenGLCreateTexture getObject]renderTextureAt:position + name:m_Name size:m_Size*scale r:m_Red*alpha g:m_Green*alpha b:m_Blue*alpha a:alpha]; +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/LensFlare.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/LensFlare.h new file mode 100644 index 0000000..49aab93 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/LensFlare.h @@ -0,0 +1,26 @@ +// +// LensFlare.h +// OpenGL Lens Flare +// +// Created by mike on 7/25/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + + +#import + +#import +#import +#import +#import +#import + +@interface LensFlare : NSObject +{ + NSMutableArray *m_Flares; +} + +-(void)createFlares; +-(void)execute:(CGRect)frame source:(CGPoint)source scale:(float)scale alpha:(float)alpha; + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/LensFlare.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/LensFlare.mm new file mode 100644 index 0000000..398a341 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/LensFlare.mm @@ -0,0 +1,135 @@ +// +// LensFlare.mm +// OpenGL Lens Flare +// +// Created by mike on 7/25/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "Flare.h" +#import "LensFlare.h" +//#import "OpenGL_CreateTexture.h" + +@implementation LensFlare + +- (id)init +{ + self = [super init]; + + if (self) + { + [self createFlares]; + } + + return self; +} + +-(void)createFlares +{ + m_Flares=[NSMutableArray array]; + + GLfloat ff=.004; + + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.0 vectorPosition:(.05-ff) r:1.0 g:0.73 b:0.30 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:1.5 vectorPosition:(.055-ff) r:1.0 g:0.73 b:0.50 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.5 vectorPosition:(.06-ff) r:.75 g:1.00 b:0.40 a:.2]]; + [m_Flares addObject:[[Flare alloc]init:@"halo.png" size:0.5 vectorPosition:(.030-ff) r:1.0 g:0.73 b:0.20 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"halo.png" size:0.3 vectorPosition:(.05-ff) r:1.0 g:0.85 b:0.40 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:0.3 vectorPosition:(.065-ff) r:0.5 g:0.95 b:0.56 a:.33]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:0.3 vectorPosition:(.03-ff) r:1.0 g:0.85 b:0.56 a:.35]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:0.35 vectorPosition:(.05-ff) r:1.0 g:0.90 b:0.40 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:1.5 vectorPosition:(.07-ff) r:0.8 g:0.95 b:0.56 a:.55]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:0.3 vectorPosition:(.06-ff) r:1.0 g:0.85 b:0.56 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"halo.png" size:1.5 vectorPosition:(.02-ff) r:1.0 g:0.85 b:0.56 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:0.5 vectorPosition:(.068-ff) r:1.0 g:0.85 b:0.56 a:.45]]; + [m_Flares addObject:[[Flare alloc]init:@"flare_fuzzy.png" size:0.5 vectorPosition:(.03-ff) r:1.0 g:0.85 b:0.56 a:.45]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:0.3 vectorPosition:(.017-ff) r:1.0 g:0.85 b:0.56 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:0.25 vectorPosition:(.06-ff) r:1.0 g:0.85 b:0.56 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:1.5 vectorPosition:(.09-ff) r:1.0 g:0.85 b:0.56 a:.44]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:0.56 vectorPosition:(.065-ff) r:0.5 g:0.95 b:0.56 a:.33]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:0.56 vectorPosition:(.071-ff) r:0.5 g:0.85 b:0.56 a:.65]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.0 vectorPosition:(.01-ff) r:1.0 g:0.85 b:0.56 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:0.25 vectorPosition:(.030-ff) r:1.0 g:0.70 b:0.50 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:1.5 vectorPosition:(.02-ff) r:1.0 g:0.70 b:0.56 a:.5]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.0 vectorPosition:(.018-ff) r:1.0 g:0.60 b:0.25 a:.5]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.0 vectorPosition:(.035-ff) r:1.0 g:0.75 b:0.56 a:.35]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:10.0 vectorPosition:(0.0) r:1.0 g:0.60 b:0.56 a:1.0]]; + +/* + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.0 vectorPosition:(.05-ff) r:1.0 g:0.73 b:0.30 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:1.5 vectorPosition:(.055-ff) r:1.0 g:0.73 b:0.50 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"pentagon_blur.png" size:1.5 vectorPosition:(.06-ff) r:.75 g:1.00 b:0.40 a:.2]]; + [m_Flares addObject:[[Flare alloc]init:@"halo.png" size:0.5 vectorPosition:(.030-ff) r:1.0 g:0.73 b:0.20 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"halo.png" size:0.3 vectorPosition:(.05-ff) r:1.0 g:0.85 b:0.40 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:0.3 vectorPosition:(.065-ff) r:0.5 g:0.95 b:0.56 a:.33]]; + [m_Flares addObject:[[Flare alloc]init:@"pentagon.png" size:0.3 vectorPosition:(.03-ff) r:1.0 g:0.85 b:0.56 a:.35]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:0.35 vectorPosition:(.05-ff) r:1.0 g:0.90 b:0.40 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:1.5 vectorPosition:(.07-ff) r:0.8 g:0.95 b:0.56 a:.55]]; + [m_Flares addObject:[[Flare alloc]init:@"pentagon_blur.png" size:0.3 vectorPosition:(.06-ff) r:1.0 g:0.85 b:0.56 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"halo.png" size:1.5 vectorPosition:(.02-ff) r:1.0 g:0.85 b:0.56 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:0.5 vectorPosition:(.068-ff) r:1.0 g:0.85 b:0.56 a:.45]]; + [m_Flares addObject:[[Flare alloc]init:@"flare_fuzzy.png" size:0.5 vectorPosition:(.03-ff) r:1.0 g:0.85 b:0.56 a:.45]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:0.3 vectorPosition:(.017-ff) r:1.0 g:0.85 b:0.56 a:.4]]; + [m_Flares addObject:[[Flare alloc]init:@"pentagon_blur.png" size:0.25 vectorPosition:(.06-ff) r:1.0 g:0.85 b:0.56 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:1.5 vectorPosition:(.09-ff) r:1.0 g:0.85 b:0.56 a:.44]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:0.56 vectorPosition:(.065-ff) r:0.5 g:0.95 b:0.56 a:.33]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon.png" size:0.56 vectorPosition:(.071-ff) r:0.5 g:0.85 b:0.56 a:.65]]; + [m_Flares addObject:[[Flare alloc]init:@"pentagon.png" size:1.0 vectorPosition:(.01-ff) r:1.0 g:0.85 b:0.56 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:0.25 vectorPosition:(.030-ff) r:1.0 g:0.70 b:0.50 a:.3]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:1.5 vectorPosition:(.02-ff) r:1.0 g:0.70 b:0.56 a:.5]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.0 vectorPosition:(.018-ff) r:1.0 g:0.60 b:0.25 a:.5]]; + [m_Flares addObject:[[Flare alloc]init:@"hexagon_blur.png" size:1.0 vectorPosition:(.035-ff) r:1.0 g:0.75 b:0.56 a:.35]]; + [m_Flares addObject:[[Flare alloc]init:@"glow.png" size:10.0 vectorPosition:(0.0) r:1.0 g:0.60 b:0.56 a:.55]]; +*/ + //the sun is on this side of the streak +} + +-(void)execute:(CGRect)frame source:(CGPoint)source scale:(float)scale alpha:(float)alpha +{ + CGPoint position; + NSEnumerator *e; + Flare *object; + + static GLfloat deltaX=40,deltaY=40; + static GLfloat offsetFromCenterX,offsetFromCenterY; + static GLfloat startingOffsetFromCenterX,startingOffsetFromCenterY; + + int numElements; + GLfloat cx,cy; + + static int counter=0; + + e=[m_Flares objectEnumerator]; + + cx=(frame.size.width/2.0); + cy=(frame.size.height/2.0); + + startingOffsetFromCenterX=cx-source.x; + startingOffsetFromCenterY=source.y-cy; + + offsetFromCenterX=startingOffsetFromCenterX; + offsetFromCenterY=startingOffsetFromCenterY; + + numElements=[m_Flares count]; + + deltaX=2.0*startingOffsetFromCenterX; + deltaY=2.0*startingOffsetFromCenterY; + + while (object = [e nextObject]) + { + position=CGPointMake(offsetFromCenterX,offsetFromCenterY); + + [object renderFlareAt:position scale:scale alpha:alpha]; + + // if(!(counter%50)) + // NSLog(@"Execute x=%f, y=%f, deltax=%f, deltay=%y\n",position.x,position.y,deltaX,deltaY); + + + offsetFromCenterX-=deltaX*[object getVectorPosition]; + offsetFromCenterY-=deltaY*[object getVectorPosition]; + } + + counter++; +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLConstellations.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLConstellations.h new file mode 100644 index 0000000..271303d --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLConstellations.h @@ -0,0 +1,21 @@ +// +// OpenGLConstellations.h +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import "OpenGLOutlines.h" +#import "OpenGLStars.h" + +@interface OpenGLConstellations : NSObject +{ + OpenGLOutlines *m_Outlines; + OpenGLStars *m_Stars; +} + +-(void)execute:(BOOL)constOutlinesOn names:(BOOL)constNamesOn; + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLConstellations.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLConstellations.mm new file mode 100644 index 0000000..b925a72 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLConstellations.mm @@ -0,0 +1,33 @@ +// +// OpenGLConstellations.m +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLConstellations.h" + +@implementation OpenGLConstellations + +- (id)init +{ + self = [super init]; + + if (self) + { + m_Outlines=[[OpenGLOutlines alloc]init]; + m_Stars=[[OpenGLStars alloc]init]; + } + + return self; +} + +-(void)execute:(BOOL)constOutlinesOn names:(BOOL)constNamesOn +{ + [m_Outlines execute:constOutlinesOn showNames:constNamesOn]; + + [m_Stars execute]; +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLCreateTexture.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLCreateTexture.h new file mode 100644 index 0000000..c99e654 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLCreateTexture.h @@ -0,0 +1,23 @@ +// +// OpenGLCreateTexture.h +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + + +@interface OpenGLCreateTexture : NSObject + +-(id)init; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; ++(OpenGLCreateTexture *)getObject; ++(id)allocWithZone:(NSZone *)zone; +-(void)renderTextureAt:(CGPoint)position name:(GLuint)name + size:(GLfloat)size r:(GLfloat)r g:(GLfloat)g b:(GLfloat)b a:(GLfloat)a; +-(void)renderTextureInRect:(CGRect)rect name:(GLuint)name depth:(GLfloat)depth + r:(GLfloat)r g:(GLfloat)g b:(GLfloat)b a:(GLfloat)a; +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLCreateTexture.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLCreateTexture.mm new file mode 100644 index 0000000..7fa92de --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLCreateTexture.mm @@ -0,0 +1,212 @@ +// +// OpenGLCreateTexture.m +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLCreateTexture.h" + +static OpenGLCreateTexture *m_Singleton; + +@implementation OpenGLCreateTexture + + +- (id)init +{ + if (self) + { + } + + return self; +} + ++(OpenGLCreateTexture *)getObject +{ + @synchronized(self) + { + if(m_Singleton==nil) + { + [[self alloc]init]; + } + } + + return m_Singleton; +} + ++ (id)allocWithZone:(NSZone *)zone +{ + @synchronized(self) + { + if (m_Singleton == nil) + { + m_Singleton = [super allocWithZone:zone]; + return m_Singleton; // assignment and return on first alUI + } + } + return nil; //on subsequent allocation attempts return nil +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:NULL error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + + +-(void)renderTextureInRect:(CGRect)rect name:(GLuint)name depth:(GLfloat)depth + r:(GLfloat)r g:(GLfloat)g b:(GLfloat)b a:(GLfloat)a //1 +{ + CGRect frame = [[UIScreen mainScreen] bounds]; + + GLfloat vertices[] = + { + rect.origin.x, rect.origin.y, depth, + rect.origin.x + rect.size.width,rect.origin.y, depth, + rect.origin.x, rect.size.height+rect.origin.y ,depth, + rect.origin.x + rect.size.width,rect.size.height+rect.origin.y ,depth + }; + + static GLfloat textureCoords[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnable(GL_TEXTURE_2D); + + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + + glDisable(GL_LIGHTING); //2 + glEnable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisableClientState(GL_COLOR_ARRAY); + + glOrthof(0,frame.size.width,frame.size.height,0,0,1000); //3 + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glColor4f(r,g,b,a); + + glBindTexture(GL_TEXTURE_2D,name); + glVertexPointer(3, GL_FLOAT, 0, vertices); + glTexCoordPointer(2, GL_FLOAT,0,textureCoords); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); + + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + + glEnable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + glDisable(GL_DEPTH_TEST); + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); +} + +-(void)renderTextureAt:(CGPoint)position name:(GLuint)name + size:(GLfloat)size r:(GLfloat)r g:(GLfloat)g b:(GLfloat)b a:(GLfloat)a +{ + + + float scaledX,scaledY; + GLfloat zoomBias=.1; + GLfloat scaledSize; + + static const GLfloat squareVertices[] = + { + -1.0f, -1.0f, 0.0, + 1.0f, -1.0f, 0.0, + -1.0f, 1.0f, 0.0, + 1.0f, 1.0f, 0.0, + }; + + static GLfloat textureCoords[] = + { + 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 1.0, 1.0 + }; + + CGRect frame = [[UIScreen mainScreen] bounds]; + float aspectRatio=frame.size.height/frame.size.width; + + scaledX=2.0*position.x/frame.size.width; + scaledY=(2.0*position.y/frame.size.height)*aspectRatio; + + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); //2 + + glDisable(GL_CULL_FACE); + glDisableClientState(GL_COLOR_ARRAY); + + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + + glOrthof(-1,1,-1.0*aspectRatio,1.0*aspectRatio, -1, 1); //3 + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glTranslatef(scaledX,scaledY,0); + + scaledSize=zoomBias*size; + + glScalef(scaledSize,scaledSize, 1); + + glVertexPointer(3, GL_FLOAT, 0, squareVertices); + glEnableClientState(GL_VERTEX_ARRAY); + + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_COLOR); + glBindTexture(GL_TEXTURE_2D,name); + glTexCoordPointer(2, GL_FLOAT,0,textureCoords); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glColor4f(r,g,b,a); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); + + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHTING); +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLOutlines.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLOutlines.h new file mode 100644 index 0000000..34cfe71 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLOutlines.h @@ -0,0 +1,21 @@ + +#import +#import +#import +#include + + +@interface OpenGLOutlines : NSObject +{ + NSMutableArray *m_Data; + GLfloat m_Red; + GLfloat m_Green; + GLfloat m_Blue; + GLfloat m_Alpha; +} + +-(OpenGLOutlines *)init:(NSString *)filename red:(GLfloat)red green:(GLfloat)green blue:(GLfloat)blue alpha:(GLfloat)alpha; +-(void)execute:(BOOL)showLines showNames:(BOOL)showNames; + + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLOutlines.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLOutlines.mm new file mode 100644 index 0000000..f19c6de --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLOutlines.mm @@ -0,0 +1,234 @@ + + +#import "OpenGLOutlines.h" +#import "OpenGLUtils.h" +#import "OpenGLSolarSystem.h" +#import "OpenGLText.h" + +#import "miniGLU.h" + +@implementation OpenGLOutlines + +- (id)init +{ + self = [super init]; + + if (self) + { + self=[self init:@"outlines" red:0.0 green:1.0 blue:1.0 alpha:.1]; + } + + return self; +} + + +-(OpenGLText *)createLabel:(NSString *)label +{ + float fontSize=20; + CGSize size; + OpenGLText *labelTexture; + GLfloat scale; + + scale=[[UIScreen mainScreen] scale]; + + UIFont *tempFont=[UIFont fontWithName:@"Copperplate" size:fontSize*scale]; + + size=[label sizeWithFont:tempFont]; + + labelTexture=[[OpenGLText alloc]initWithText:label size:size alignment:UITextAlignmentLeft font:tempFont]; + + return labelTexture; +} + +-(OpenGLOutlines *)init:(NSString *)filename red:(GLfloat)red green:(GLfloat)green blue:(GLfloat)blue alpha:(GLfloat)alpha +{ + float x,y,z; + int i,j; + NSNumber *ra,*dec; + NSMutableArray *coordArray; //numbers in order: ra,dec, x,y,z + OpenGLText *nameTexture; + NSMutableDictionary *dict; + NSString *thePath = [[NSBundle mainBundle] pathForResource:filename ofType:@"plist"]; + int numpoints=0; + GLfloat *data; + int numbytes; + int index=0; + NSMutableDictionary *coords; + NSString *name; + NSData *nsdata; + + m_Red=red; + m_Green=green; + m_Blue=blue; + m_Alpha=alpha; + + m_Data = [[NSMutableArray alloc] initWithContentsOfFile:thePath]; + + //convert the ra/dec to xyz + + for(i=0;i<[m_Data count];i++) //each i is a different outline set. + { + dict=[m_Data objectAtIndex:i]; //object points to each outline set + + name=[dict objectForKey:@"name"]; + + if([name length]) //some objects might not have a name + { + ra=(NSNumber *)[dict objectForKey:@"name_ra"]; + dec=(NSNumber *)[dict objectForKey:@"name_dec"]; + + [[OpenGLUtils getObject]sphereToRectTheta:15.0*[ra floatValue]/DEGREES_PER_RADIAN phi:[dec floatValue]/DEGREES_PER_RADIAN radius:STANDARD_RADIUS xprime:&x yprime:&y zprime:&z]; + + numbytes=3*sizeof(GLfloat); + data=(GLfloat *)malloc(3*sizeof(numbytes)); //store the xyz of the name + data[0]=x; + data[1]=y; + data[2]=z; + nsdata=[[NSData alloc]initWithBytes:data length:numbytes]; + + [dict setObject:nsdata forKey:@"binary_name_coords"]; + + nameTexture=[self createLabel:name]; + + [dict setObject:nameTexture forKey:@"name_texture"]; + } + + //now grab the line coordinates; + + coordArray=[dict objectForKey:@"coordinates"]; + + numpoints=[coordArray count]; + + numbytes=numpoints*3*sizeof(GLfloat); //3 for x,y and z + + data=(GLfloat *)malloc(numbytes); + + for(j=0;j0) + { + glVertexPointer(3,GL_FLOAT,0,data); + + glDrawArrays(GL_LINE_STRIP,0,numVertices); + } + } + } + + if(showNames) + { + for(i=0;i0) + { + OpenGLText *nameTexture; + + nameTexture=(OpenGLText *)[object objectForKey:@"name_texture"]; + [nameTexture renderAtPoint:CGPointMake(sx,sy) depth:STANDARD_RADIUS red:0.6 green:.1 blue:.2 alpha:0.0]; + } + } + } + } +end: + + glDisableClientState(GL_VERTEX_ARRAY); + glPopMatrix(); + glEnable(GL_LIGHTING); +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist new file mode 100644 index 0000000..4d5b6dc --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem-Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + First-Light.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..9a7374f --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BouncySquare' target in the 'BouncySquare' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem.h new file mode 100644 index 0000000..ced6259 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystem.h @@ -0,0 +1,22 @@ +// +// OpenGLSolarSystem.h +// OpenGLSolarSystem +// +// Created by mike on 9/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#ifndef OpenGLSolarSystem_OpenGLSolarSystem_h +#define OpenGLSolarSystem_OpenGLSolarSystem_h + +#import +#define SS_SUNLIGHT GL_LIGHT0 //GL uses GL_LIGHTx +#define SS_FILLLIGHT1 GL_LIGHT1 +#define SS_FILLLIGHT2 GL_LIGHT2 +#define SS_AMBIENTLIGHT GL_LIGHT3 + +#define RADIANS_PER_90_DEGREES 1.570796326794897 +#define DEGREES_PER_RADIAN 57.2977 +#define STANDARD_RADIUS 1000.0 + +#endif diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..c1338c5 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.h @@ -0,0 +1,15 @@ +// +// OpenGLSolarSystemAppDelegate.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLSolarSystemAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..5947682 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemAppDelegate.m @@ -0,0 +1,60 @@ +// +// OpenGLSolarSystemAppDelegate.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystemAppDelegate.h" + +@implementation OpenGLSolarSystemAppDelegate + +@synthesize window = _window; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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 diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemController.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemController.h new file mode 100644 index 0000000..c534ab5 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemController.h @@ -0,0 +1,53 @@ +// +// OpenGLSolarSystemController.h +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// +#import +#import +#import "miniglu.h" +#import "Planet.h" +#import "LensFlare.h" +#import "OpenGLCreateTexture.h" +#import "OpenGLConstellations.h" + +#define X_VALUE 0 +#define Y_VALUE 1 +#define Z_VALUE 2 + +#define STANDARD_FOV 30.0 //in degrees + +@interface OpenGLSolarSystemController : NSObject +{ + Planet *m_Earth; + Planet *m_Sun; + GLKVector3 m_Eyeposition; + float m_FieldOfView; + LensFlare *m_LensFlare; + GLKTextureInfo *m_FlareSource; + + OpenGLConstellations *m_Constellations; + + BOOL m_ConstNamesOn; + BOOL m_ConstOutlinesOn; + BOOL m_LensFlareOn; +} + +-(void)execute; +-(void)executePlanet:(Planet *)planet sx:(float *)sx sy:(float *)sy sz:(float *)sz + screenRadius:(float *)screenRadius render:(BOOL)render; +-(id)init; +-(void)initGeometry; +-(void)setClipping; +-(float)getFieldOfView; +-(void)setFieldOfView:(float)fov; +-(GLKVector3)getTargetLocation; +-(void)lookAtTarget; +-(GLKVector3)getEyeposition; +-(void)setEyeposition:(GLKVector3)loc; +-(void)setFeatureNames:(BOOL)constNames outlines:(BOOL)constOutlines lensFlare:(BOOL)lensFlare; + +@end + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemController.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemController.mm new file mode 100644 index 0000000..ff2ffdc --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemController.mm @@ -0,0 +1,244 @@ +// +// OpenGLSolarSystemController.m +// OpenGLSolarSystemController +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLCreateTexture.h" +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" + +@implementation OpenGLSolarSystemController + +-(id)init +{ + m_FieldOfView=30.0; + [self initGeometry]; + [self setClipping]; + + m_LensFlare=[[LensFlare alloc]init]; + + m_FlareSource=[[OpenGLCreateTexture getObject]loadTexture:@"gimp_sun3.png"]; + + m_Constellations=[[OpenGLConstellations alloc]init]; + + return self; +} + +-(void)initGeometry +{ + //Let 1.0=1 million miles. + // The sun's radius=.4. + // The earth's radius=.04 (10x larger to make it easier to see). + + m_Eyeposition=GLKVector3Make(0.0, 0.0, 93.25); + + m_Earth=[[Planet alloc] init:48 slices:48 radius:0.04 + squash:1.0 textureFile:@"earth_light.png"]; + + [m_Earth setPositionX:0.0 Y:0.0 Z:93.0]; + + m_Sun=[[Planet alloc] init:48 slices:48 radius:0.4 + squash:1.0 textureFile:@"sun_surface.png"]; +} + +-(void)execute +{ + float earth_sx,earth_sy,earth_sz,earth_sr; + float sun_sx,sun_sy,sun_sz,sun_sr; + GLfloat paleYellow[]={1.0,1.0,0.3,1.0}; + GLfloat white[]={1.0,1.0,1.0,1.0}; + GLfloat cyan[]={0.0,1.0,1.0,1.0}; + GLfloat black[]={0.0,0.0,0.0,0.0}; + GLfloat sunPos[4]={0.0,0.0,0.0,1.0}; + + glMatrixMode(GL_MODELVIEW); + glShadeModel(GL_SMOOTH); + glEnable(GL_LIGHTING); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + [m_Constellations execute:m_ConstOutlinesOn names:m_ConstNamesOn]; + + glPushMatrix(); + + glTranslatef(-m_Eyeposition.x,-m_Eyeposition.y,-m_Eyeposition.z); //1 + + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); + glEnable(SS_SUNLIGHT); + + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, paleYellow); + + [self executePlanet:m_Sun sx:&sun_sx sy:&sun_sy sz:&sun_sz //2 + screenRadius:&sun_sr render:FALSE]; + + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, black); + + glPopMatrix(); + + if((m_LensFlare!=NULL) && (sun_sz>0)) //3 + { + float sunWidth=75; //4 + + sunWidth*=(sun_sr/5.0); + + [[OpenGLCreateTexture getObject]renderTextureInRect: //5 + CGRectMake(sun_sx-sunWidth/2.0, sun_sy-sunWidth/2.0,sunWidth,sunWidth) + name:m_FlareSource.name depth:-10 r:1.0 g:1.0 b:1.0 a:1.0]; + } + + glEnable(SS_FILLLIGHT2); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + + glTranslatef(-m_Eyeposition.x,-m_Eyeposition.y,-m_Eyeposition.z); //6 + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cyan); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white); + + [self executePlanet:m_Earth sx:&earth_sx sy:&earth_sy sz:&earth_sz //7 + screenRadius:&earth_sr render:TRUE]; + + glPopMatrix(); + + if(m_LensFlareOn) + { + if((m_LensFlare!=NULL) && (sun_sz>0)) //8 + { + float scale=1.0; + CGRect frame = [[UIScreen mainScreen] bounds]; + float delX=frame.size.width/2.0-sun_sx; + float delY=frame.size.height/2.0-sun_sy; + float grazeDist=earth_sr+sun_sr; + float percentVisible=1.0; + float vanishDist=earth_sr-sun_sr; + + float distanceBetweenBodies=sqrt(delX*delX+delY*delY); + + if((distanceBetweenBodies>vanishDist) && (distanceBetweenBodies1.3) //9 + percentVisible=1.3; + else if(percentVisible<0.2) + percentVisible=1.3; + } + else if(distanceBetweenBodies>grazeDist) + { + percentVisible=1.0; + } + else + { + percentVisible=0.0; + } + + scale=STANDARD_FOV/m_FieldOfView; + + if(percentVisible>0.0) + [m_LensFlare execute:[[UIScreen mainScreen]applicationFrame] //10 + source:CGPointMake(sun_sx,sun_sy) scale:scale alpha:percentVisible]; + } + } +} + + //11 +-(void)executePlanet:(Planet *)planet sx:(float *)sx sy:(float *)sy sz:(float *)sz + screenRadius:(float *)screenRadius render:(BOOL)render +{ + static GLfloat angle=0.0; + GLKVector3 planetPos; + float temp; + float distance; + CGRect frame = [[UIScreen mainScreen] bounds]; + + glPushMatrix(); + + planetPos=[planet getPosition]; + + glTranslatef(planetPos.x,planetPos.y,planetPos.z); + + if(render) + [planet execute]; //12 + + distance=GLKVector3Distance(m_Eyeposition, planetPos); + temp=(0.5*frame.size.width)/tanf(GLKMathDegreesToRadians(m_FieldOfView)/2.0); + *screenRadius=temp*[planet getRadius]/distance; + + gluGetScreenLocation(planetPos.x,-planetPos.y,planetPos.z,sx,sy,sz); //13 + + glPopMatrix(); + + angle+=.5; +} + +-(float)getFieldOfView +{ + return m_FieldOfView; +} + +-(void)setFieldOfView:(float)fov +{ + m_FieldOfView=fov; + + [self setClipping]; +} + +-(void)setClipping +{ + float aspectRatio; + const float zNear = .1; + const float zFar = 2000; + GLfloat size; + float scale; + CGRect frame = [[UIScreen mainScreen] bounds]; + + aspectRatio=(float)frame.size.width/(float)frame.size.height; + scale=[[UIScreen mainScreen]scale]; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + size = zNear * tanf(GLKMathDegreesToRadians (m_FieldOfView) / 2.0); + + glFrustumf(-size, size, -size/aspectRatio, size/aspectRatio, zNear, zFar); + glViewport(0, 0, frame.size.width*scale, frame.size.height*scale); + + glMatrixMode(GL_MODELVIEW); +} + +-(GLKVector3)getTargetLocation +{ + return [m_Earth getPosition]; +} + +-(void)lookAtTarget +{ + GLKVector3 targetLocation=[m_Earth getPosition]; + + gluLookAt(m_Eyeposition.x,m_Eyeposition.y,m_Eyeposition.z, + targetLocation.x,targetLocation.y,targetLocation.z, + 0.0,1.0,0.0); +} + +-(GLKVector3)getEyeposition +{ + return m_Eyeposition; +} + +-(void)setEyeposition:(GLKVector3)loc +{ + m_Eyeposition=loc; +} + +-(void)setFeatureNames:(BOOL)constNames outlines:(BOOL)constOutlines lensFlare:(BOOL)lensFlare +{ + m_ConstNamesOn=constNames; + m_ConstOutlinesOn=constOutlines; + m_LensFlareOn=lensFlare; +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemViewController.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..77e78e5 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemViewController.h @@ -0,0 +1,49 @@ +// +// OpenGLSolarSystemViewController.h +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemController.h" +#import "miniglu.h" +#include + +@interface OpenGLSolarSystemViewController : GLKViewController +{ + OpenGLSolarSystemController *m_SolarSystem; + CGPoint m_PointerLocation; + + UIButton *m_Button1; + UIButton *m_Button2; + UIButton *m_Button3; + UIButton *m_Button4; + + UIImageView *m_GreenHUDHorImage; + UIImageView *m_GreenHUDVertImage; + UILabel *m_Label; + + BOOL m_ConstNamesOn; + BOOL m_LensFlareOn; + BOOL m_ConstOutlinesOn; +}; + +-(void)viewDidLoad; +-(void)glkView:(GLKView *)view drawInRect:(CGRect)rect; +-(void)setHoverPosition:(unsigned)nFlags location:(CGPoint)location + prevLocation:(CGPoint)prevLocation; +-(UIButton *)createButton:(CGRect)frame normalImageFile:(NSString *)normalImageFile + selectedImageFile:(NSString *)selectedImageFile title:(NSString *)title + selector:(SEL)selector titleColor:(UIColor *)titleColor; +-(void)scan; +-(UILabel *)createLabel:(CGRect)frame title:(NSString *)title titleColor:(UIColor *)titleColor + fontSize:(int)fontSize textAlignment:(UITextAlignment)textAlignment; +-(void)createUI; +-(void)initLighting; + + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemViewController.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemViewController.mm new file mode 100644 index 0000000..6dc835a --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLSolarSystemViewController.mm @@ -0,0 +1,445 @@ +// +// OpenGL_SolarSystemViewController.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLSolarSystem.h" +#import "OpenGLSolarSystemViewController.h" + +@interface OpenGLSolarSystemViewController () +{ + + +} + +@property (strong, nonatomic) EAGLContext *context; +@property (strong, nonatomic) GLKBaseEffect *effect; + +@end + + +@implementation OpenGLSolarSystemViewController + +@synthesize context = _context; +@synthesize effect = _effect; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + if (!self.context) + { + NSLog(@"Failed to create ES context"); + } + + GLKView *view = (GLKView *)self.view; + view.context = self.context; + view.drawableDepthFormat = GLKViewDrawableDepthFormat24; + + view.drawableMultisample=GLKViewDrawableMultisample4X; + + [EAGLContext setCurrentContext:self.context]; + + m_SolarSystem=[[OpenGLSolarSystemController alloc] init]; + + [self initLighting]; + + UIPinchGestureRecognizer *pinchGesture = + [[UIPinchGestureRecognizer alloc]initWithTarget:self action:@selector(handlePinchGesture:)]; + + [self.view addGestureRecognizer:pinchGesture]; + + UIPanGestureRecognizer *panGesture = + [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(handlePanGesture:)]; + [self.view addGestureRecognizer:panGesture]; + + [self createUI]; +} + +- (IBAction)handlePanGesture:(UIPanGestureRecognizer *)sender +{ + static CGPoint prevLocation; + CGPoint translate = [sender translationInView:self.view]; + + UIGestureRecognizerState state; + + state=sender.state; + + if(state==UIGestureRecognizerStateBegan) + { + prevLocation=translate; + [m_SolarSystem lookAtTarget]; + } + else if(state==UIGestureRecognizerStateChanged) + { + CGPoint currlocation =translate; + + m_PointerLocation=CGPointMake(currlocation.x, currlocation.y); + + [self setHoverPosition:0 location:currlocation prevLocation:prevLocation]; + + prevLocation=currlocation; + } +} + +- (IBAction)handlePinchGesture:(UIGestureRecognizer *)sender +{ + static float startFOV=0.0; + CGFloat factor = [(UIPinchGestureRecognizer *)sender scale]; + UIGestureRecognizerState state; + + state=sender.state; + + if(state==UIGestureRecognizerStateBegan) + { + startFOV=[m_SolarSystem getFieldOfView]; + } + else if(state==UIGestureRecognizerStateChanged) + { + float minFOV=5.0; + float maxFOV=75.0; + float currentFOV; + + currentFOV=startFOV*factor; + + if((currentFOV>=minFOV) && (currentFOV<=maxFOV)) + [m_SolarSystem setFieldOfView:currentFOV]; + } +} + +#pragma mark - GLKView and GLKViewController delegate methods + +- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect +{ + glEnable(GL_DEPTH_TEST); + + glClearColor(0.0f,0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + [m_SolarSystem execute]; +} + +-(void)initLighting +{ + GLfloat sunPos[]={0.0,0.0,0.0,1.0}; + GLfloat posFill1[]={-15.0,15.0,0.0,1.0}; + GLfloat posFill2[]={-10.0,-4.0,1.0,1.0}; + + GLfloat white[]={1.0,1.0,1.0,1.0}; + GLfloat dimblue[]={0.0,0.0,.2,1.0}; + + GLfloat cyan[]={0.0,1.0,1.0,1.0}; + GLfloat yellow[]={1.0,1.0,0.0,1.0}; + GLfloat dimmagenta[]={.75,0.0,.25,1.0}; + + GLfloat brightambient[]={0.6,0.8,1.0,1.0}; + + float matAmbient[]={.5f,.5f,.5f,1.0f}; + GLfloat diffuse[]={0.0,0.0,.2,.1}; + + //lights go here + + glLightfv(SS_SUNLIGHT,GL_POSITION,sunPos); + glLightfv(SS_SUNLIGHT,GL_DIFFUSE,white); + glLightfv(SS_SUNLIGHT,GL_SPECULAR,yellow); + + glLightfv(SS_FILLLIGHT1,GL_POSITION,posFill1); + glLightfv(SS_FILLLIGHT1,GL_DIFFUSE,dimblue); + glLightfv(SS_FILLLIGHT1,GL_SPECULAR,cyan); + + glLightfv(SS_FILLLIGHT2,GL_POSITION,posFill2); + glLightfv(SS_FILLLIGHT2,GL_SPECULAR,dimmagenta); + glLightfv(SS_FILLLIGHT2,GL_DIFFUSE,dimblue); + + glLightfv(SS_AMBIENTLIGHT,GL_AMBIENT,brightambient); + glLightfv(SS_AMBIENTLIGHT,GL_DIFFUSE,diffuse); + + //let's us see the backside of the planets + + + //materials go here + + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cyan); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white); + + glMaterialfv(GL_FRONT,GL_AMBIENT,matAmbient); + + glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,25); + + glShadeModel(GL_SMOOTH); + glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,0.0); + + glEnable(GL_LIGHTING); + glEnable(SS_SUNLIGHT); + glEnable(SS_FILLLIGHT1); + glEnable(SS_FILLLIGHT2); + glEnable(SS_AMBIENTLIGHT); +} + +-(void)setHoverPosition:(unsigned)nFlags location:(CGPoint)location prevLocation:(CGPoint)prevLocation +{ + int dx; + int dy; + GLKQuaternion orientation,tempQ; + GLKVector3 offset,objectLoc,vpLoc; + GLKVector3 offsetv=GLKVector3Make(0.0,0.0,0.0); + float reference=300; + float scale=4.0; + GLKMatrix3 matrix3; + + CGRect frame = [[UIScreen mainScreen] bounds]; + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + orientation=gluGetOrientation(); //1 + + vpLoc=[m_SolarSystem getEyeposition]; //2 + + objectLoc=[m_SolarSystem getTargetLocation]; //3 + + offset.x=(objectLoc.x-vpLoc.x); + offset.y=(objectLoc.y-vpLoc.y); + offset.z=(objectLoc.z-vpLoc.z); + + offsetv.z=GLKVector3Distance(objectLoc,vpLoc); + + dx=location.x-prevLocation.x; //5 + dy=location.y-prevLocation.y; + + float multiplier; + + multiplier=frame.size.width/reference; //6 + + glMatrixMode(GL_MODELVIEW); + + float c,s; + float rad=scale*multiplier*dy/reference; + + s=sinf(rad*.5); + c=cosf(rad*.5); + + tempQ=GLKQuaternionMake(s,0.0,0.0,c); //rotate around the X-axis + orientation=GLKQuaternionMultiply(tempQ,orientation); + + rad=scale*multiplier*dx/reference; + + s=sinf(rad*.5); + c=cosf(rad*.5); + + tempQ=GLKQuaternionMake(0.0,s,0.0,c); //rotate around the Y-axis + orientation=GLKQuaternionMultiply(tempQ,orientation); + + matrix3=GLKMatrix3MakeWithQuaternion(orientation); + + matrix3=GLKMatrix3Transpose(matrix3); + offsetv=GLKMatrix3MultiplyVector3(matrix3, offsetv); + + vpLoc.x=objectLoc.x+offsetv.x; //9 + vpLoc.y=objectLoc.y+offsetv.y; + vpLoc.z=objectLoc.z+offsetv.z; + + [m_SolarSystem setEyeposition:vpLoc]; + + [m_SolarSystem lookAtTarget]; //10 +} + + +-(void)createUI +{ + CGRect frame=CGRectMake(-100, 20, 75, 35); + + m_Button1=[self createButton:frame normalImageFile:@"bluebutton-100x35-clipped.png" selectedImageFile:NULL + title:@"names" selector:@selector(buttonAction:) + titleColor:[UIColor cyanColor]]; + + + [self.view addSubview:m_Button1]; + + frame=CGRectMake(-150, 55, 75, 35); + + m_Button2=[self createButton:frame normalImageFile:@"greenbutton-100x35-clipped.png" selectedImageFile:NULL + title:@"lines" selector:@selector(buttonAction:) titleColor:[UIColor whiteColor]]; + + [self.view addSubview:m_Button2]; + + frame=CGRectMake(-200, 90, 75, 35); + + m_Button3=[self createButton:frame normalImageFile:@"redbutton-100x35-clipped.png" selectedImageFile:NULL + title:@"lens flare" selector:@selector(buttonAction:) + titleColor:[UIColor whiteColor]]; + + [self.view addSubview:m_Button3]; + + frame=CGRectMake(-250, 125, 75, 35); + + m_Button4=[self createButton:frame normalImageFile:@"purplebutton-100x35-clipped.png" selectedImageFile:NULL + title:@"sweep" selector:@selector(buttonAction:) + titleColor:[UIColor whiteColor]]; + + [self.view addSubview:m_Button4]; + + [NSTimer scheduledTimerWithTimeInterval:.3 target:self selector:@selector(hudUpdate:) userInfo:NULL repeats:YES]; + + UIImage *greenDotImage=[UIImage imageNamed:@"green_dot.png"]; + m_GreenHUDVertImage=[[UIImageView alloc]initWithImage:greenDotImage]; + m_GreenHUDVertImage.alpha=0.0; + + [self.view addSubview:m_GreenHUDVertImage]; + + m_GreenHUDHorImage=[[UIImageView alloc]initWithImage:greenDotImage]; + m_GreenHUDHorImage.alpha=0.0; + + [self.view addSubview:m_GreenHUDHorImage]; + + frame=CGRectMake(20, 250, 75, 35); + + m_Label=[self createLabel:frame title:@"testing" titleColor:[UIColor greenColor] fontSize:12 textAlignment:UITextAlignmentLeft]; + + [self.view addSubview:m_Label]; +} + +- (UIButton *)createButton:(CGRect)frame normalImageFile:(NSString *)normalImageFile + selectedImageFile:(NSString *)selectedImageFile title:(NSString *)title + selector:(SEL)selector titleColor:(UIColor *)titleColor +{ + UILabel *label; + UIImage *normalImage=[UIImage imageNamed:normalImageFile]; + UIImage *selectedImage=[UIImage imageNamed:selectedImageFile]; + + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + + button.frame = frame; + [button setTitleColor:titleColor forState:0]; + [button setImage:normalImage forState:UIControlStateNormal]; + [button setImage:selectedImage forState:UIControlStateSelected]; + button.backgroundColor = NULL; + button.alpha=.65; + [button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside]; + + frame=CGRectMake(0, 5, frame.size.width, 20); + label=[self createLabel:frame title:title titleColor:titleColor fontSize:15 textAlignment:UITextAlignmentCenter]; + + [button addSubview:label]; + + return button; +} + +-(UILabel *)createLabel:(CGRect)frame title:(NSString *)title titleColor:(UIColor *)titleColor + fontSize:(int)fontSize textAlignment:(UITextAlignment)textAlignment +{ + UILabel *label; + + label = [[UILabel alloc] initWithFrame:frame]; + label.backgroundColor = [UIColor clearColor]; + label.opaque = NO; + label.textAlignment = textAlignment; + label.textColor = titleColor; + label.font = [UIFont systemFontOfSize:fontSize]; + label.text = title; + label.adjustsFontSizeToFitWidth=TRUE; + label.minimumFontSize=10; + + return label; +} + +-(void)displayUI +{ + CGRect frame; + + [UIView beginAnimations:NULL context:NULL]; + + frame=m_Button1.frame; + + [UIView setAnimationDuration:1.25]; + + m_Button1.frame=CGRectMake(20, m_Button1.frame.origin.y, m_Button1.frame.size.width, m_Button1.frame.size.height); + m_Button2.frame=CGRectMake(20, m_Button2.frame.origin.y, m_Button2.frame.size.width, m_Button2.frame.size.height); + m_Button3.frame=CGRectMake(20, m_Button3.frame.origin.y, m_Button3.frame.size.width, m_Button3.frame.size.height); + m_Button4.frame=CGRectMake(20, m_Button4.frame.origin.y, m_Button4.frame.size.width, m_Button4.frame.size.height); + + [UIView commitAnimations]; +} + +-(void)buttonAction:(id)sender +{ + if(sender==m_Button1) + { + if(m_ConstNamesOn) + m_ConstNamesOn=FALSE; + else + m_ConstNamesOn=TRUE; + } + if(sender==m_Button2) + { + if(m_ConstOutlinesOn) + m_ConstOutlinesOn=FALSE; + else + m_ConstOutlinesOn=TRUE; + } + if(sender==m_Button3) + { + if(m_LensFlareOn) + m_LensFlareOn=FALSE; + else + m_LensFlareOn=TRUE; + } + if(sender==m_Button4) + { + [self scan]; + } + + [m_SolarSystem setFeatureNames:m_ConstNamesOn outlines:m_ConstOutlinesOn lensFlare:m_LensFlareOn]; +} + +-(void)hudUpdate:(NSTimer *)timer +{ + static int counter=0; + + m_Label.text=[NSString stringWithFormat:@"%3.2f",counter/10.0]; + + counter+=42; +} + +-(void)scan +{ + CGRect mainFrame = [[UIScreen mainScreen] bounds]; + CGRect vertSweepStart=CGRectMake(20, 0, 2.0, mainFrame.size.height); + CGRect vertSweepEnd=CGRectMake(mainFrame.size.width+10, 0, 2.0, mainFrame.size.height); + + CGRect horSweepStart=CGRectMake(0,20,mainFrame.size.width,2.0); + CGRect horSweepEnd=CGRectMake(0,mainFrame.size.height,mainFrame.size.width,2.0); + + m_GreenHUDVertImage.frame=vertSweepStart; + m_GreenHUDVertImage.alpha=1.0; + + m_GreenHUDHorImage.frame=horSweepStart; + m_GreenHUDHorImage.alpha=1.0; + + [UIView animateWithDuration:5.0 + animations:^{ + m_GreenHUDVertImage.frame=vertSweepEnd; + m_GreenHUDVertImage.alpha=0.0; + + m_GreenHUDHorImage.frame=horSweepEnd; + m_GreenHUDHorImage.alpha=0.0; + } + completion:^(BOOL completed){ + + } + ]; +} + +- (void)viewDidAppear:(BOOL)animated +{ + [self displayUI]; + + [super viewDidAppear:animated]; +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLStars.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLStars.h new file mode 100644 index 0000000..11bd6fb --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLStars.h @@ -0,0 +1,33 @@ +// +// OpenGLStars.h +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import + +struct starData //1 +{ + GLfloat x; + GLfloat y; + GLfloat z; + GLfloat mag; + GLfloat r,g,b,a; + GLint hdnum; +}; + +@interface OpenGLStars : NSObject +{ + struct starData *m_Data; + int m_TotalStars; +} + +-(void)execute; +-(void)init:(NSString *)filename; +-(id)init; + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLStars.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLStars.mm new file mode 100644 index 0000000..aeabc51 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLStars.mm @@ -0,0 +1,115 @@ +// +// OpenGLStars.m +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLUtils.h" +#import "OpenGLStars.h" +#import "OpenGLSolarSystem.h" +#import "miniGLU.h" + +@implementation OpenGLStars + +- (id)init +{ + self = [super init]; + + if (self) + { + [self init:@"stars"]; + } + + return self; +} + +-(void)init:(NSString *)filename +{ + NSArray *fatData; + NSDictionary *dict; + NSNumber *ra,*dec; + starData *sd; + float mag; + float x,y,z; + int i; + + m_TotalStars=0; + + NSString *thePath = [[NSBundle mainBundle] pathForResource:filename ofType:@"plist"]; + + fatData = [[NSArray alloc] initWithContentsOfFile:thePath]; //2 + + m_TotalStars=[fatData count]; + + m_Data=(struct starData *)malloc([fatData count]*sizeof(struct starData)); + + for(i=0;ix=x; + sd->y=y; + sd->z=z; + sd->mag=[[dict objectForKey:@"mag"]floatValue]; + + mag=1.0-sd->mag/4.0; //4 + + if(mag<.2) + mag=.2; + else if(mag>1.0) + mag=1.0; + + sd->r=sd->g=sd->b=mag; + + sd->a=1.0; + sd->hdnum=[[dict objectForKey:@"hdnum"]longValue]; + } +} + +-(void)execute +{ + int len; + GLfloat pointSize[2]; + + glDisable(GL_LIGHTING); //5 + glDisable(GL_TEXTURE_2D); + glDisable(GL_DEPTH_TEST); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + glMatrixMode(GL_MODELVIEW); + glBlendFunc(GL_ONE, GL_ONE_MINUS_DST_ALPHA); + glEnable(GL_BLEND); + + len=sizeof(struct starData); + + glColorPointer(4, GL_FLOAT, len, &m_Data->r); //6 + glVertexPointer(3,GL_FLOAT,len,m_Data); + + glGetFloatv(GL_SMOOTH_POINT_SIZE_RANGE,pointSize); //7 + glEnable(GL_POINT_SMOOTH); + glPointSize(5.0); + + glDrawArrays(GL_POINTS,len,m_TotalStars); //8 + + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHTING); +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLText.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLText.h new file mode 100644 index 0000000..464113c --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLText.h @@ -0,0 +1,23 @@ +// +// OpenGLText.h +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLText : NSObject /////////////////////////////////////// +{ + GLuint m_Name; + NSUInteger m_Width; + NSUInteger m_Height; + GLfloat m_MaxS; + GLfloat m_MaxT; +} + +-(id)initWithText:(NSString*)string size:(CGSize)size alignment:(UITextAlignment)alignment font:(UIFont*)font; +-(void)renderAtPoint:(CGPoint)point depth:(CGFloat)depth red:(float)red green:(float)green blue:(float)blue alpha:(float)alpha; + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLText.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLText.mm new file mode 100644 index 0000000..1ba09d6 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLText.mm @@ -0,0 +1,125 @@ +// +// OpenGLText.m +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// +#import "OpenGLSolarSystem.h" +#import "OpenGLText.h" +#import "OpenGLCreateTexture.h" + +@implementation OpenGLText + +-(id)initWithText:(NSString*)string size:(CGSize)size alignment:(UITextAlignment)alignment font:(UIFont*)font //1 +{ + NSUInteger width; + NSUInteger height; + NSUInteger i; + CGContextRef context; + void* data; + CGColorSpaceRef colorSpace; + GLint saveName; + + glEnable(GL_TEXTURE_2D); + + width = size.width; + + if((width != 1) && (width & (width - 1))) //2 + { + i = 1; + + while(i < width) + i *= 2; + + width = i; + } + height = size.height; + + if((height != 1) && (height & (height - 1))) + { + i = 1; + + while(i < height) + i *= 2; + + height = i; + } + + colorSpace = CGColorSpaceCreateDeviceGray(); //3 + + data = calloc(height, width); //4 + + context = CGBitmapContextCreate(data, width, height, 8, width, colorSpace, kCGImageAlphaNone); + + CGColorSpaceRelease(colorSpace); + + CGContextSetGrayFillColor(context, 1.0, 1.0); //5 + + UIGraphicsPushContext(context); //6 + + [string drawInRect:CGRectMake(0, 0, size.width, size.height) withFont:font + lineBreakMode:UILineBreakModeWordWrap alignment:alignment]; + + UIGraphicsPopContext(); + + glGenTextures(1, &m_Name); //7 + glGetIntegerv(GL_TEXTURE_BINDING_2D, &saveName); + + glBindTexture(GL_TEXTURE_2D, m_Name); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, //8 + GL_LUMINANCE, GL_UNSIGNED_BYTE, data); + + glBindTexture(GL_TEXTURE_2D, saveName); //9 + + m_Width=width; + m_Height=height; + m_MaxS=size.width/(float)width; + m_MaxT=size.height/(float)height; + + CGContextRelease(context); + free(data); + + return self; +} + +-(void)renderAtPoint:(CGPoint)point depth:(CGFloat)depth red:(float)red green:(float)green + blue:(float)blue alpha:(float)alpha +{ + + float scale; + + int boxRect[4]; + + glBindTexture(GL_TEXTURE_2D,m_Name); + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA); + + glDisable(GL_DEPTH_TEST); + glEnable(GL_TEXTURE_2D); + glDisable(GL_LIGHTING); + + glColor4f(red, green, blue, alpha); + + boxRect[0]=0; + boxRect[1]=0; + boxRect[2]=m_Width; + boxRect[3]=m_Height; + + scale=[[UIScreen mainScreen] scale]; //10 + + glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,(GLint *)boxRect);//11 + + glDrawTexfOES(point.x*scale, (480-point.y)*scale, depth, m_Width,m_Height); //12 + + glDisable(GL_TEXTURE_2D); + glEnable(GL_DEPTH_TEST); + glDisable(GL_BLEND); + glEnable(GL_LIGHTING); +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLUtils.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLUtils.h new file mode 100644 index 0000000..1af796f --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLUtils.h @@ -0,0 +1,18 @@ +// +// OpenGLUtils.h +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface OpenGLUtils : NSObject + + ++(OpenGLUtils *)getObject; ++(id)allocWithZone:(NSZone *)zone; +-(void)sphereToRectTheta:(float)theta phi:(float)phi radius:(float)radius + xprime:(float *)xprime yprime:(float *)yprime zprime:(float *)zprime; +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLUtils.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLUtils.mm new file mode 100644 index 0000000..e50750a --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/OpenGLUtils.mm @@ -0,0 +1,61 @@ +// +// OpenGLUtils.m +// OpenGLSolarSystem +// +// Created by mike on 9/19/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "OpenGLUtils.h" +#import "OpenGLSolarSystem.h" + +static OpenGLUtils *m_Singleton; + +@implementation OpenGLUtils + ++(OpenGLUtils *)getObject +{ + @synchronized(self) + { + if(m_Singleton==nil) + { + [[self alloc]init]; + } + } + + return m_Singleton; +} + ++(id)allocWithZone:(NSZone *)zone +{ + @synchronized(self) + { + if (m_Singleton == nil) + { + m_Singleton = [super allocWithZone:zone]; + + return m_Singleton; // assignment and return on first alUI + } + } + return nil; //on subsequent allocation attempts return nil +} + +-(void)sphereToRectTheta:(float)theta phi:(float)phi radius:(float)radius + xprime:(float *)xprime yprime:(float *)yprime zprime:(float *)zprime +{ + float cos_theta,sin_theta,cos_phi,sin_phi; + + phi=RADIANS_PER_90_DEGREES-phi; /* phi is to be measured starting from the z-axis. */ + + sin_theta=sin(theta); + cos_theta=cos(theta); + + sin_phi=sin(phi); + cos_phi=cos(phi); + + *xprime=(float)(radius*cos_theta*sin_phi); + *yprime=(float)(radius*cos_phi); + *zprime=(float)-1.0*(radius*sin_theta*sin_phi); +} + +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Planet.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Planet.h new file mode 100644 index 0000000..d18c3ea --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Planet.h @@ -0,0 +1,39 @@ +/**************************************************************************************** + * Planet.h : lifted from the iPhone Touchfighter exmaple code. Thanks! Apple! * + ****************************************************************************************/ +#import +#import +#import + +@interface Planet : NSObject +{ + +@private + GLfloat *m_VertexData; + GLubyte *m_ColorData; + GLfloat *m_NormalData; + GLfloat *m_TexCoordsData; + GLint m_Stacks, m_Slices; + GLfloat m_Scale; + GLfloat m_Squash; + GLfloat m_Angle; + GLKVector3 m_Pos; + GLfloat m_RotationalIncrement; + + GLKTextureInfo *m_TextureInfo; +} + +-(bool)execute; +-(id)init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat)squash textureFile:(NSString *)textureFile; +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z; +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z; +-(GLfloat)getRotation; +-(GLKVector3)getPosition; +-(float)getRadius; +-(void)setPosition:(GLKVector3)position; +-(void)setRotation:(GLfloat)angle; +-(GLfloat)getRotationalIncrement; +-(void)setRotationalIncrement:(GLfloat)inc; +-(void)incrementRotation; +-(GLKTextureInfo *)loadTexture:(NSString *)filename; +@end diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Planet.m b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Planet.m new file mode 100644 index 0000000..ec11170 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/Planet.m @@ -0,0 +1,303 @@ + + +#import "Planet.h" + +GLshort *_texData=NULL; + +@implementation Planet + + + +-(id)init:(GLint)stacks slices:(GLint)slices radius:(GLfloat)radius squash:(GLfloat)squash textureFile:(NSString *)textureFile +{ + unsigned int colorIncrment=0; + unsigned int blue=0; + unsigned int red=255; + int numVertices=0; + + if(textureFile!=nil) + m_TextureInfo=[self loadTexture:textureFile]; + + m_Scale=radius; + m_Squash=squash; + + colorIncrment=255/stacks; + + if ((self = [super init])) + { + m_Stacks = stacks; + m_Slices = slices; + m_VertexData = nil; + m_TexCoordsData = nil; + + //vertices + + GLfloat *vPtr = m_VertexData = + (GLfloat*)malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * + (m_Stacks))); + + //color data + + GLubyte *cPtr = m_ColorData = + (GLubyte*)malloc(sizeof(GLubyte) * 4 * ((m_Slices*2+2) * + (m_Stacks))); + + //normal pointers for lighting + + GLfloat *nPtr = m_NormalData = (GLfloat*) + malloc(sizeof(GLfloat) * 3 * ((m_Slices*2+2) * (m_Stacks))); + + GLfloat *tPtr=nil; //3 + + if(textureFile!=nil) + { + tPtr=m_TexCoordsData = + (GLfloat *)malloc(sizeof(GLfloat) * 2 * ((m_Slices*2+2) * + (m_Stacks))); + } + + unsigned int phiIdx, thetaIdx; + + //latitude + + for(phiIdx=0; phiIdx < m_Stacks; phiIdx++) + { + //starts at -1.57 goes up to +1.57 radians + + //the first circle + + float phi0 = M_PI * ((float)(phiIdx+0) * (1.0/(float) + (m_Stacks)) - 0.5); + + //the next, or second one. + + float phi1 = M_PI * ((float)(phiIdx+1) * (1.0/(float) + (m_Stacks)) - 0.5); + float cosPhi0 = cos(phi0); + float sinPhi0 = sin(phi0); + float cosPhi1 = cos(phi1); + float sinPhi1 = sin(phi1); + + float cosTheta, sinTheta; + + //longitude + + for(thetaIdx=0; thetaIdx < m_Slices; thetaIdx++) + { + //Increment along the longitude circle each "slice." + + float theta = -2.0*M_PI * ((float)thetaIdx) * + (1.0/(float)(m_Slices-1)); + cosTheta = cos(theta); + sinTheta = sin(theta); + + //We're generating a vertical pair of points, such + //as the first point of stack 0 and the first point + //of stack 1 + //above it. This is how TRIANGLE_STRIPS work, + //taking a set of 4 vertices and essentially drawing + //two triangles + //at a time. The first is v0-v1-v2 and the next is + //v2-v1-v3. Etc. + + //Get x-y-z for the first vertex of stack. + + vPtr[0] = m_Scale*cosPhi0 * cosTheta; + vPtr[1] = m_Scale*sinPhi0*m_Squash; + vPtr[2] = m_Scale*(cosPhi0 * sinTheta); + + //the same but for the vertex immediately above the + //previous one + + vPtr[3] = m_Scale*cosPhi1 * cosTheta; + vPtr[4] = m_Scale*sinPhi1*m_Squash; + vPtr[5] = m_Scale*(cosPhi1 * sinTheta); + + //normal pointers for lighting + + nPtr[0] = cosPhi0 * cosTheta; + nPtr[2] = cosPhi0 * sinTheta; + nPtr[1] = sinPhi0; + + nPtr[3] = cosPhi1 * cosTheta; + nPtr[5] = cosPhi1 * sinTheta; + nPtr[4] = sinPhi1; + + if(tPtr!=nil) //4 + { + GLfloat texX = (float)thetaIdx * + (1.0f/(float)(m_Slices-1)); + tPtr[0] = texX; + tPtr[1] = (float)(phiIdx+0) * + (1.0f/(float)(m_Stacks)); + tPtr[2] = texX; + tPtr[3] = (float)(phiIdx+1) * + (1.0f/(float)(m_Stacks)); + } + + cPtr[0] = red; + cPtr[1] = 0; + cPtr[2] = blue; + cPtr[4] = red; + cPtr[5] = 0; + cPtr[6] = blue; + cPtr[3] = cPtr[7] = 255; + + cPtr += 2*4; + vPtr += 2*3; + nPtr += 2*3; + + + if(tPtr!=nil) //5 + tPtr += 2*2; + } + + blue+=colorIncrment; + red-=colorIncrment; + + // Degenerate triangle to connect stacks and maintain + //winding order. + + vPtr[0] = vPtr[3] = vPtr[-3]; + vPtr[1] = vPtr[4] = vPtr[-2]; + vPtr[2] = vPtr[5] = vPtr[-1]; + + nPtr[0] = nPtr[3] = nPtr[-3]; + nPtr[1] = nPtr[4] = nPtr[-2]; + nPtr[2] = nPtr[5] = nPtr[-1]; + + if(tPtr!=nil) + { + tPtr[0] = tPtr[2] = tPtr[-2]; //6 + tPtr[1] = tPtr[3] = tPtr[-1]; + } + + } + + numVertices=(vPtr-m_VertexData)/6; + } + + m_Angle=0.0; + m_RotationalIncrement=0.0; + + m_Pos.x=0.0; + m_Pos.y=0.0; + m_Pos.z=0.0; + + return self; +} +-(bool)execute +{ + glMatrixMode(GL_MODELVIEW); + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glFrontFace(GL_CW); + + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + if(m_TextureInfo!=nil) + { + glEnable(GL_TEXTURE_2D); //1 + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + if(m_TextureInfo!=0) + glBindTexture(GL_TEXTURE_2D, m_TextureInfo.name); + + glTexCoordPointer(2, GL_FLOAT, 0, m_TexCoordsData); + } + + + + glMatrixMode(GL_MODELVIEW); + + glVertexPointer(3, GL_FLOAT, 0, m_VertexData); + glNormalPointer(GL_FLOAT, 0, m_NormalData); + + glColorPointer(4, GL_UNSIGNED_BYTE, 0, m_ColorData); + glDrawArrays(GL_TRIANGLE_STRIP, 0, (m_Slices+1)*2*(m_Stacks-1)+2); + + glDisable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + return true; +} + +-(GLKVector3)getPosition +{ + return m_Pos; +} + +-(void)setPosition:(GLKVector3)position +{ + m_Pos=position; +} + +-(void)getPositionX:(GLfloat *)x Y:(GLfloat *)y Z:(GLfloat *)z +{ + *x=m_Pos.x; + *y=m_Pos.y; + *z=m_Pos.z; +} + +-(void)setPositionX:(GLfloat)x Y:(GLfloat)y Z:(GLfloat)z +{ + m_Pos.x=x; + m_Pos.y=y; + m_Pos.z=z; +} + +-(GLfloat)getRotation +{ + return m_Angle; +} + +-(void)setRotation:(GLfloat)angle +{ + m_Angle=angle; +} + +-(void)incrementRotation +{ + m_Angle+=m_RotationalIncrement; +} + +-(GLfloat)getRotationalIncrement +{ + return m_RotationalIncrement; +} + +-(float)getRadius +{ + return m_Scale; +} + +-(void)setRotationalIncrement:(GLfloat)inc +{ + m_RotationalIncrement=inc; +} + +-(GLKTextureInfo *)loadTexture:(NSString *)filename +{ + NSError *error; + GLKTextureInfo *info; + NSDictionary *options=[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES],GLKTextureLoaderOriginBottomLeft, + [NSNumber numberWithBool:TRUE],GLKTextureLoaderGenerateMipmaps,nil]; + + + NSString *path=[[NSBundle mainBundle]pathForResource:filename ofType:NULL]; + + info=[GLKTextureLoader textureWithContentsOfFile:path options:options error:&error]; + + glBindTexture(GL_TEXTURE_2D, info.name); + + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + + return info; +} + +@end \ No newline at end of file diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/.DS_Store b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/.DS_Store new file mode 100644 index 0000000..7ba65b8 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/.DS_Store differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare1.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare1.png new file mode 100644 index 0000000..5314080 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare1.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare2.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare2.png new file mode 100644 index 0000000..6d74eac Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare2.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare3.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare3.png new file mode 100644 index 0000000..557972c Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare3.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare_fuzzy.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare_fuzzy.png new file mode 100644 index 0000000..d5e4f9a Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare_fuzzy.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare_spikey.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare_spikey.png new file mode 100644 index 0000000..70dd3c7 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/flare_spikey.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun.png new file mode 100644 index 0000000..4c67c8b Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun1.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun1.png new file mode 100644 index 0000000..0aa9ef0 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun1.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun2.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun2.png new file mode 100644 index 0000000..b51b75f Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun2.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun3.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun3.png new file mode 100644 index 0000000..a41b095 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/gimp_sun3.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/glow.bmp b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/glow.bmp new file mode 100644 index 0000000..8d1e214 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/glow.bmp differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/glow.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/glow.png new file mode 100644 index 0000000..9ae0ddb Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/glow.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/halo.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/halo.png new file mode 100644 index 0000000..27a3615 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/halo.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/halo1.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/halo1.png new file mode 100644 index 0000000..02671e6 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/halo1.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon.png new file mode 100644 index 0000000..6508111 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon1.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon1.png new file mode 100644 index 0000000..275361d Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon1.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon_blur.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon_blur.png new file mode 100644 index 0000000..41b8114 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/hexagon_blur.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/lens_flare_masked.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/lens_flare_masked.png new file mode 100644 index 0000000..6bac129 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/lens_flare_masked.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/pentagon.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/pentagon.png new file mode 100644 index 0000000..700a267 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/pentagon.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/pentagon_blur.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/pentagon_blur.png new file mode 100644 index 0000000..1cd62b1 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/pentagon_blur.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/solar-glare1.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/solar-glare1.png new file mode 100644 index 0000000..2febe61 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/solar-glare1.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sun_surface.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sun_surface.png new file mode 100644 index 0000000..8d7e36e Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sun_surface.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow.png new file mode 100644 index 0000000..7d83a29 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow2.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow2.png new file mode 100644 index 0000000..b19c3f8 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow2.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow2.pxm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow2.pxm new file mode 100644 index 0000000..318c83e Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow2.pxm differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow_hc.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow_hc.png new file mode 100644 index 0000000..7e651cd Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/Flare/sunglow_hc.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/New UIButton Builder Image.eml b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/New UIButton Builder Image.eml new file mode 100644 index 0000000..5dcb3d0 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/New UIButton Builder Image.eml @@ -0,0 +1,73 @@ +Return-Path: mikes@distantsuns.com +Received: from mx11.stngva01.us.mxservers.net (204.202.242.100) + by mail19c.g19.rapidsite.net (RS ver 1.0.95vs) with SMTP id 0-0207597735 + for ; Mon, 22 Aug 2011 17:15:35 -0400 (EDT) +Received: from unknown [199.239.254.36] (EHLO mmm1927.dulles19-verio.com) + by va1-mx11.stngva01.us.mxservers.net (mxl_mta-3.1.0-05) + with ESMTP id 7f6c25e4.2753624992.729.00-003.va1-mx11.stngva01.us.mxservers.net (envelope-from ); + Mon, 22 Aug 2011 17:15:35 -0400 (EDT) +Received: (qmail 40015 invoked from network); 22 Aug 2011 21:15:35 -0000 +Received: from unknown (HELO ?192.168.1.104?) (mike@76.103.105.7) + by with ESMTPA; 22 Aug 2011 21:15:35 -0000 +Subject: New UIButton Builder Image +From: mike +Content-Type: multipart/mixed; boundary=Apple-Mail-5-732767920 +Message-Id: +Date: Mon, 22 Aug 2011 14:10:16 -0700 +To: Mike Smithwick +Content-Transfer-Encoding: 7bit +Mime-Version: 1.0 (iPhone Mail 8L1) +X-Mailer: iPhone Mail (8L1) +X-Spam: [F=0.2000000000; S=0.200(2010122901); MH=0.500(2011082228)] +X-MAIL-FROM: +X-SOURCE-IP: [199.239.254.36] +X-SF-Loop: 1 + + +--Apple-Mail-5-732767920 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=us-ascii + +Here is the image you generated: + + + +--Apple-Mail-5-732767920 +Content-Disposition: inline; + filename=bluebutton-100x35.png +Content-Type: image/png; + name=bluebutton-100x35.png +Content-Transfer-Encoding: base64 + +iVBORw0KGgoAAAANSUhEUgAAAGQAAAAjCAYAAABiv6+AAAAEM0lEQVRoBe1aO0wUURSdmWXdXUAB +N34giFQaFQqyGiEUihorQ4yFJcZWOjsrY2VnaWvsCAUhdBq/iQYSJRSoCVaICCrho7I/xp3nOc99 +K/NJwA0DJLyb3Lx5/8k5c++7M3NNIYQRJCaE7egPHhA0SbeticBauFZ4V8AEq9hGIqLH2p+3xhPx +Q5YV2+cdq+vrQ8Bx8nMcmcvmPqMYh9oKZzzvDvuUmMoAisyRDOi+WMfFgbPHjzZeT7VVpxrqo8lk +XaxaTdLl/yEwv5hf5oyZWXt+dGx59MPE9IPhx1deGMZcHs0kxFGeSBJSJCOCjora2uZ429mhW1cv +19/oPFVVWVUZERyNPu26AEKZIt2/BaDTmYL5+k060z84e3/sRffdpaXJHNb8DS2QlIpVlkH3FW85 +3Xftwpn9vV2du6O2LezldNGi5JJl3s5On1Z6lIVhWaYBbHctLBZ67WzfzKtH7Q8BD0kR4MJRZwit +IwpNRBPJnlNt1ebSD8fl29CnZcMQEIIYP3mZ7MGS/dACVLouEsJzg4TsgsYNM9IQj5nmyopT4hXt +WjYYAWJMrLFsHLoClW5LWQgdkrQSyzBFJqvJAB4hC9wXsMYm9EzEXh4KJIQXxeiKYywjt+IOxdCv +JQwE/r5h/MMeXCgLUdvJt8FMWr8MKkDCLKVJFC1D7eMlBO2Wkc3JA0aN0WVoCNA43OInBDaSyegA +yw1TSLW/X6dci/sIMXG+aAtxYRRahVh7xUeIAdZAiA55vUiFUV+fhcgzRBMSBgGeNU0Z3LobAy0k +n9cW4oYppNq6LASDvnwt8FVeS8gI4NuVbwe/heA9cXFJh70+pEJosPxRrxFISNDAEO5HLxmAgI8Q +0/KHYgHzdFNICPgIYdirZesQ8BFiaX+1dWxgZx8hEW0h24wQfYRsL0KsioBYbEtvcWdt7ndZ8gzR +X0425zHwB1BeQgQMZBF/FOs254Z2+i4OsHZ/piIhNAeZ8cAyl50Zqd7TdEkYQn8+ASBhCTMcln9O +j2D9Eva4FspCSAoJsIef9gx0XRo8FkvsPSpEwcYfRv23CsBsnAjky0Wi+ezCBLHGusBYYi/PCTox +KjMfYlCmi9YcbDrfcrLjdvf+hvaUZUaTaEPyQ8C3YnRoWQcCovRt0HGEPf99ZmT07fCdoa9TT99h +9g8oU02ZVmorQhhakRTmCFVBScyBxsPnjrSmbp7Yvaep2YpWNqFNSxkIOHZmitN+/ZyaHB+99376 +07OPqH6Dkog0lJmLtBTHl9uLRloKiUlAK6E1xZKJdFrKQ4CJcJQMlBbBMgslEbSMUm5vUPY7Xw15 +tpAAKq9VMhcutZSBgAqQaAUEnwSVshVx7c5+R0NJ8NOE7ouujCXJWV2iqqUMBFRgRGJ4rUomvKs+ +uWzJQrybFLPi2azOGe8QXf9/BBhJyWiKTARN/wNKgkHjyeJ2DgAAAABJRU5ErkJggg== + +--Apple-Mail-5-732767920 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=us-ascii + + + + +Sent from my iPhone +--Apple-Mail-5-732767920-- diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton-100x35-clipped.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton-100x35-clipped.png new file mode 100644 index 0000000..db0c14d Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton-100x35-clipped.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton-100x35.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton-100x35.png new file mode 100644 index 0000000..4b7a98a Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton-100x35.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton.png new file mode 100644 index 0000000..9769304 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/bluebutton.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/green_dot.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/green_dot.png new file mode 100644 index 0000000..e1c7b62 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/green_dot.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/greenbutton-100x35-clipped.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/greenbutton-100x35-clipped.png new file mode 100644 index 0000000..3fc3616 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/greenbutton-100x35-clipped.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/greenbutton-100x35.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/greenbutton-100x35.png new file mode 100644 index 0000000..02918d0 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/greenbutton-100x35.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/purplebutton-100x35-clipped.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/purplebutton-100x35-clipped.png new file mode 100644 index 0000000..776031f Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/purplebutton-100x35-clipped.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/purplebutton-100x35.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/purplebutton-100x35.png new file mode 100644 index 0000000..0f98d00 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/purplebutton-100x35.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/redbutton-100x35-clipped.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/redbutton-100x35-clipped.png new file mode 100644 index 0000000..72e5c24 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/redbutton-100x35-clipped.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/redbutton-100x35.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/redbutton-100x35.png new file mode 100644 index 0000000..e762fff Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/redbutton-100x35.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/earth_light.png b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/earth_light.png new file mode 100644 index 0000000..ff12df7 Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/earth_light.png differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/.DS_Store b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/.DS_Store differ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/outlines.plist b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/outlines.plist new file mode 100644 index 0000000..c01b9ac --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/outlines.plist @@ -0,0 +1,1243 @@ + + + + + + name + aquarius + name_ra + 22.87685 + name_dec + -7.533455 + coordinates + + + ra + 22.87685 + dec + -7.533455 + + + ra + 23.238704 + dec + -6.000178 + + + ra + 23.263942 + dec + -9.030794 + + + ra + 23.383032 + dec + -20.052298 + + + ra + 23.15725 + dec + -21.126881 + + + ra + 22.910734 + dec + -15.77227 + + + ra + 22.826497 + dec + -13.545334 + + + ra + 22.87685 + dec + -7.533455 + + + ra + 22.589159 + dec + -0.067026 + + + ra + 22.48025 + dec + 0.026331 + + + ra + 22.360733 + dec + -1.338232 + + + ra + 22.096368 + dec + -0.272887 + + + ra + 22.42119 + dec + 1.422043 + + + ra + 22.48025 + dec + 0.026331 + + + ra + 22.42119 + dec + 1.422043 + + + ra + 22.096368 + dec + -0.272887 + + + ra + 21.525878 + dec + -5.523756 + + + ra + 20.794446 + dec + -9.447945000000001 + + + ra + 21.159672 + dec + -11.3222 + + + ra + 21.525878 + dec + -5.523756 + + + + + name + aries + name_ra + 3.193743 + name_dec + 19.770281 + coordinates + + + ra + 3.193743 + dec + 19.770281 + + + ra + 2.832949 + dec + 27.305679 + + + ra + 2.119377 + dec + 23.509649 + + + ra + 1.910567 + dec + 20.854896 + + + ra + 1.892044 + dec + 19.340757 + + + + + name + cancer + name_ra + 8.778245 + name_dec + 28.803641 + coordinates + + + ra + 8.778245999999999 + dec + 28.803641 + + + ra + 8.744654000000001 + dec + 18.200585 + + + ra + 8.974743999999999 + dec + 11.901186 + + + ra + 8.275195999999999 + dec + 9.22949 + + + + + name + canis major + name_ra + 6.903263 + name_dec + -11.991816 + coordinates + + + ra + 6.903263 + dec + -11.991816 + + + ra + 7.062548 + dec + -15.585818 + + + ra + 6.935547 + dec + -17.007805 + + + ra + 6.75295 + dec + -16.65494 + + + ra + 6.378303 + dec + -17.910657 + + + ra + 6.75295 + dec + -16.65494 + + + ra + 7.050354 + dec + -23.78715 + + + ra + 7.139671 + dec + -26.348121 + + + ra + 7.40149 + dec + -29.257482 + + + ra + 7.139671 + dec + -26.348121 + + + ra + 6.976965 + dec + -28.925674 + + + ra + 6.338469 + dec + -30.020346 + + + + + name + capricorn + name_ra + 21.783614 + name_dec + -16.073703 + coordinates + + + ra + 21.783614 + dec + -16.073703 + + + ra + 21.668032 + dec + -16.612381 + + + ra + 21.370562 + dec + -16.787188 + + + ra + 21.098877 + dec + -17.185587 + + + ra + 20.349997 + dec + -14.732688 + + + ra + 20.768099 + dec + -25.221056 + + + ra + 20.863604 + dec + -26.869868 + + + ra + 21.444429 + dec + -22.363709 + + + ra + 21.783614 + dec + -16.073703 + + + + + name + cassiopea + name_ra + 1.906731 + name_dec + 63.714594 + coordinates + + + ra + 1.906731 + dec + 63.714594 + + + ra + 1.429935 + dec + 60.2811 + + + ra + 0.945338 + dec + 60.761483 + + + ra + 0.675172 + dec + 56.581344 + + + ra + 0.152122 + dec + 59.197749 + + + + + name + crux + name_ra + 12.52054 + name_dec + -57.12238 + coordinates + + + ra + 12.52054 + dec + -57.12238 + + + ra + 12.441908 + dec + -63.077503 + + + + + name + gemini + name_ra + 6.628469 + name_dec + 16.442887 + coordinates + + + ra + 6.628469 + dec + 16.442887 + + + ra + 7.335222 + dec + 22.025587 + + + ra + 7.301507 + dec + 16.582436 + + + ra + 7.335222 + dec + 22.025587 + + + ra + 7.740665 + dec + 24.439871 + + + ra + 7.755798 + dec + 28.067951 + + + ra + 7.576745 + dec + 31.932796 + + + ra + 7.185125 + dec + 30.277626 + + + ra + 6.879626 + dec + 34.005037 + + + ra + 7.185125 + dec + 30.277626 + + + ra + 6.382546 + dec + 22.558216 + + + ra + 6.247961 + dec + 22.549929 + + + + + name + leo + name_ra + 11.237366 + name_dec + 15.474369 + coordinates + + + ra + 11.237366 + dec + 15.474369 + + + ra + 11.818018 + dec + 14.618993 + + + ra + 11.235006 + dec + 20.568728 + + + ra + 11.237366 + dec + 15.474369 + + + ra + 11.398483 + dec + 10.573271 + + + ra + 10.546813 + dec + 9.350693 + + + ra + 10.139749 + dec + 12.009054 + + + ra + 10.122146 + dec + 16.805248 + + + ra + 10.332607 + dec + 19.887314 + + + ra + 10.27809 + dec + 23.460651 + + + ra + 9.87945 + dec + 26.051773 + + + ra + 9.764059 + dec + 23.818515 + + + ra + 9.528622 + dec + 23.012323 + + + + + name + libra + name_ra + 14.844807 + name_dec + -15.946642 + coordinates + + + ra + 14.844807 + dec + -15.946642 + + + ra + 15.897036 + dec + -16.682301 + + + ra + 16.072828 + dec + -11.324365 + + + ra + 15.283529 + dec + -9.334007 + + + ra + 14.844807 + dec + -15.946642 + + + ra + 15.067869 + dec + -25.23447 + + + ra + 15.617154 + dec + -28.087231 + + + ra + 15.644345 + dec + -29.728124 + + + + + name + orion + name_ra + 5.67948 + name_dec + 1.89622 + coordinates + + + ra + 5.67948 + dec + -1.89622 + + + ra + 5.919522 + dec + 7.44887 + + + ra + 5.585677 + dec + 9.977247 + + + ra + 5.418864 + dec + 6.392594 + + + ra + 5.533491 + dec + -0.253739 + + + ra + 5.242337 + dec + -8.156648000000001 + + + ra + 5.795957 + dec + -9.622623000000001 + + + ra + 5.67948 + dec + -1.89622 + + + ra + 5.603602 + dec + -1.156257 + + + ra + 5.533491 + dec + -0.253739 + + + + + name + pisces + name_ra + 1.194219 + name_dec + 30.135916 + coordinates + + + ra + 1.194219 + dec + 30.135916 + + + ra + 1.324366 + dec + 27.308484 + + + ra + 1.229108 + dec + 24.627274 + + + ra + 1.524708 + dec + 15.389556 + + + ra + 1.756471 + dec + 9.200479 + + + ra + 2.033945 + dec + 2.806585 + + + ra + 0.81131 + dec + 7.630041 + + + ra + 23.988427 + dec + 6.908243 + + + ra + 23.665524 + dec + 5.67528 + + + ra + 23.700961 + dec + 1.824358 + + + ra + 23.448648 + dec + 1.299948 + + + ra + 23.285287 + dec + 3.326811 + + + ra + 23.466215 + dec + 6.424027 + + + ra + 23.665524 + dec + 5.67528 + + + + + name + sagittarius + name_ra + 18.402725 + name_dec + -34.334409 + coordinates + + + ra + 18.402725 + dec + -34.334409 + + + ra + 18.096569 + dec + -30.375125 + + + ra + 18.349659 + dec + -29.780537 + + + ra + 18.466195 + dec + -25.369301 + + + ra + 18.760631 + dec + -26.942237 + + + ra + 18.920991 + dec + -26.249255 + + + ra + 19.115526 + dec + -27.618508 + + + ra + 19.043469 + dec + -29.831911 + + + ra + 19.115526 + dec + -27.618508 + + + ra + 18.920991 + dec + -26.249255 + + + ra + 19.077701 + dec + -21.692193 + + + ra + 18.961963 + dec + -21.057618 + + + ra + 19.077701 + dec + -21.692193 + + + ra + 19.162625 + dec + -20.972982 + + + ra + 19.360948 + dec + -17.800379 + + + + + name + scorpius + name_ra + 17.512741 + name_dec + -37.246456 + coordinates + + + ra + 17.512741 + dec + -37.246456 + + + ra + 17.560295 + dec + -37.055532 + + + ra + 17.792998 + dec + -40.080363 + + + ra + 17.62589 + dec + -42.951403 + + + ra + 17.202565 + dec + -43.186987 + + + ra + 16.864643 + dec + -37.998343 + + + ra + 16.836755 + dec + -34.24185 + + + ra + 16.598007 + dec + -28.168456 + + + ra + 16.490269 + dec + -26.382892 + + + ra + 16.353204 + dec + -25.543535 + + + ra + 16.005497 + dec + -22.573917 + + + ra + 15.980935 + dec + -26.065744 + + + ra + 16.005497 + dec + -22.573917 + + + ra + 16.090647 + dec + -19.755138 + + + + + name + taurus + name_ra + 3.413669 + name_dec + 9.074170000000001 + coordinates + + + ra + 3.413669 + dec + 9.074170000000001 + + + ra + 3.452674 + dec + 9.775715999999999 + + + ra + 3.514559 + dec + 12.979652 + + + ra + 4.011371 + dec + 12.533184 + + + ra + 4.258979 + dec + 8.933832000000001 + + + ra + 4.052677 + dec + 6.031482 + + + + + name + ursa major + name_ra + 13.792481 + name_dec + 49.359103 + coordinates + + + ra + 13.792481 + dec + 49.359103 + + + ra + 13.398389 + dec + 54.971848 + + + ra + 12.89996 + dec + 56.004394 + + + ra + 12.256538 + dec + 57.079441 + + + ra + 11.062039 + dec + 61.796108 + + + ra + 8.504393 + dec + 60.764327 + + + ra + 11.062039 + dec + 61.796108 + + + ra + 11.030374 + dec + 56.426435 + + + ra + 8.98733 + dec + 48.088088 + + + ra + 11.030374 + dec + 56.426435 + + + ra + 11.896913 + dec + 53.740715 + + + ra + 12.256538 + dec + 57.079441 + + + ra + 11.896913 + dec + 53.740715 + + + ra + 11.767642 + dec + 47.82325 + + + ra + 11.160982 + dec + 44.544883 + + + ra + 10.284977 + dec + 42.959673 + + + + + name + virgo + name_ra + 12.086882 + name_dec + 8.77633 + coordinates + + + ra + 12.086882 + dec + 8.77633 + + + ra + 11.764353 + dec + 6.575661 + + + ra + 11.844287 + dec + 1.81235 + + + ra + 12.331731 + dec + -0.619993 + + + ra + 12.694886 + dec + -1.402909 + + + ra + 13.165773 + dec + -5.490258 + + + ra + 13.419724 + dec + -11.111948 + + + ra + 14.214882 + dec + -10.227644 + + + ra + 14.266787 + dec + -5.947255 + + + ra + 14.717641 + dec + -5.605549 + + + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/stars.plist b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/stars.plist new file mode 100644 index 0000000..6e71d91 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/stars.plist @@ -0,0 +1,5216 @@ + + + + + + hdnum + 358 + ra + 2.096911 + dec + 29.090431 + mag + 2.060000 + + + hdnum + 432 + ra + 2.294521 + dec + 59.149780 + mag + 2.280000 + + + hdnum + 496 + ra + 2.352675 + dec + -45.747425 + mag + 3.880000 + + + hdnum + 886 + ra + 3.308970 + dec + 15.183596 + mag + 2.830000 + + + hdnum + 1522 + ra + 4.856977 + dec + -8.823921 + mag + 3.550000 + + + hdnum + 2151 + ra + 6.437799 + dec + -77.254241 + mag + 2.820000 + + + hdnum + 2262 + ra + 6.550841 + dec + -43.679828 + mag + 3.950000 + + + hdnum + 2261 + ra + 6.571046 + dec + -42.305980 + mag + 2.400000 + + + hdnum + 3360 + ra + 9.242852 + dec + 53.896907 + mag + 3.680000 + + + hdnum + 3627 + ra + 9.831983 + dec + 30.861021 + mag + 3.270000 + + + hdnum + 3712 + ra + 10.126835 + dec + 56.537331 + mag + 2.250000 + + + hdnum + 4128 + ra + 10.897380 + dec + -17.986605 + mag + 2.050000 + + + hdnum + 4614 + ra + 12.276214 + dec + 57.815188 + mag + 3.450000 + + + hdnum + 5394 + ra + 14.177215 + dec + 60.716741 + mag + 2.180000 + + + hdnum + 5448 + ra + 14.188381 + dec + 38.499345 + mag + 3.870000 + + + hdnum + 6595 + ra + 16.521029 + dec + -46.718415 + mag + 3.320000 + + + hdnum + 6882 + ra + 17.096174 + dec + -55.245763 + mag + 3.980000 + + + hdnum + 6805 + ra + 17.147465 + dec + -10.182264 + mag + 3.460000 + + + hdnum + 6860 + ra + 17.433016 + dec + 35.620557 + mag + 2.080000 + + + hdnum + 8512 + ra + 21.005854 + dec + -8.183257 + mag + 3.610000 + + + hdnum + 8538 + ra + 21.453967 + dec + 60.235281 + mag + 2.680000 + + + hdnum + 9053 + ra + 22.091362 + dec + -43.318235 + mag + 3.440000 + + + hdnum + 9362 + ra + 22.812936 + dec + -49.072700 + mag + 3.940000 + + + hdnum + 9270 + ra + 22.870873 + dec + 15.345823 + mag + 3.630000 + + + hdnum + 10144 + ra + 24.428528 + dec + -57.236760 + mag + 0.540000 + + + hdnum + 9927 + ra + 24.498150 + dec + 48.628211 + mag + 3.590000 + + + hdnum + 10700 + ra + 26.017012 + dec + -15.937480 + mag + 3.490000 + + + hdnum + 11353 + ra + 27.865142 + dec + -10.335038 + mag + 3.730000 + + + hdnum + 11443 + ra + 28.270448 + dec + 29.578827 + mag + 3.420000 + + + hdnum + 11502 + ra + 28.382559 + dec + 19.293852 + mag + 3.880000 + + + hdnum + 11415 + ra + 28.598856 + dec + 63.670101 + mag + 3.350000 + + + hdnum + 11636 + ra + 28.660037 + dec + 20.808035 + mag + 2.660000 + + + hdnum + 11937 + ra + 28.989468 + dec + -51.608896 + mag + 3.720000 + + + hdnum + 12311 + ra + 29.692472 + dec + -61.569859 + mag + 2.860000 + + + hdnum + 12274 + ra + 30.001285 + dec + -21.077831 + mag + 4.000000 + + + hdnum + 12446 + ra + 30.511240 + dec + 2.763790 + mag + 3.820000 + + + hdnum + 12447 + ra + 30.511753 + dec + 2.763759 + mag + 3.820000 + + + hdnum + 12216 + ra + 30.858771 + dec + 72.421295 + mag + 3.950000 + + + hdnum + 12533 + ra + 30.974805 + dec + 42.329722 + mag + 2.170000 + + + hdnum + 12929 + ra + 31.793363 + dec + 23.462424 + mag + 2.020000 + + + hdnum + 13161 + ra + 32.385943 + dec + 34.987296 + mag + 3.020000 + + + hdnum + 14228 + ra + 34.127436 + dec + -51.512167 + mag + 3.550000 + + + hdnum + 8890 + ra + 37.954514 + dec + 89.264104 + mag + 2.000000 + + + hdnum + 16970 + ra + 40.825161 + dec + 3.235819 + mag + 3.470000 + + + hdnum + 17573 + ra + 42.495969 + dec + 27.260508 + mag + 3.620000 + + + hdnum + 17506 + ra + 42.674209 + dec + 55.895495 + mag + 3.760000 + + + hdnum + 17878 + ra + 43.564418 + dec + 52.762477 + mag + 3.940000 + + + hdnum + 18322 + ra + 44.106872 + dec + -8.898145 + mag + 3.900000 + + + hdnum + 18622 + ra + 44.565311 + dec + -40.304673 + mag + 3.220000 + + + hdnum + 18884 + ra + 45.569885 + dec + 4.089734 + mag + 2.550000 + + + hdnum + 18925 + ra + 46.199126 + dec + 53.506438 + mag + 2.940000 + + + hdnum + 19058 + ra + 46.294141 + dec + 38.840274 + mag + 3.410000 + + + hdnum + 19356 + ra + 47.042214 + dec + 40.955648 + mag + 2.110000 + + + hdnum + 19476 + ra + 47.374045 + dec + 44.857544 + mag + 3.790000 + + + hdnum + 20010 + ra + 48.018863 + dec + -28.987617 + mag + 3.800000 + + + hdnum + 20720 + ra + 49.879174 + dec + -21.757865 + mag + 3.740000 + + + hdnum + 20902 + ra + 51.080710 + dec + 49.861180 + mag + 1.810000 + + + hdnum + 21120 + ra + 51.203309 + dec + 9.028870 + mag + 3.610000 + + + hdnum + 21364 + ra + 51.792300 + dec + 9.732680 + mag + 3.730000 + + + hdnum + 22049 + ra + 53.232684 + dec + -9.458262 + mag + 3.730000 + + + hdnum + 22928 + ra + 55.731263 + dec + 47.787552 + mag + 3.020000 + + + hdnum + 23249 + ra + 55.812092 + dec + -9.763394 + mag + 3.530000 + + + hdnum + 23817 + ra + 56.049909 + dec + -64.806898 + mag + 3.840000 + + + hdnum + 23180 + ra + 56.079716 + dec + 32.288247 + mag + 3.860000 + + + hdnum + 23302 + ra + 56.218908 + dec + 24.113339 + mag + 3.710000 + + + hdnum + 23230 + ra + 56.298466 + dec + 42.578549 + mag + 3.780000 + + + hdnum + 23408 + ra + 56.456694 + dec + 24.367748 + mag + 3.880000 + + + hdnum + 24512 + ra + 56.809753 + dec + -74.238959 + mag + 3.260000 + + + hdnum + 23630 + ra + 56.871150 + dec + 24.105136 + mag + 2.870000 + + + hdnum + 23850 + ra + 57.290595 + dec + 24.053414 + mag + 3.630000 + + + hdnum + 24398 + ra + 58.533007 + dec + 31.883637 + mag + 2.880000 + + + hdnum + 24760 + ra + 59.463463 + dec + 40.010217 + mag + 2.910000 + + + hdnum + 25025 + ra + 59.507361 + dec + -13.508515 + mag + 2.960000 + + + hdnum + 25204 + ra + 60.170067 + dec + 12.490347 + mag + 3.420000 + + + hdnum + 25490 + ra + 60.789080 + dec + 5.989305 + mag + 3.900000 + + + hdnum + 26967 + ra + 63.500474 + dec + -42.294369 + mag + 3.860000 + + + hdnum + 27256 + ra + 63.606184 + dec + -62.473855 + mag + 3.340000 + + + hdnum + 27376 + ra + 64.473598 + dec + -33.798348 + mag + 3.560000 + + + hdnum + 27371 + ra + 64.948351 + dec + 15.627642 + mag + 3.650000 + + + hdnum + 27697 + ra + 65.733720 + dec + 17.542514 + mag + 3.760000 + + + hdnum + 28028 + ra + 66.009236 + dec + -34.016845 + mag + 3.960000 + + + hdnum + 28307 + ra + 67.143731 + dec + 15.962181 + mag + 3.840000 + + + hdnum + 28305 + ra + 67.154167 + dec + 19.180431 + mag + 3.540000 + + + hdnum + 28319 + ra + 67.165587 + dec + 15.870884 + mag + 3.410000 + + + hdnum + 29305 + ra + 68.499079 + dec + -55.044976 + mag + 3.260000 + + + hdnum + 29291 + ra + 68.887656 + dec + -30.562341 + mag + 3.810000 + + + hdnum + 29139 + ra + 68.980164 + dec + 16.509301 + mag + 0.990000 + + + hdnum + 29248 + ra + 69.079755 + dec + -3.352459 + mag + 3.930000 + + + hdnum + 29503 + ra + 69.545095 + dec + -14.304020 + mag + 3.870000 + + + hdnum + 30652 + ra + 72.460043 + dec + 6.961275 + mag + 3.190000 + + + hdnum + 30836 + ra + 72.801511 + dec + 5.605104 + mag + 3.680000 + + + hdnum + 31237 + ra + 73.562906 + dec + 2.440672 + mag + 3.710000 + + + hdnum + 31398 + ra + 74.248411 + dec + 33.166091 + mag + 2.680000 + + + hdnum + 31964 + ra + 75.492223 + dec + 43.823307 + mag + 3.030000 + + + hdnum + 32068 + ra + 75.619531 + dec + 41.075836 + mag + 3.760000 + + + hdnum + 32887 + ra + 76.365265 + dec + -22.371033 + mag + 3.180000 + + + hdnum + 32630 + ra + 76.628726 + dec + 41.234474 + mag + 3.170000 + + + hdnum + 33111 + ra + 76.962442 + dec + -5.086446 + mag + 2.790000 + + + hdnum + 33904 + ra + 78.232918 + dec + -16.205469 + mag + 3.290000 + + + hdnum + 34085 + ra + 78.634465 + dec + -8.201640 + mag + 0.280000 + + + hdnum + 34029 + ra + 79.172336 + dec + 45.997991 + mag + 0.080000 + + + hdnum + 34503 + ra + 79.401625 + dec + -6.844410 + mag + 3.600000 + + + hdnum + 35411 + ra + 81.119240 + dec + -2.397146 + mag + 3.390000 + + + hdnum + 35468 + ra + 81.282762 + dec + 6.349702 + mag + 1.660000 + + + hdnum + 35497 + ra + 81.572977 + dec + 28.607450 + mag + 1.680000 + + + hdnum + 36079 + ra + 82.061349 + dec + -20.759441 + mag + 2.840000 + + + hdnum + 36597 + ra + 82.803148 + dec + -35.470521 + mag + 3.870000 + + + hdnum + 36486 + ra + 83.001654 + dec + -0.299079 + mag + 2.230000 + + + hdnum + 36673 + ra + 83.182565 + dec + -17.822289 + mag + 2.590000 + + + hdnum + 37350 + ra + 83.406329 + dec + -62.489824 + mag + 3.760000 + + + hdnum + 36861 + ra + 83.784483 + dec + 9.934158 + mag + 3.390000 + + + hdnum + 37043 + ra + 83.858262 + dec + -5.909901 + mag + 2.780000 + + + hdnum + 37128 + ra + 84.053387 + dec + -1.201920 + mag + 1.720000 + + + hdnum + 37202 + ra + 84.411193 + dec + 21.142550 + mag + 3.000000 + + + hdnum + 37468 + ra + 84.686532 + dec + -2.600069 + mag + 3.800000 + + + hdnum + 37795 + ra + 84.912249 + dec + -34.074110 + mag + 2.660000 + + + hdnum + 37742 + ra + 85.189698 + dec + -1.942572 + mag + 1.740000 + + + hdnum + 38393 + ra + 86.115790 + dec + -22.448381 + mag + 3.600000 + + + hdnum + 38678 + ra + 86.738922 + dec + -14.821949 + mag + 3.550000 + + + hdnum + 39060 + ra + 86.821198 + dec + -51.066514 + mag + 3.860000 + + + hdnum + 38771 + ra + 86.939115 + dec + -9.669605 + mag + 2.060000 + + + hdnum + 39425 + ra + 87.739968 + dec + -35.768307 + mag + 3.110000 + + + hdnum + 39364 + ra + 87.830400 + dec + -20.879089 + mag + 3.780000 + + + hdnum + 39003 + ra + 87.872494 + dec + 39.148479 + mag + 3.970000 + + + hdnum + 39801 + ra + 88.792937 + dec + 7.407063 + mag + 0.570000 + + + hdnum + 40136 + ra + 89.101218 + dec + -14.167700 + mag + 3.720000 + + + hdnum + 40808 + ra + 89.786689 + dec + -42.815136 + mag + 3.940000 + + + hdnum + 40035 + ra + 89.881820 + dec + 54.284656 + mag + 3.730000 + + + hdnum + 40183 + ra + 89.882182 + dec + 44.947433 + mag + 1.900000 + + + hdnum + 40312 + ra + 89.930294 + dec + 37.212585 + mag + 2.650000 + + + hdnum + 43232 + ra + 93.713891 + dec + -6.274776 + mag + 3.980000 + + + hdnum + 42995 + ra + 93.719409 + dec + 22.506800 + mag + 3.300000 + + + hdnum + 44402 + ra + 95.078303 + dec + -30.063368 + mag + 3.020000 + + + hdnum + 44762 + ra + 95.528453 + dec + -33.436402 + mag + 3.850000 + + + hdnum + 44743 + ra + 95.674940 + dec + -17.955917 + mag + 1.960000 + + + hdnum + 44478 + ra + 95.740114 + dec + 22.513586 + mag + 2.900000 + + + hdnum + 45348 + ra + 95.987961 + dec + -52.695661 + mag + -0.630000 + + + hdnum + 47205 + ra + 99.170993 + dec + -19.255878 + mag + 3.950000 + + + hdnum + 47105 + ra + 99.427918 + dec + 16.399252 + mag + 2.020000 + + + hdnum + 47670 + ra + 99.440301 + dec + -43.195933 + mag + 3.180000 + + + hdnum + 48329 + ra + 100.983022 + dec + 25.131124 + mag + 3.010000 + + + hdnum + 48915 + ra + 101.287156 + dec + -16.716116 + mag + -1.440000 + + + hdnum + 48737 + ra + 101.322352 + dec + 12.895591 + mag + 3.340000 + + + hdnum + 50241 + ra + 102.047712 + dec + -61.941394 + mag + 3.250000 + + + hdnum + 50013 + ra + 102.460241 + dec + -32.508477 + mag + 3.530000 + + + hdnum + 50310 + ra + 102.484031 + dec + -50.614560 + mag + 2.940000 + + + hdnum + 50019 + ra + 103.197239 + dec + 33.961254 + mag + 3.610000 + + + hdnum + 50877 + ra + 103.533134 + dec + -24.184213 + mag + 3.840000 + + + hdnum + 52089 + ra + 104.656448 + dec + -28.972085 + mag + 1.530000 + + + hdnum + 52877 + ra + 105.429782 + dec + -27.934830 + mag + 3.470000 + + + hdnum + 53138 + ra + 105.756136 + dec + -23.833289 + mag + 3.040000 + + + hdnum + 54605 + ra + 107.097858 + dec + -26.393200 + mag + 1.840000 + + + hdnum + 55865 + ra + 107.186944 + dec + -70.498931 + mag + 3.760000 + + + hdnum + 57623 + ra + 109.207601 + dec + -67.957152 + mag + 3.970000 + + + hdnum + 56855 + ra + 109.285650 + dec + -37.097469 + mag + 2.710000 + + + hdnum + 56537 + ra + 109.523244 + dec + 16.540382 + mag + 3.580000 + + + hdnum + 56986 + ra + 110.030741 + dec + 21.982320 + mag + 3.540000 + + + hdnum + 58350 + ra + 111.023755 + dec + -29.303103 + mag + 2.460000 + + + hdnum + 58207 + ra + 111.431647 + dec + 27.798081 + mag + 3.790000 + + + hdnum + 58715 + ra + 111.787684 + dec + 8.289315 + mag + 2.890000 + + + hdnum + 59717 + ra + 112.307626 + dec + -43.301432 + mag + 3.260000 + + + hdnum + 60179 + ra + 113.649430 + dec + 31.888278 + mag + 1.580000 + + + hdnum + 60178 + ra + 113.650420 + dec + 31.888493 + mag + 2.880000 + + + hdnum + 61421 + ra + 114.825493 + dec + 5.224993 + mag + 0.400000 + + + hdnum + 61935 + ra + 115.311802 + dec + -9.551132 + mag + 3.940000 + + + hdnum + 63295 + ra + 115.455250 + dec + -72.606092 + mag + 3.950000 + + + hdnum + 62623 + ra + 115.951955 + dec + -28.954825 + mag + 3.980000 + + + hdnum + 62345 + ra + 116.111891 + dec + 24.397992 + mag + 3.570000 + + + hdnum + 63032 + ra + 116.313737 + dec + -37.968581 + mag + 3.620000 + + + hdnum + 62509 + ra + 116.328954 + dec + 28.026199 + mag + 1.220000 + + + hdnum + 63700 + ra + 117.323566 + dec + -24.859785 + mag + 3.330000 + + + hdnum + 64440 + ra + 118.054315 + dec + -40.575787 + mag + 3.720000 + + + hdnum + 65575 + ra + 119.194642 + dec + -52.982361 + mag + 3.460000 + + + hdnum + 66811 + ra + 120.896029 + dec + -40.003148 + mag + 2.220000 + + + hdnum + 67523 + ra + 121.886037 + dec + -24.304325 + mag + 2.830000 + + + hdnum + 68273 + ra + 122.383125 + dec + -47.336585 + mag + 1.790000 + + + hdnum + 69267 + ra + 124.128839 + dec + 9.185545 + mag + 3.520000 + + + hdnum + 71129 + ra + 125.628475 + dec + -59.509485 + mag + 1.950000 + + + hdnum + 71155 + ra + 126.415136 + dec + -3.906423 + mag + 3.890000 + + + hdnum + 71878 + ra + 126.434137 + dec + -66.136886 + mag + 3.770000 + + + hdnum + 71369 + ra + 127.566118 + dec + 60.718169 + mag + 3.360000 + + + hdnum + 74006 + ra + 130.025601 + dec + -35.308352 + mag + 3.970000 + + + hdnum + 74195 + ra + 130.073276 + dec + -52.921887 + mag + 3.600000 + + + hdnum + 74180 + ra + 130.156536 + dec + -46.648744 + mag + 3.810000 + + + hdnum + 74575 + ra + 130.898076 + dec + -33.186387 + mag + 3.690000 + + + hdnum + 74442 + ra + 131.171256 + dec + 18.154308 + mag + 3.930000 + + + hdnum + 74956 + ra + 131.175955 + dec + -54.708821 + mag + 1.940000 + + + hdnum + 75063 + ra + 131.506850 + dec + -46.041527 + mag + 3.900000 + + + hdnum + 74874 + ra + 131.693793 + dec + 6.418809 + mag + 3.400000 + + + hdnum + 76728 + ra + 133.761783 + dec + -60.644608 + mag + 3.840000 + + + hdnum + 76294 + ra + 133.848444 + dec + 5.945563 + mag + 3.120000 + + + hdnum + 76644 + ra + 134.801898 + dec + 48.041829 + mag + 3.140000 + + + hdnum + 76943 + ra + 135.159881 + dec + 41.782910 + mag + 3.970000 + + + hdnum + 78045 + ra + 135.611644 + dec + -66.396078 + mag + 4.000000 + + + hdnum + 77327 + ra + 135.906394 + dec + 47.156524 + mag + 3.580000 + + + hdnum + 78004 + ra + 136.038667 + dec + -47.097737 + mag + 3.750000 + + + hdnum + 78647 + ra + 136.998992 + dec + -43.432589 + mag + 2.210000 + + + hdnum + 79351 + ra + 137.742021 + dec + -58.966895 + mag + 3.430000 + + + hdnum + 79447 + ra + 137.819666 + dec + -62.316979 + mag + 3.960000 + + + hdnum + 80007 + ra + 138.299897 + dec + -69.717209 + mag + 1.670000 + + + hdnum + 79469 + ra + 138.591082 + dec + 2.314280 + mag + 3.890000 + + + hdnum + 80404 + ra + 139.272516 + dec + -59.275230 + mag + 2.250000 + + + hdnum + 80081 + ra + 139.711014 + dec + 36.802596 + mag + 3.820000 + + + hdnum + 80493 + ra + 140.263754 + dec + 34.392564 + mag + 3.130000 + + + hdnum + 81188 + ra + 140.528410 + dec + -55.010668 + mag + 2.480000 + + + hdnum + 81797 + ra + 141.896852 + dec + -8.658603 + mag + 1.990000 + + + hdnum + 82434 + ra + 142.675002 + dec + -40.466771 + mag + 3.590000 + + + hdnum + 82668 + ra + 142.805500 + dec + -57.034378 + mag + 3.160000 + + + hdnum + 81937 + ra + 142.882107 + dec + 63.061859 + mag + 3.650000 + + + hdnum + 82328 + ra + 143.214314 + dec + 51.677300 + mag + 3.180000 + + + hdnum + 83618 + ra + 144.964003 + dec + -1.142810 + mag + 3.900000 + + + hdnum + 83808 + ra + 145.287645 + dec + 9.892308 + mag + 3.530000 + + + hdnum + 84810 + ra + 146.311709 + dec + -62.507904 + mag + 3.690000 + + + hdnum + 84441 + ra + 146.462793 + dec + 23.774254 + mag + 2.970000 + + + hdnum + 85123 + ra + 146.775506 + dec + -65.072005 + mag + 3.010000 + + + hdnum + 84999 + ra + 147.747333 + dec + 59.038735 + mag + 3.780000 + + + hdnum + 85503 + ra + 148.190899 + dec + 26.006953 + mag + 3.880000 + + + hdnum + 86440 + ra + 149.215591 + dec + -54.567792 + mag + 3.540000 + + + hdnum + 87737 + ra + 151.833124 + dec + 16.762666 + mag + 3.520000 + + + hdnum + 87901 + ra + 152.092959 + dec + 11.967207 + mag + 1.410000 + + + hdnum + 88284 + ra + 152.646983 + dec + -12.354083 + mag + 3.610000 + + + hdnum + 89080 + ra + 153.434230 + dec + -70.037900 + mag + 3.300000 + + + hdnum + 88955 + ra + 153.683969 + dec + -42.121941 + mag + 3.840000 + + + hdnum + 89025 + ra + 154.172574 + dec + 23.417310 + mag + 3.440000 + + + hdnum + 89388 + ra + 154.270737 + dec + -61.332305 + mag + 3.370000 + + + hdnum + 89021 + ra + 154.274125 + dec + 42.914365 + mag + 3.440000 + + + hdnum + 89484 + ra + 154.993152 + dec + 19.841488 + mag + 2.230000 + + + hdnum + 89485 + ra + 154.994245 + dec + 19.840752 + mag + 3.470000 + + + hdnum + 89758 + ra + 155.582243 + dec + 41.499516 + mag + 3.050000 + + + hdnum + 90589 + ra + 156.098769 + dec + -74.031608 + mag + 3.990000 + + + hdnum + 90432 + ra + 156.522609 + dec + -16.836290 + mag + 3.820000 + + + hdnum + 90853 + ra + 156.969714 + dec + -58.739401 + mag + 3.830000 + + + hdnum + 91465 + ra + 158.006099 + dec + -61.685330 + mag + 3.370000 + + + hdnum + 91316 + ra + 158.202809 + dec + 9.306585 + mag + 3.850000 + + + hdnum + 92139 + ra + 159.325596 + dec + -48.225620 + mag + 3.840000 + + + hdnum + 93030 + ra + 160.739172 + dec + -64.394450 + mag + 2.740000 + + + hdnum + 93497 + ra + 161.692407 + dec + -49.420254 + mag + 2.720000 + + + hdnum + 93813 + ra + 162.406203 + dec + -16.193648 + mag + 3.110000 + + + hdnum + 94264 + ra + 163.327937 + dec + 34.214870 + mag + 3.790000 + + + hdnum + 94510 + ra + 163.373562 + dec + -58.853172 + mag + 3.790000 + + + hdnum + 95418 + ra + 165.460322 + dec + 56.382426 + mag + 2.350000 + + + hdnum + 95689 + ra + 165.931946 + dec + 61.751037 + mag + 1.820000 + + + hdnum + 96918 + ra + 167.147460 + dec + -58.975036 + mag + 3.920000 + + + hdnum + 96833 + ra + 167.415860 + dec + 44.498484 + mag + 3.000000 + + + hdnum + 97603 + ra + 168.527090 + dec + 20.523718 + mag + 2.560000 + + + hdnum + 97633 + ra + 168.560026 + dec + 15.429570 + mag + 3.330000 + + + hdnum + 98230 + ra + 169.545581 + dec + 31.529236 + mag + 3.790000 + + + hdnum + 98262 + ra + 169.619729 + dec + 33.094305 + mag + 3.490000 + + + hdnum + 98430 + ra + 169.835208 + dec + -14.778542 + mag + 3.570000 + + + hdnum + 98718 + ra + 170.251699 + dec + -54.491020 + mag + 3.890000 + + + hdnum + 99028 + ra + 170.981054 + dec + 10.529508 + mag + 3.960000 + + + hdnum + 100029 + ra + 172.850928 + dec + 69.331078 + mag + 3.810000 + + + hdnum + 100407 + ra + 173.250494 + dec + -31.857624 + mag + 3.540000 + + + hdnum + 100841 + ra + 173.945356 + dec + -63.019840 + mag + 3.120000 + + + hdnum + 102249 + ra + 176.401752 + dec + -66.728763 + mag + 3.630000 + + + hdnum + 102224 + ra + 176.512551 + dec + 47.779407 + mag + 3.700000 + + + hdnum + 102647 + ra + 177.264910 + dec + 14.572060 + mag + 2.130000 + + + hdnum + 102870 + ra + 177.673834 + dec + 1.764718 + mag + 3.600000 + + + hdnum + 103287 + ra + 178.457707 + dec + 53.694760 + mag + 2.430000 + + + hdnum + 105435 + ra + 182.089578 + dec + -50.722426 + mag + 2.580000 + + + hdnum + 105707 + ra + 182.531177 + dec + -22.619766 + mag + 3.010000 + + + hdnum + 105937 + ra + 182.912958 + dec + -52.368461 + mag + 3.960000 + + + hdnum + 106490 + ra + 183.786320 + dec + -58.748930 + mag + 2.790000 + + + hdnum + 106591 + ra + 183.856507 + dec + 57.032616 + mag + 3.300000 + + + hdnum + 106625 + ra + 183.951543 + dec + -17.541929 + mag + 2.590000 + + + hdnum + 107259 + ra + 184.976481 + dec + -0.666803 + mag + 3.890000 + + + hdnum + 107446 + ra + 185.340038 + dec + -60.401146 + mag + 3.590000 + + + hdnum + 108248 + ra + 186.649563 + dec + -63.099091 + mag + 1.280000 + + + hdnum + 108249 + ra + 186.651844 + dec + -63.099521 + mag + 1.580000 + + + hdnum + 108483 + ra + 187.009924 + dec + -50.230635 + mag + 3.910000 + + + hdnum + 108767 + ra + 187.466071 + dec + -16.515432 + mag + 2.970000 + + + hdnum + 108903 + ra + 187.791502 + dec + -57.113212 + mag + 1.650000 + + + hdnum + 109026 + ra + 188.116729 + dec + -72.132986 + mag + 3.840000 + + + hdnum + 109387 + ra + 188.370607 + dec + 69.788236 + mag + 3.890000 + + + hdnum + 109379 + ra + 188.596823 + dec + -23.396758 + mag + 2.660000 + + + hdnum + 109668 + ra + 189.295920 + dec + -69.135564 + mag + 2.690000 + + + hdnum + 109787 + ra + 189.425680 + dec + -48.541304 + mag + 3.850000 + + + hdnum + 110304 + ra + 190.379338 + dec + -48.959889 + mag + 2.180000 + + + hdnum + 110380 + ra + 190.414677 + dec + -1.449430 + mag + 3.500000 + + + hdnum + 110379 + ra + 190.415183 + dec + -1.449375 + mag + 3.480000 + + + hdnum + 110879 + ra + 191.570018 + dec + -68.108119 + mag + 3.080000 + + + hdnum + 111123 + ra + 191.930269 + dec + -59.688764 + mag + 1.310000 + + + hdnum + 112185 + ra + 193.507291 + dec + 55.959818 + mag + 1.760000 + + + hdnum + 112092 + ra + 193.648444 + dec + -57.177925 + mag + 4.000000 + + + hdnum + 112300 + ra + 193.900861 + dec + 3.397470 + mag + 3.420000 + + + hdnum + 112413 + ra + 194.006947 + dec + 38.318379 + mag + 2.890000 + + + hdnum + 113226 + ra + 195.544163 + dec + 10.959150 + mag + 2.840000 + + + hdnum + 112985 + ra + 195.567768 + dec + -71.548861 + mag + 3.610000 + + + hdnum + 115659 + ra + 199.730413 + dec + -23.171512 + mag + 3.000000 + + + hdnum + 115892 + ra + 200.149241 + dec + -36.712294 + mag + 2.760000 + + + hdnum + 116656 + ra + 200.981431 + dec + 54.925362 + mag + 2.220000 + + + hdnum + 116657 + ra + 200.984709 + dec + 54.921821 + mag + 3.860000 + + + hdnum + 116658 + ra + 201.298242 + dec + -11.161321 + mag + 1.060000 + + + hdnum + 116842 + ra + 201.306411 + dec + 54.987958 + mag + 4.000000 + + + hdnum + 117440 + ra + 202.761037 + dec + -39.407302 + mag + 3.900000 + + + hdnum + 118098 + ra + 203.673290 + dec + -0.595820 + mag + 3.380000 + + + hdnum + 118716 + ra + 204.971914 + dec + -53.466393 + mag + 2.280000 + + + hdnum + 120315 + ra + 206.885160 + dec + 49.313266 + mag + 1.860000 + + + hdnum + 120307 + ra + 207.376155 + dec + -41.687711 + mag + 3.400000 + + + hdnum + 120324 + ra + 207.404117 + dec + -42.473733 + mag + 3.470000 + + + hdnum + 121370 + ra + 208.671158 + dec + 18.397717 + mag + 2.680000 + + + hdnum + 121263 + ra + 208.884930 + dec + -47.288374 + mag + 2.530000 + + + hdnum + 121743 + ra + 209.567785 + dec + -42.100753 + mag + 3.820000 + + + hdnum + 121790 + ra + 209.669787 + dec + -44.803585 + mag + 3.860000 + + + hdnum + 122451 + ra + 210.955857 + dec + -60.373039 + mag + 0.640000 + + + hdnum + 123299 + ra + 211.097296 + dec + 64.375844 + mag + 3.650000 + + + hdnum + 123123 + ra + 211.592908 + dec + -26.682361 + mag + 3.260000 + + + hdnum + 123139 + ra + 211.670622 + dec + -36.369955 + mag + 2.080000 + + + hdnum + 124897 + ra + 213.915296 + dec + 19.182414 + mag + 0.160000 + + + hdnum + 125238 + ra + 214.850922 + dec + -46.058093 + mag + 3.550000 + + + hdnum + 127665 + ra + 217.957456 + dec + 30.371437 + mag + 3.570000 + + + hdnum + 127762 + ra + 218.019474 + dec + 38.308253 + mag + 3.040000 + + + hdnum + 127972 + ra + 218.876772 + dec + -42.157826 + mag + 2.340000 + + + hdnum + 128621 + ra + 219.896164 + dec + -60.837157 + mag + 1.350000 + + + hdnum + 128620 + ra + 219.902066 + dec + -60.833975 + mag + -0.010000 + + + hdnum + 129246 + ra + 220.287111 + dec + 13.728409 + mag + 3.780000 + + + hdnum + 129247 + ra + 220.287288 + dec + 13.728300 + mag + 3.780000 + + + hdnum + 129056 + ra + 220.482318 + dec + -47.388197 + mag + 2.290000 + + + hdnum + 129116 + ra + 220.489954 + dec + -37.793499 + mag + 4.000000 + + + hdnum + 128898 + ra + 220.626749 + dec + -64.975139 + mag + 3.180000 + + + hdnum + 129502 + ra + 220.765087 + dec + -5.658206 + mag + 3.870000 + + + hdnum + 129989 + ra + 221.246739 + dec + 27.074223 + mag + 2.500000 + + + hdnum + 130109 + ra + 221.562184 + dec + 1.892886 + mag + 3.730000 + + + hdnum + 129078 + ra + 221.965452 + dec + -79.044755 + mag + 3.810000 + + + hdnum + 131873 + ra + 222.676366 + dec + 74.155500 + mag + 2.060000 + + + hdnum + 130841 + ra + 222.719642 + dec + -16.041778 + mag + 2.750000 + + + hdnum + 132058 + ra + 224.633024 + dec + -43.133959 + mag + 2.680000 + + + hdnum + 132200 + ra + 224.790350 + dec + -42.104185 + mag + 3.130000 + + + hdnum + 133208 + ra + 225.486510 + dec + 40.390563 + mag + 3.480000 + + + hdnum + 133216 + ra + 226.017558 + dec + -25.281966 + mag + 3.280000 + + + hdnum + 133242 + ra + 226.279523 + dec + -47.051247 + mag + 3.910000 + + + hdnum + 134481 + ra + 227.983641 + dec + -48.737819 + mag + 3.860000 + + + hdnum + 134505 + ra + 228.071232 + dec + -52.099249 + mag + 3.410000 + + + hdnum + 135722 + ra + 228.875691 + dec + 33.314835 + mag + 3.470000 + + + hdnum + 135742 + ra + 229.251720 + dec + -9.382918 + mag + 2.610000 + + + hdnum + 135382 + ra + 229.727429 + dec + -68.679540 + mag + 2.880000 + + + hdnum + 137422 + ra + 230.182156 + dec + 71.834015 + mag + 3.030000 + + + hdnum + 136298 + ra + 230.342993 + dec + -40.647518 + mag + 3.220000 + + + hdnum + 136422 + ra + 230.451539 + dec + -36.261375 + mag + 3.560000 + + + hdnum + 136504 + ra + 230.670296 + dec + -44.689607 + mag + 3.380000 + + + hdnum + 137759 + ra + 231.232393 + dec + 58.966061 + mag + 3.300000 + + + hdnum + 137909 + ra + 231.957213 + dec + 29.105704 + mag + 3.660000 + + + hdnum + 139006 + ra + 233.671946 + dec + 26.714694 + mag + 2.220000 + + + hdnum + 138690 + ra + 233.785190 + dec + -41.166756 + mag + 2.780000 + + + hdnum + 138905 + ra + 233.881578 + dec + -14.789537 + mag + 3.920000 + + + hdnum + 139063 + ra + 234.256036 + dec + -28.135081 + mag + 3.600000 + + + hdnum + 139365 + ra + 234.664044 + dec + -29.777753 + mag + 3.660000 + + + hdnum + 140436 + ra + 235.685677 + dec + 26.295637 + mag + 3.820000 + + + hdnum + 140573 + ra + 236.066965 + dec + 6.425627 + mag + 2.630000 + + + hdnum + 141003 + ra + 236.546909 + dec + 15.421826 + mag + 3.660000 + + + hdnum + 141513 + ra + 237.405027 + dec + -3.430208 + mag + 3.550000 + + + hdnum + 141795 + ra + 237.704025 + dec + 4.477730 + mag + 3.710000 + + + hdnum + 141556 + ra + 237.739733 + dec + -33.627166 + mag + 3.960000 + + + hdnum + 141891 + ra + 238.785681 + dec + -63.430724 + mag + 2.840000 + + + hdnum + 142860 + ra + 239.113257 + dec + 15.661617 + mag + 3.850000 + + + hdnum + 142669 + ra + 239.221147 + dec + -29.214075 + mag + 3.880000 + + + hdnum + 143018 + ra + 239.712975 + dec + -26.114105 + mag + 2.890000 + + + hdnum + 143118 + ra + 240.030524 + dec + -38.396704 + mag + 3.430000 + + + hdnum + 143275 + ra + 240.083362 + dec + -22.621730 + mag + 2.300000 + + + hdnum + 144217 + ra + 241.359296 + dec + -19.805453 + mag + 2.620000 + + + hdnum + 144470 + ra + 241.701762 + dec + -20.669194 + mag + 3.950000 + + + hdnum + 146051 + ra + 243.586402 + dec + -3.694323 + mag + 2.730000 + + + hdnum + 145544 + ra + 243.859473 + dec + -63.685681 + mag + 3.850000 + + + hdnum + 146791 + ra + 244.580359 + dec + -4.692511 + mag + 3.240000 + + + hdnum + 147394 + ra + 244.935146 + dec + 46.313365 + mag + 3.900000 + + + hdnum + 147165 + ra + 245.297146 + dec + -25.592796 + mag + 2.910000 + + + hdnum + 147547 + ra + 245.480059 + dec + 19.153129 + mag + 3.740000 + + + hdnum + 148387 + ra + 245.997869 + dec + 61.514214 + mag + 2.730000 + + + hdnum + 148478 + ra + 247.351913 + dec + -26.432002 + mag + 1.070000 + + + hdnum + 148856 + ra + 247.554988 + dec + 21.489612 + mag + 2.780000 + + + hdnum + 148857 + ra + 247.728420 + dec + 1.983923 + mag + 3.900000 + + + hdnum + 147675 + ra + 248.362863 + dec + -78.897148 + mag + 3.870000 + + + hdnum + 149438 + ra + 248.970641 + dec + -28.216017 + mag + 2.830000 + + + hdnum + 149757 + ra + 249.289747 + dec + -10.567090 + mag + 2.580000 + + + hdnum + 150680 + ra + 250.321515 + dec + 31.602725 + mag + 2.850000 + + + hdnum + 150997 + ra + 250.724005 + dec + 38.922253 + mag + 3.480000 + + + hdnum + 150798 + ra + 252.166240 + dec + -69.027715 + mag + 1.910000 + + + hdnum + 151249 + ra + 252.446496 + dec + -59.041378 + mag + 3.760000 + + + hdnum + 151680 + ra + 252.540890 + dec + -34.293232 + mag + 2.290000 + + + hdnum + 151890 + ra + 252.967640 + dec + -38.047378 + mag + 3.000000 + + + hdnum + 151985 + ra + 253.083944 + dec + -38.017536 + mag + 3.560000 + + + hdnum + 152334 + ra + 253.645850 + dec + -42.361311 + mag + 3.610000 + + + hdnum + 153210 + ra + 254.417061 + dec + 9.375032 + mag + 3.190000 + + + hdnum + 152786 + ra + 254.655052 + dec + -55.990138 + mag + 3.110000 + + + hdnum + 153808 + ra + 255.072376 + dec + 30.926403 + mag + 3.910000 + + + hdnum + 155763 + ra + 257.196647 + dec + 65.714684 + mag + 3.180000 + + + hdnum + 155125 + ra + 257.594547 + dec + -15.724911 + mag + 2.430000 + + + hdnum + 155203 + ra + 258.038290 + dec + -43.239189 + mag + 3.320000 + + + hdnum + 156014 + ra + 258.661887 + dec + 14.390333 + mag + 3.370000 + + + hdnum + 156164 + ra + 258.757974 + dec + 24.839206 + mag + 3.130000 + + + hdnum + 156283 + ra + 258.761799 + dec + 36.809163 + mag + 3.140000 + + + hdnum + 157056 + ra + 260.502404 + dec + -24.999546 + mag + 3.260000 + + + hdnum + 157244 + ra + 261.324950 + dec + -55.529885 + mag + 2.820000 + + + hdnum + 157246 + ra + 261.348583 + dec + -56.377727 + mag + 3.320000 + + + hdnum + 159181 + ra + 262.608179 + dec + 52.301388 + mag + 2.800000 + + + hdnum + 158408 + ra + 262.690988 + dec + -37.295811 + mag + 2.680000 + + + hdnum + 158094 + ra + 262.774617 + dec + -60.683847 + mag + 3.600000 + + + hdnum + 158427 + ra + 262.960398 + dec + -49.876145 + mag + 2.850000 + + + hdnum + 158926 + ra + 263.402147 + dec + -37.103821 + mag + 1.630000 + + + hdnum + 159561 + ra + 263.733630 + dec + 12.560035 + mag + 2.090000 + + + hdnum + 159532 + ra + 264.329714 + dec + -42.997827 + mag + 1.860000 + + + hdnum + 159876 + ra + 264.396677 + dec + -15.398557 + mag + 3.540000 + + + hdnum + 160762 + ra + 264.866185 + dec + 46.006334 + mag + 3.810000 + + + hdnum + 160578 + ra + 265.621986 + dec + -39.029982 + mag + 2.390000 + + + hdnum + 161096 + ra + 265.868146 + dec + 4.567303 + mag + 2.770000 + + + hdnum + 160635 + ra + 266.433276 + dec + -64.723870 + mag + 3.590000 + + + hdnum + 161797 + ra + 266.614686 + dec + 27.720676 + mag + 3.420000 + + + hdnum + 161471 + ra + 266.896171 + dec + -40.126999 + mag + 3.010000 + + + hdnum + 161868 + ra + 266.973189 + dec + 2.707276 + mag + 3.750000 + + + hdnum + 161892 + ra + 267.464498 + dec + -37.043306 + mag + 3.190000 + + + hdnum + 163588 + ra + 268.382202 + dec + 56.872642 + mag + 3.740000 + + + hdnum + 163770 + ra + 269.063254 + dec + 37.250537 + mag + 3.840000 + + + hdnum + 164058 + ra + 269.151555 + dec + 51.488896 + mag + 2.230000 + + + hdnum + 163993 + ra + 269.441182 + dec + 29.247877 + mag + 3.700000 + + + hdnum + 163917 + ra + 269.756627 + dec + -9.773632 + mag + 3.320000 + + + hdnum + 164353 + ra + 270.161302 + dec + 2.931567 + mag + 3.980000 + + + hdnum + 165135 + ra + 271.452017 + dec + -30.424091 + mag + 3.630000 + + + hdnum + 165024 + ra + 271.657797 + dec + -50.091477 + mag + 3.670000 + + + hdnum + 165777 + ra + 271.837431 + dec + 9.563848 + mag + 3.720000 + + + hdnum + 166014 + ra + 271.885625 + dec + 28.762490 + mag + 3.840000 + + + hdnum + 166937 + ra + 273.440886 + dec + -21.058834 + mag + 3.840000 + + + hdnum + 167618 + ra + 274.406811 + dec + -36.761683 + mag + 3.130000 + + + hdnum + 168454 + ra + 275.248509 + dec + -29.828105 + mag + 2.700000 + + + hdnum + 170153 + ra + 275.264109 + dec + 72.732840 + mag + 3.570000 + + + hdnum + 168723 + ra + 275.327521 + dec + -2.898825 + mag + 3.250000 + + + hdnum + 169414 + ra + 275.924534 + dec + 21.769753 + mag + 3.850000 + + + hdnum + 169022 + ra + 276.042997 + dec + -34.384617 + mag + 1.810000 + + + hdnum + 169467 + ra + 276.743419 + dec + -45.968461 + mag + 3.490000 + + + hdnum + 169916 + ra + 276.992666 + dec + -25.421699 + mag + 2.830000 + + + hdnum + 171443 + ra + 278.801792 + dec + -8.244073 + mag + 3.850000 + + + hdnum + 172167 + ra + 279.234744 + dec + 38.783692 + mag + 0.030000 + + + hdnum + 173300 + ra + 281.414121 + dec + -26.990778 + mag + 3.170000 + + + hdnum + 174638 + ra + 282.519983 + dec + 33.362667 + mag + 3.520000 + + + hdnum + 175191 + ra + 283.816353 + dec + -26.296722 + mag + 2.070000 + + + hdnum + 175775 + ra + 284.432491 + dec + -21.106654 + mag + 3.530000 + + + hdnum + 176437 + ra + 284.735943 + dec + 32.689555 + mag + 3.250000 + + + hdnum + 176687 + ra + 285.652991 + dec + -29.880107 + mag + 2.610000 + + + hdnum + 177241 + ra + 286.170747 + dec + -21.741494 + mag + 3.770000 + + + hdnum + 177724 + ra + 286.352539 + dec + 13.863477 + mag + 2.990000 + + + hdnum + 177756 + ra + 286.562253 + dec + -4.882554 + mag + 3.440000 + + + hdnum + 177716 + ra + 286.735057 + dec + -27.670423 + mag + 3.320000 + + + hdnum + 178524 + ra + 287.440971 + dec + -21.023614 + mag + 2.900000 + + + hdnum + 180711 + ra + 288.138770 + dec + 67.661548 + mag + 3.080000 + + + hdnum + 181276 + ra + 289.275696 + dec + 53.368458 + mag + 3.800000 + + + hdnum + 181577 + ra + 290.418141 + dec + -17.847197 + mag + 3.930000 + + + hdnum + 181869 + ra + 290.971550 + dec + -40.615938 + mag + 3.960000 + + + hdnum + 182640 + ra + 291.374586 + dec + 3.114775 + mag + 3.370000 + + + hdnum + 184006 + ra + 292.426490 + dec + 51.729780 + mag + 3.770000 + + + hdnum + 183912 + ra + 292.680327 + dec + 27.959680 + mag + 3.080000 + + + hdnum + 186882 + ra + 296.243664 + dec + 45.130810 + mag + 2.910000 + + + hdnum + 186791 + ra + 296.564901 + dec + 10.613261 + mag + 2.710000 + + + hdnum + 187076 + ra + 296.846933 + dec + 18.534280 + mag + 3.830000 + + + hdnum + 188119 + ra + 297.043124 + dec + 70.267927 + mag + 3.840000 + + + hdnum + 187642 + ra + 297.695844 + dec + 8.868323 + mag + 0.930000 + + + hdnum + 187929 + ra + 298.118196 + dec + 1.005661 + mag + 3.870000 + + + hdnum + 188512 + ra + 298.828317 + dec + 6.406764 + mag + 3.720000 + + + hdnum + 188947 + ra + 299.076526 + dec + 35.083424 + mag + 3.900000 + + + hdnum + 189319 + ra + 299.689276 + dec + 19.492148 + mag + 3.510000 + + + hdnum + 188228 + ra + 300.148128 + dec + -72.910507 + mag + 3.950000 + + + hdnum + 190248 + ra + 302.181694 + dec + -66.182067 + mag + 3.550000 + + + hdnum + 191692 + ra + 302.826190 + dec + -0.821461 + mag + 3.250000 + + + hdnum + 192577 + ra + 303.407931 + dec + 46.741331 + mag + 3.810000 + + + hdnum + 192909 + ra + 303.868013 + dec + 47.714206 + mag + 4.000000 + + + hdnum + 192947 + ra + 304.513548 + dec + -12.544852 + mag + 3.580000 + + + hdnum + 193495 + ra + 305.252820 + dec + -14.781368 + mag + 3.090000 + + + hdnum + 194093 + ra + 305.557091 + dec + 40.256681 + mag + 2.230000 + + + hdnum + 193924 + ra + 306.411903 + dec + -56.735089 + mag + 1.920000 + + + hdnum + 196524 + ra + 309.387270 + dec + 14.595091 + mag + 3.630000 + + + hdnum + 196171 + ra + 309.391805 + dec + -47.291499 + mag + 3.110000 + + + hdnum + 196867 + ra + 309.909534 + dec + 15.912080 + mag + 3.780000 + + + hdnum + 197345 + ra + 310.357977 + dec + 45.280340 + mag + 1.330000 + + + hdnum + 197051 + ra + 311.239563 + dec + -66.203207 + mag + 3.420000 + + + hdnum + 198149 + ra + 311.322399 + dec + 61.838784 + mag + 3.420000 + + + hdnum + 197989 + ra + 311.552850 + dec + 33.970257 + mag + 2.490000 + + + hdnum + 198001 + ra + 311.918975 + dec + -9.495776 + mag + 3.770000 + + + hdnum + 198700 + ra + 313.702502 + dec + -58.454152 + mag + 3.650000 + + + hdnum + 199629 + ra + 314.293422 + dec + 41.167142 + mag + 3.940000 + + + hdnum + 200905 + ra + 316.232759 + dec + 43.927853 + mag + 3.710000 + + + hdnum + 202109 + ra + 318.234114 + dec + 30.226917 + mag + 3.200000 + + + hdnum + 202444 + ra + 318.697883 + dec + 38.045318 + mag + 3.740000 + + + hdnum + 202447 + ra + 318.955955 + dec + 5.247845 + mag + 3.940000 + + + hdnum + 203280 + ra + 319.644875 + dec + 62.585570 + mag + 2.470000 + + + hdnum + 204075 + ra + 321.666775 + dec + -22.411333 + mag + 3.750000 + + + hdnum + 205021 + ra + 322.164969 + dec + 70.560717 + mag + 3.230000 + + + hdnum + 204867 + ra + 322.889734 + dec + -5.571172 + mag + 2.890000 + + + hdnum + 205435 + ra + 323.495217 + dec + 45.591837 + mag + 3.990000 + + + hdnum + 206088 + ra + 325.022748 + dec + -16.662308 + mag + 3.680000 + + + hdnum + 205478 + ra + 325.369366 + dec + -77.390046 + mag + 3.740000 + + + hdnum + 206778 + ra + 326.046484 + dec + 9.875012 + mag + 2.390000 + + + hdnum + 207098 + ra + 326.760184 + dec + -16.127286 + mag + 2.850000 + + + hdnum + 207971 + ra + 328.482184 + dec + -37.364854 + mag + 3.010000 + + + hdnum + 209750 + ra + 331.445994 + dec + -0.319851 + mag + 2.940000 + + + hdnum + 210027 + ra + 331.752779 + dec + 25.345113 + mag + 3.770000 + + + hdnum + 209952 + ra + 332.058253 + dec + -46.960976 + mag + 1.770000 + + + hdnum + 210418 + ra + 332.549917 + dec + 6.197865 + mag + 3.530000 + + + hdnum + 210745 + ra + 332.713650 + dec + 58.201258 + mag + 3.340000 + + + hdnum + 211416 + ra + 334.625393 + dec + -60.259583 + mag + 2.860000 + + + hdnum + 212061 + ra + 335.414061 + dec + -1.387331 + mag + 3.850000 + + + hdnum + 213051 + ra + 337.207887 + dec + -0.020522 + mag + 3.659000 + + + hdnum + 213009 + ra + 337.317389 + dec + -43.495563 + mag + 3.960000 + + + hdnum + 213558 + ra + 337.822905 + dec + 50.282490 + mag + 3.780000 + + + hdnum + 214923 + ra + 340.365511 + dec + 10.831364 + mag + 3.420000 + + + hdnum + 214952 + ra + 340.666859 + dec + -46.884580 + mag + 2.120000 + + + hdnum + 215182 + ra + 340.750570 + dec + 30.221244 + mag + 2.940000 + + + hdnum + 215665 + ra + 341.632839 + dec + 23.565655 + mag + 3.960000 + + + hdnum + 215789 + ra + 342.138737 + dec + -51.316864 + mag + 3.490000 + + + hdnum + 216228 + ra + 342.420087 + dec + 66.200406 + mag + 3.500000 + + + hdnum + 216131 + ra + 342.500792 + dec + 24.601580 + mag + 3.510000 + + + hdnum + 216386 + ra + 343.153649 + dec + -7.579599 + mag + 3.750000 + + + hdnum + 216627 + ra + 343.662580 + dec + -15.820820 + mag + 3.270000 + + + hdnum + 216956 + ra + 344.412699 + dec + -29.622237 + mag + 1.230000 + + + hdnum + 217675 + ra + 345.480257 + dec + 42.325972 + mag + 3.640000 + + + hdnum + 217906 + ra + 345.943563 + dec + 28.082789 + mag + 2.470000 + + + hdnum + 218045 + ra + 346.190214 + dec + 15.205265 + mag + 2.490000 + + + hdnum + 218594 + ra + 347.361674 + dec + -21.172408 + mag + 3.680000 + + + hdnum + 218670 + ra + 347.589748 + dec + -45.246711 + mag + 3.880000 + + + hdnum + 219615 + ra + 349.291421 + dec + 3.282289 + mag + 3.700000 + + + hdnum + 219571 + ra + 349.357400 + dec + -58.235730 + mag + 4.000000 + + + hdnum + 220321 + ra + 350.742617 + dec + -20.100581 + mag + 3.960000 + + + hdnum + 222107 + ra + 354.391031 + dec + 46.458154 + mag + 3.870000 + + + hdnum + 222404 + ra + 354.836879 + dec + 77.632278 + mag + 3.220000 + + + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/InfoPlist.strings b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..6fe7ae9 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..d4182f1 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/main.m b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/main.m new file mode 100644 index 0000000..dbd2b23 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/main.m @@ -0,0 +1,30 @@ +// +// main.m +// BouncySquare +// +// Created by mike on 9/10/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "OpenGLSolarSystemAppDelegate.h" + +int main(int argc, char *argv[]) +{ + NSException *exception2; + + @try + { + @autoreleasepool + { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([OpenGLSolarSystemAppDelegate class])); + } + } + @catch(NSException *exception) + { + exception2=exception; + + NSLog(@"Crash! %@",exception2.reason); + } +} diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/mathlib.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/mathlib.h new file mode 100644 index 0000000..b0d1c65 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/mathlib.h @@ -0,0 +1,1812 @@ +// mathlib.h +// +// Copyright (C) 2001, Chris Laurel +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +#ifndef _MATHLIB_H_ +#define _MATHLIB_H_ + +#include +#include + +#define PI_ 3.14159265358979323846 +//#define TWO_PI 6.28318530717958647692 + +template class Math +{ +public: + static inline void sincos(T, T&, T&); + static inline T frand(); + static inline T sfrand(); + static inline T lerp(T t, T a, T b); + static inline T clamp(T t); + +private: + // This class is static and should not be instantiated + Math() {}; +}; + + +typedef Math Mathf; +typedef Math Mathd; + + +template T degToRad(T d) +{ + return d / 180 * static_cast(PI_); +} + +template T radToDeg(T r) +{ + return r * 180 / static_cast(PI_); +} + +template T abs(T x) +{ + return (x < 0) ? -x : x; +} + +template T square(T x) +{ + return x * x; +} + +template T cube(T x) +{ + return x * x * x; +} + +template T clamp(T x) +{ + if (x < 0) + return 0; + else if (x > 1) + return 1; + else + return x; +} + +template int sign(T x) +{ + if (x < 0) + return -1; + else if (x > 0) + return 1; + else + return 0; +} + +// This function is like fmod except that it always returns +// a positive value in the range [ 0, y ) +template T pfmod(T x, T y) +{ + int quotient = (int) abs(x / y); + if (x < 0.0) + return x + (quotient + 1) * y; + else + return x - quotient * y; +} + +template T circleArea(T r) +{ + return (T) PI_ * r * r; +} + +template T sphereArea(T r) +{ + return 4 * (T) PI_ * r * r; +} + +template void Math::sincos(T angle, T& s, T& c) +{ + s = (T) sin(angle); + c = (T) cos(angle); +} + + +// return a random float in [0, 1] +template T Math::frand() +{ + return (T) (rand() & 0x7fff) / (T) 32767; +} + + +// return a random float in [-1, 1] +template T Math::sfrand() +{ + return (T) (rand() & 0x7fff) / (T) 32767 * 2 - 1; +} + + +template T Math::lerp(T t, T a, T b) +{ + return a + t * (b - a); +} + + +// return t clamped to [0, 1] +template T Math::clamp(T t) +{ + if (t < 0) + return 0; + else if (t > 1) + return 1; + else + return t; +} + +//vector stuff + + + + +#include + + +//template class Point3; + +template class Vector3 +{ +public: + inline Vector3(); + inline Vector3(const Vector3&); + inline Vector3(T, T, T); + + inline T& operator[](int) const; + inline Vector3& operator+=(const Vector3&); + inline Vector3& operator-=(const Vector3&); + inline Vector3& operator*=(T); + + inline Vector3 operator-(); + inline Vector3 operator+(); + + inline T length() const; + inline T lengthSquared() const; + inline void normalize(); + + T x, y, z; +}; + +template class Point3 +{ +public: + inline Point3(); + inline Point3(const Point3&); + inline Point3(T, T, T); + + inline T& operator[](int) const; + inline Point3& operator+=(const Vector3&); + inline Point3& operator-=(const Vector3&); + inline Point3& operator-=(const Point3&); + inline Point3& operator+=(const Point3&); + inline Point3& operator*=(T); + // inline Point3& operator=(const Point3&); + + inline T distanceTo(const Point3&) const; + inline T distanceToSquared(const Point3&) const; + inline T distanceFromOrigin() const; + inline T distanceFromOriginSquared() const; + + T x, y, z; +}; + + +template class Point2; + +template class Vector2 +{ +public: + inline Vector2(); + inline Vector2(T, T); + + T x, y; +}; + +template class Point2 +{ +public: + inline Point2(); + inline Point2(T, T); + + T x, y; +}; + + +template class Vector4 +{ +public: + inline Vector4(); + inline Vector4(T, T, T, T); + + inline T& operator[](int) const; + inline Vector4& operator+=(const Vector4&); + inline Vector4& operator-=(const Vector4&); + inline Vector4& operator*=(T); + + inline Vector4 operator-(); + inline Vector4 operator+(); + + T x, y, z, w; +}; + + +template class Matrix4 +{ +public: + Matrix4(); + Matrix4(const Vector4&, const Vector4&, + const Vector4&, const Vector4&); + Matrix4(const Matrix4& m); + + inline const Vector4& operator[](int) const; + inline Vector4 row(int) const; + inline Vector4 column(int) const; + + static Matrix4 identity(); + static Matrix4 translation(const Point3&); + static Matrix4 translation(const Vector3&); + static Matrix4 rotation(const Vector3&, T); + static Matrix4 xrotation(T); + static Matrix4 yrotation(T); + static Matrix4 zrotation(T); + static Matrix4 scaling(const Vector3&); + static Matrix4 scaling(T); + + void translate(const Point3&); + + Matrix4 transpose() const; + Matrix4 inverse() const; + + Vector4 r[4]; +}; + + +template class Matrix3 +{ +public: + Matrix3(); + Matrix3(const Vector3&, const Vector3&, const Vector3&); + template Matrix3(const Matrix3&); + + static Matrix3 xrotation(T); + static Matrix3 yrotation(T); + static Matrix3 zrotation(T); + + inline const Vector3& operator[](int) const; + inline Vector3 row(int) const; + inline Vector3 column(int) const; + + inline Matrix3& operator*=(T); + + static Matrix3 identity(); + + Matrix3 transpose() const; + Matrix3 inverse() const; + T determinant() const; + + // template operator Matrix3() const; + + Vector3 r[3]; +}; + + +typedef Vector3 Vec3f; +typedef Vector3 Vec3d; +typedef Point3 Point3f; +typedef Point3 Point3d; +typedef Vector2 Vec2f; +typedef Point2 Point2f; +typedef Vector4 Vec4f; +typedef Vector4 Vec4d; +typedef Matrix4 Mat4f; +typedef Matrix4 Mat4d; +typedef Matrix3 Mat3f; +typedef Matrix3 Mat3d; + + +//**** Vector3 constructors + +template Vector3::Vector3() : x(0), y(0), z(0) +{ +} + +template Vector3::Vector3(const Vector3& v) : +x(v.x), y(v.y), z(v.z) +{ +} + +template Vector3::Vector3(T _x, T _y, T _z) : x(_x), y(_y), z(_z) +{ +} + + +//**** Vector3 operators + +template T& Vector3::operator[](int n) const +{ + // Not portable--I'll write a new version when I try to compile on a + // platform where it bombs. + return ((T*) this)[n]; +} + +template Vector3& Vector3::operator+=(const Vector3& a) +{ + x += a.x; y += a.y; z += a.z; + return *this; +} + +template Vector3& Vector3::operator-=(const Vector3& a) +{ + x -= a.x; y -= a.y; z -= a.z; + return *this; +} + +template Vector3& Vector3::operator*=(T s) +{ + x *= s; y *= s; z *= s; + return *this; +} + +template Vector3 Vector3::operator-() +{ + return Vector3(-x, -y, -z); +} + +template Vector3 Vector3::operator+() +{ + return *this; +} + + +template Vector3 operator+(const Vector3& a, const Vector3& b) +{ + return Vector3(a.x + b.x, a.y + b.y, a.z + b.z); +} + +template Vector3 operator-(const Vector3& a, const Vector3& b) +{ + return Vector3(a.x - b.x, a.y - b.y, a.z - b.z); +} + +template Vector3 operator*(T s, const Vector3& v) +{ + return Vector3(s * v.x, s * v.y, s * v.z); +} + +template Vector3 operator*(const Vector3& v, T s) +{ + return Vector3(s * v.x, s * v.y, s * v.z); +} + +// dot product +template T operator*(const Vector3& a, const Vector3& b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z; +} + +// cross product +template Vector3 operator^(const Vector3& a, const Vector3& b) +{ + return Vector3(a.y * b.z - a.z * b.y, + a.z * b.x - a.x * b.z, + a.x * b.y - a.y * b.x); +} + +template bool operator==(const Vector3& a, const Vector3& b) +{ + return a.x == b.x && a.y == b.y && a.z == b.z; +} + +template bool operator!=(const Vector3& a, const Vector3& b) +{ + return a.x != b.x || a.y != b.y || a.z != b.z; +} + +template Vector3 operator/(const Vector3& v, T s) +{ + T is = 1 / s; + return Vector3(is * v.x, is * v.y, is * v.z); +} + +template T dot(const Vector3& a, const Vector3& b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z; +} + +template Vector3 cross(const Vector3& a, const Vector3& b) +{ + return Vector3(a.y * b.z - a.z * b.y, + a.z * b.x - a.x * b.z, + a.x * b.y - a.y * b.x); +} + +template T Vector3::length() const +{ + return (T) sqrt(x * x + y * y + z * z); +} + +template T Vector3::lengthSquared() const +{ + return x * x + y * y + z * z; +} + +template void Vector3::normalize() +{ + T s = 1 / (T) sqrt(x * x + y * y + z * z); + x *= s; + y *= s; + z *= s; +} + + +//**** Point3 constructors + +template Point3::Point3() : x(0), y(0), z(0) +{ +} + +template Point3::Point3(const Point3& p) : +x(p.x), y(p.y), z(p.z) +{ +} + +template Point3::Point3(T _x, T _y, T _z) : x(_x), y(_y), z(_z) +{ +} + + +//**** Point3 operators + +template T& Point3::operator[](int n) const +{ + // Not portable--I'll write a new version when I try to compile on a + // platform where it bombs. + return ((T*) this)[n]; +} + +template Vector3 operator-(const Point3& a, const Point3& b) +{ + return Vector3(a.x - b.x, a.y - b.y, a.z - b.z); +} + +template Point3& Point3::operator+=(const Vector3& v) +{ + x += v.x; y += v.y; z += v.z; + return *this; +} + +template Point3& Point3::operator+=(const Point3& v) +{ + x += v.x; y += v.y; z += v.z; + return *this; +} + +template Point3& Point3::operator-=(const Vector3& v) +{ + x -= v.x; y -= v.y; z -= v.z; + return *this; +} + +template Point3& Point3::operator-=(const Point3& v) +{ + x -= v.x; y -= v.y; z -= v.z; + return *this; +} + +template Point3& Point3::operator*=(T s) +{ + x *= s; y *= s; z *= s; + return *this; +} + +template bool operator==(const Point3& a, const Point3& b) +{ + return a.x == b.x && a.y == b.y && a.z == b.z; +} + +template bool operator!=(const Point3& a, const Point3& b) +{ + return a.x != b.x || a.y != b.y || a.z != b.z; +} + +template Point3 operator+(const Point3& p, const Vector3& v) +{ + return Point3(p.x + v.x, p.y + v.y, p.z + v.z); +} + +template Point3 operator-(const Point3& p, const Vector3& v) +{ + return Point3(p.x - v.x, p.y - v.y, p.z - v.z); +} +/* + template Point3& Point3::operator=(const Point3& p) + { + + x=p.x; + y=p.y; + z=p.z; + + return *this; + } + */ +// Naughty naughty . . . remove these since they aren't proper +// point methods--changing the implicit homogenous coordinate isn't +// allowed. +template Point3 operator*(const Point3& p, T s) +{ + return Point3(p.x * s, p.y * s, p.z * s); +} + +template Point3 operator*(T s, const Point3& p) +{ + return Point3(p.x * s, p.y * s, p.z * s); +} + + +//**** Point3 methods + +template T Point3::distanceTo(const Point3& p) const +{ + return (T) sqrt((p.x - x) * (p.x - x) + + (p.y - y) * (p.y - y) + + (p.z - z) * (p.z - z)); +} + +template T Point3::distanceToSquared(const Point3& p) const +{ + return ((p.x - x) * (p.x - x) + + (p.y - y) * (p.y - y) + + (p.z - z) * (p.z - z)); +} + +template T Point3::distanceFromOrigin() const +{ + return (T) sqrt(x * x + y * y + z * z); +} + +template T Point3::distanceFromOriginSquared() const +{ + return x * x + y * y + z * z; +} + + + +//**** Vector2 constructors +template Vector2::Vector2() : x(0), y(0) +{ +} + +template Vector2::Vector2(T _x, T _y) : x(_x), y(_y) +{ +} + + +//**** Vector2 operators +template bool operator==(const Vector2& a, const Vector2& b) +{ + return a.x == b.x && a.y == b.y; +} + +template bool operator!=(const Vector2& a, const Vector2& b) +{ + return a.x != b.x || a.y != b.y; +} + + +//**** Point2 constructors + +template Point2::Point2() : x(0), y(0) +{ +} + +template Point2::Point2(T _x, T _y) : x(_x), y(_y) +{ +} + + +//**** Point2 operators + +template bool operator==(const Point2& a, const Point2& b) +{ + return a.x == b.x && a.y == b.y; +} + +template bool operator!=(const Point2& a, const Point2& b) +{ + return a.x != b.x || a.y != b.y; +} + + +//**** Vector4 constructors + +template Vector4::Vector4() : x(0), y(0), z(0), w(0) +{ +} + +template Vector4::Vector4(T _x, T _y, T _z, T _w) : +x(_x), y(_y), z(_z), w(_w) +{ +} + + +//**** Vector4 operators + +template T& Vector4::operator[](int n) const +{ + // Not portable--I'll write a new version when I try to compile on a + // platform where it bombs. + return ((T*) this)[n]; +} + +template bool operator==(const Vector4& a, const Vector4& b) +{ + return a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w; +} + +template bool operator!=(const Vector4& a, const Vector4& b) +{ + return a.x != b.x || a.y != b.y || a.z != b.z || a.w != b.w; +} + +template Vector4& Vector4::operator+=(const Vector4& a) +{ + x += a.x; y += a.y; z += a.z; w += a.w; + return *this; +} + +template Vector4& Vector4::operator-=(const Vector4& a) +{ + x -= a.x; y -= a.y; z -= a.z; w -= a.w; + return *this; +} + +template Vector4& Vector4::operator*=(T s) +{ + x *= s; y *= s; z *= s; w *= s; + return *this; +} + +template Vector4 Vector4::operator-() +{ + return Vector4(-x, -y, -z, -w); +} + +template Vector4 Vector4::operator+() +{ + return *this; +} + +template Vector4 operator+(const Vector4& a, const Vector4& b) +{ + return Vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); +} + +template Vector4 operator-(const Vector4& a, const Vector4& b) +{ + return Vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); +} + +template Vector4 operator*(T s, const Vector4& v) +{ + return Vector4(s * v.x, s * v.y, s * v.z, s * v.w); +} + +template Vector4 operator*(const Vector4& v, T s) +{ + return Vector4(s * v.x, s * v.y, s * v.z, s * v.w); +} + +// dot product +template T operator*(const Vector4& a, const Vector4& b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; +} + +template T dot(const Vector4& a, const Vector4& b) +{ + return a * b; +} + + + +//**** Matrix3 constructors + +template Matrix3::Matrix3() +{ + r[0] = Vector3(0, 0, 0); + r[1] = Vector3(0, 0, 0); + r[2] = Vector3(0, 0, 0); +} + + +template Matrix3::Matrix3(const Vector3& r0, + const Vector3& r1, + const Vector3& r2) +{ + r[0] = r0; + r[1] = r1; + r[2] = r2; +} + + +#if 0 +template Matrix3::Matrix3(const Matrix3& m) +{ +#if 0 + r[0] = m.r[0]; + r[1] = m.r[1]; + r[2] = m.r[2]; +#endif + r[0].x = m.r[0].x; r[0].y = m.r[0].y; r[0].z = m.r[0].z; + r[1].x = m.r[1].x; r[1].y = m.r[1].y; r[1].z = m.r[1].z; + r[2].x = m.r[2].x; r[2].y = m.r[2].y; r[2].z = m.r[2].z; +} +#endif + + +//**** Matrix3 operators + +template const Vector3& Matrix3::operator[](int n) const +{ + // return const_cast&>(r[n]); + return r[n]; +} + +template Vector3 Matrix3::row(int n) const +{ + return r[n]; +} + +template Vector3 Matrix3::column(int n) const +{ + return Vector3(r[0][n], r[1][n], r[2][n]); +} + +template Matrix3& Matrix3::operator*=(T s) +{ + r[0] *= s; + r[1] *= s; + r[2] *= s; + return *this; +} + + +// pre-multiply column vector by a 3x3 matrix +template Vector3 operator*(const Matrix3& m, const Vector3& v) +{ + return Vector3(m.r[0].x * v.x + m.r[0].y * v.y + m.r[0].z * v.z, + m.r[1].x * v.x + m.r[1].y * v.y + m.r[1].z * v.z, + m.r[2].x * v.x + m.r[2].y * v.y + m.r[2].z * v.z); +} + + +// post-multiply row vector by a 3x3 matrix +template Vector3 operator*(const Vector3& v, const Matrix3& m) +{ + return Vector3(m.r[0].x * v.x + m.r[1].x * v.y + m.r[2].x * v.z, + m.r[0].y * v.x + m.r[1].y * v.y + m.r[2].y * v.z, + m.r[0].z * v.x + m.r[1].z * v.y + m.r[2].z * v.z); +} + + +// pre-multiply column point by a 3x3 matrix +template Point3 operator*(const Matrix3& m, const Point3& p) +{ + return Point3(m.r[0].x * p.x + m.r[0].y * p.y + m.r[0].z * p.z, + m.r[1].x * p.x + m.r[1].y * p.y + m.r[1].z * p.z, + m.r[2].x * p.x + m.r[2].y * p.y + m.r[2].z * p.z); +} + + +// post-multiply row point by a 3x3 matrix +template Point3 operator*(const Point3& p, const Matrix3& m) +{ + return Point3(m.r[0].x * p.x + m.r[1].x * p.y + m.r[2].x * p.z, + m.r[0].y * p.x + m.r[1].y * p.y + m.r[2].y * p.z, + m.r[0].z * p.x + m.r[1].z * p.y + m.r[2].z * p.z); +} + + +template Matrix3 operator*(const Matrix3& a, + const Matrix3& b) +{ +#define MATMUL(R, C) (a[R].x * b[0].C + a[R].y * b[1].C + a[R].z * b[2].C) + return Matrix3(Vector3(MATMUL(0, x), MATMUL(0, y), MATMUL(0, z)), + Vector3(MATMUL(1, x), MATMUL(1, y), MATMUL(1, z)), + Vector3(MATMUL(2, x), MATMUL(2, y), MATMUL(2, z))); +#undef MATMUL +} + + +template Matrix3 operator+(const Matrix3& a, + const Matrix3& b) +{ + return Matrix3(a.r[0] + b.r[0], + a.r[1] + b.r[1], + a.r[2] + b.r[2]); +} + + +template Matrix3 Matrix3::identity() +{ + return Matrix3(Vector3(1, 0, 0), + Vector3(0, 1, 0), + Vector3(0, 0, 1)); +} + + +template Matrix3 Matrix3::transpose() const +{ + return Matrix3(Vector3(r[0].x, r[1].x, r[2].x), + Vector3(r[0].y, r[1].y, r[2].y), + Vector3(r[0].z, r[1].z, r[2].z)); +} + + +template T det2x2(T a, T b, T c, T d) +{ + return a * d - b * c; +} + +template T Matrix3::determinant() const +{ + return (r[0].x * r[1].y * r[2].z + + r[0].y * r[1].z * r[2].x + + r[0].z * r[1].x * r[2].y - + r[0].z * r[1].y * r[2].x - + r[0].x * r[1].z * r[2].y - + r[0].y * r[1].x * r[2].z); +} + + +template Matrix3 Matrix3::inverse() const +{ + Matrix3 adjoint; + + // Just use Cramer's rule for now . . . + adjoint.r[0].x = det2x2(r[1].y, r[1].z, r[2].y, r[2].z); + adjoint.r[0].y = -det2x2(r[1].x, r[1].z, r[2].x, r[2].z); + adjoint.r[0].z = det2x2(r[1].x, r[1].y, r[2].x, r[2].y); + adjoint.r[1].x = -det2x2(r[0].y, r[0].z, r[2].y, r[2].z); + adjoint.r[1].y = det2x2(r[0].x, r[0].z, r[2].x, r[2].z); + adjoint.r[1].z = -det2x2(r[0].x, r[0].y, r[2].x, r[2].y); + adjoint.r[2].x = det2x2(r[0].y, r[0].z, r[1].y, r[1].z); + adjoint.r[2].y = -det2x2(r[0].x, r[0].z, r[1].x, r[1].z); + adjoint.r[2].z = det2x2(r[0].x, r[0].y, r[1].x, r[1].y); + adjoint *= 1 / determinant(); + + return adjoint; +} + + +template Matrix3 Matrix3::xrotation(T angle) +{ + T c = (T) cos(angle); + T s = (T) sin(angle); + + return Matrix3(Vector3(1, 0, 0), + Vector3(0, c, -s), + Vector3(0, s, c)); +} + + +template Matrix3 Matrix3::yrotation(T angle) +{ + T c = (T) cos(angle); + T s = (T) sin(angle); + + return Matrix3(Vector3(c, 0, s), + Vector3(0, 1, 0), + Vector3(-s, 0, c)); +} + + +template Matrix3 Matrix3::zrotation(T angle) +{ + T c = (T) cos(angle); + T s = (T) sin(angle); + + return Matrix3(Vector3(c, -s, 0), + Vector3(s, c, 0), + Vector3(0, 0, 1)); +} + + +/*********************************************** + ** + ** Matrix4 methods + ** + ***********************************************/ + +template Matrix4::Matrix4() +{ + r[0] = Vector4(0, 0, 0, 0); + r[1] = Vector4(0, 0, 0, 0); + r[2] = Vector4(0, 0, 0, 0); + r[3] = Vector4(0, 0, 0, 0); +} + + +template Matrix4::Matrix4(const Vector4& v0, + const Vector4& v1, + const Vector4& v2, + const Vector4& v3) +{ + r[0] = v0; + r[1] = v1; + r[2] = v2; + r[3] = v3; +} + + +template Matrix4::Matrix4(const Matrix4& m) +{ + r[0] = m.r[0]; + r[1] = m.r[1]; + r[2] = m.r[2]; + r[3] = m.r[3]; +} + + +template const Vector4& Matrix4::operator[](int n) const +{ + return r[n]; + // return const_cast&>(r[n]); +} + +template Vector4 Matrix4::row(int n) const +{ + return r[n]; +} + +template Vector4 Matrix4::column(int n) const +{ + return Vector4(r[0][n], r[1][n], r[2][n], r[3][n]); +} + + +template Matrix4 Matrix4::identity() +{ + return Matrix4(Vector4(1, 0, 0, 0), + Vector4(0, 1, 0, 0), + Vector4(0, 0, 1, 0), + Vector4(0, 0, 0, 1)); +} + + +template Matrix4 Matrix4::translation(const Point3& p) +{ + return Matrix4(Vector4(1, 0, 0, 0), + Vector4(0, 1, 0, 0), + Vector4(0, 0, 1, 0), + Vector4(p.x, p.y, p.z, 1)); +} + + +template Matrix4 Matrix4::translation(const Vector3& v) +{ + return Matrix4(Vector4(1, 0, 0, 0), + Vector4(0, 1, 0, 0), + Vector4(0, 0, 1, 0), + Vector4(v.x, v.y, v.z, 1)); +} + + +template void Matrix4::translate(const Point3& p) +{ + r[3].x += p.x; + r[3].y += p.y; + r[3].z += p.z; +} + + +template Matrix4 Matrix4::rotation(const Vector3& axis, + T angle) +{ + T c = (T) cos(angle); + T s = (T) sin(angle); + T t = 1 - c; + + return Matrix4(Vector4(t * axis.x * axis.x + c, + t * axis.x * axis.y - s * axis.z, + t * axis.x * axis.z + s * axis.y, + 0), + Vector4(t * axis.x * axis.y + s * axis.z, + t * axis.y * axis.y + c, + t * axis.y * axis.z - s * axis.x, + 0), + Vector4(t * axis.x * axis.z - s * axis.y, + t * axis.y * axis.z + s * axis.x, + t * axis.z * axis.z + c, + 0), + Vector4(0, 0, 0, 1)); +} + + +template Matrix4 Matrix4::xrotation(T angle) +{ + T c = (T) cos(angle); + T s = (T) sin(angle); + + return Matrix4(Vector4(1, 0, 0, 0), + Vector4(0, c, -s, 0), + Vector4(0, s, c, 0), + Vector4(0, 0, 0, 1)); +} + + +template Matrix4 Matrix4::yrotation(T angle) +{ + T c = (T) cos(angle); + T s = (T) sin(angle); + + return Matrix4(Vector4(c, 0, s, 0), + Vector4(0, 1, 0, 0), + Vector4(-s, 0, c, 0), + Vector4(0, 0, 0, 1)); +} + + +template Matrix4 Matrix4::zrotation(T angle) +{ + T c = (T) cos(angle); + T s = (T) sin(angle); + + return Matrix4(Vector4(c, -s, 0, 0), + Vector4(s, c, 0, 0), + Vector4(0, 0, 1, 0), + Vector4(0, 0, 0, 1)); +} + + +template Matrix4 Matrix4::scaling(const Vector3& scale) +{ + return Matrix4(Vector4(scale.x, 0, 0, 0), + Vector4(0, scale.y, 0, 0), + Vector4(0, 0, scale.z, 0), + Vector4(0, 0, 0, 1)); +} + + +template Matrix4 Matrix4::scaling(T scale) +{ + return scaling(Vector3(scale, scale, scale)); +} + + +// multiply column vector by a 4x4 matrix +template Vector3 operator*(const Matrix4& m, const Vector3& v) +{ + return Vector3(m.r[0].x * v.x + m.r[0].y * v.y + m.r[0].z * v.z, + m.r[1].x * v.x + m.r[1].y * v.y + m.r[1].z * v.z, + m.r[2].x * v.x + m.r[2].y * v.y + m.r[2].z * v.z); +} + +// multiply row vector by a 4x4 matrix +template Vector3 operator*(const Vector3& v, const Matrix4& m) +{ + return Vector3(m.r[0].x * v.x + m.r[1].x * v.y + m.r[2].x * v.z, + m.r[0].y * v.x + m.r[1].y * v.y + m.r[2].y * v.z, + m.r[0].z * v.x + m.r[1].z * v.y + m.r[2].z * v.z); +} + +// multiply column point by a 4x4 matrix; no projection is performed +template Point3 operator*(const Matrix4& m, const Point3& p) +{ + return Point3(m.r[0].x * p.x + m.r[0].y * p.y + m.r[0].z * p.z + m.r[0].w, + m.r[1].x * p.x + m.r[1].y * p.y + m.r[1].z * p.z + m.r[1].w, + m.r[2].x * p.x + m.r[2].y * p.y + m.r[2].z * p.z + m.r[2].w); +} + +// multiply row point by a 4x4 matrix; no projection is performed +template Point3 operator*(const Point3& p, const Matrix4& m) +{ + return Point3(m.r[0].x * p.x + m.r[1].x * p.y + m.r[2].x * p.z + m.r[3].x, + m.r[0].y * p.x + m.r[1].y * p.y + m.r[2].y * p.z + m.r[3].y, + m.r[0].z * p.x + m.r[1].z * p.y + m.r[2].z * p.z + m.r[3].z); +} + +// multiply column vector by a 4x4 matrix +template Vector4 operator*(const Matrix4& m, const Vector4& v) +{ + return Vector4(m.r[0].x * v.x + m.r[0].y * v.y + m.r[0].z * v.z + m.r[0].w * v.w, + m.r[1].x * v.x + m.r[1].y * v.y + m.r[1].z * v.z + m.r[1].w * v.w, + m.r[2].x * v.x + m.r[2].y * v.y + m.r[2].z * v.z + m.r[2].w * v.w, + m.r[3].x * v.x + m.r[3].y * v.y + m.r[3].z * v.z + m.r[3].w * v.w); +} + +// multiply row vector by a 4x4 matrix +template Vector4 operator*(const Vector4& v, const Matrix4& m) +{ + return Vector4(m.r[0].x * v.x + m.r[1].x * v.y + m.r[2].x * v.z + m.r[3].x * v.w, + m.r[0].y * v.x + m.r[1].y * v.y + m.r[2].y * v.z + m.r[3].y * v.w, + m.r[0].z * v.x + m.r[1].z * v.y + m.r[2].z * v.z + m.r[3].z * v.w, + m.r[0].w * v.x + m.r[1].w * v.y + m.r[2].w * v.z + m.r[3].w * v.w); +} + + + +template Matrix4 Matrix4::transpose() const +{ + return Matrix4(Vector4(r[0].x, r[1].x, r[2].x, r[3].x), + Vector4(r[0].y, r[1].y, r[2].y, r[3].y), + Vector4(r[0].z, r[1].z, r[2].z, r[3].z), + Vector4(r[0].w, r[1].w, r[2].w, r[3].w)); +} + + +template Matrix4 operator*(const Matrix4& a, + const Matrix4& b) +{ +#define MATMUL(R, C) (a[R].x * b[0].C + a[R].y * b[1].C + a[R].z * b[2].C + a[R].w * b[3].C) + return Matrix4(Vector4(MATMUL(0, x), MATMUL(0, y), MATMUL(0, z), MATMUL(0, w)), + Vector4(MATMUL(1, x), MATMUL(1, y), MATMUL(1, z), MATMUL(1, w)), + Vector4(MATMUL(2, x), MATMUL(2, y), MATMUL(2, z), MATMUL(2, w)), + Vector4(MATMUL(3, x), MATMUL(3, y), MATMUL(3, z), MATMUL(3, w))); +#undef MATMUL +} + + +template Matrix4 operator+(const Matrix4& a, const Matrix4& b) +{ + return Matrix4(a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3]); +} + + +// Compute inverse using Gauss-Jordan elimination; caller is responsible +// for ensuring that the matrix isn't singular. +template Matrix4 Matrix4::inverse() const +{ + Matrix4 a(*this); + Matrix4 b(Matrix4::identity()); + int i, j; + int p; + + for (j = 0; j < 4; j++) + { + p = j; + for (i = j + 1; i < 4; i++) + { + if (fabs(a.r[i][j]) > fabs(a.r[p][j])) + p = i; + } + + // Swap rows p and j + Vector4 t = a.r[p]; + a.r[p] = a.r[j]; + a.r[j] = t; + + t = b.r[p]; + b.r[p] = b.r[j]; + b.r[j] = t; + + T s = a.r[j][j]; // if s == 0, the matrix is singular + a.r[j] *= (1.0f / s); + b.r[j] *= (1.0f / s); + + // Eliminate off-diagonal elements + for (i = 0; i < 4; i++) + { + if (i != j) + { + b.r[i] -= a.r[i][j] * b.r[j]; + a.r[i] -= a.r[i][j] * a.r[j]; + } + } + } + + return b; +} + +#ifndef PI +#define PI 3.141592654 +#endif + +template class Quaternion +{ +public: + inline Quaternion(); + inline Quaternion(const Quaternion&); + inline Quaternion(T); + inline Quaternion(const Vector3&); + inline Quaternion(T, const Vector3&); + inline Quaternion(T, T, T, T); + + Quaternion(const Matrix3&); + + inline Quaternion& operator+=(Quaternion); + inline Quaternion& operator-=(Quaternion); + inline Quaternion& operator*=(T); + Quaternion& operator*=(Quaternion); + + inline Quaternion operator~(); // conjugate + inline Quaternion operator-(); + inline Quaternion operator+(); + + void setAxisAngle(Vector3 axis, T angle); + + void getAxisAngle(Vector3& axis, T& angle) const; + Matrix4 toMatrix4() const; + Matrix3 toMatrix3() const; + + static Quaternion slerp(Quaternion, Quaternion, T); + + void rotate(Vector3 axis, T angle); + void xrotate(T angle); + void yrotate(T angle); + void zrotate(T angle); + + bool isPure() const; + bool isReal() const; + T normalize(); + +#if 0 + // This code is disabled until I can +#ifndef BROKEN_FRIEND_TEMPLATES + // This just rocks . . . MSVC 6.0 doesn't parse this correctly, + // so template friend functions need to be declared in the standard + // conforming way for GNU C and a non-conforming way for MSVC. + friend Quaternion operator+ <>(Quaternion, Quaternion); + friend Quaternion operator- <>(Quaternion, Quaternion); + friend Quaternion operator* <>(Quaternion, Quaternion); + friend Quaternion operator* <>(T, Quaternion); + friend Quaternion operator* <>(Vector3, Quaternion); + + friend bool operator== <>(Quaternion, Quaternion); + friend bool operator!= <>(Quaternion, Quaternion); + + friend T real<>(Quaternion); + friend Vector3 imag<>(Quaternion); +#else + friend Quaternion operator+(Quaternion, Quaternion); + friend Quaternion operator-(Quaternion, Quaternion); + friend Quaternion operator*(Quaternion, Quaternion); + friend Quaternion operator*(T, Quaternion); + friend Quaternion operator*(Vector3, Quaternion); + + friend bool operator==(Quaternion, Quaternion); + friend bool operator!=(Quaternion, Quaternion); + + friend T real(Quaternion); + friend Vector3 imag(Quaternion); +#endif // BROKEN_FRIEND_TEMPLATES + +#endif + + // Until friend templates are working . . . + // private: + T w, x, y, z; +}; + + +typedef Quaternion Quatf; +typedef Quaternion Quatd; + + +template Quaternion::Quaternion() : w(0), x(0), y(0), z(0) +{ +} + +template Quaternion::Quaternion(const Quaternion& q) : +w(q.w), x(q.x), y(q.y), z(q.z) +{ +} + +template Quaternion::Quaternion(T re) : +w(re), x(0), y(0), z(0) +{ +} + +// Create a 'pure' quaternion +template Quaternion::Quaternion(const Vector3& im) : +w(0), x(im.x), y(im.y), z(im.z) +{ +} + +template Quaternion::Quaternion(T re, const Vector3& im) : +w(re), x(im.x), y(im.y), z(im.z) +{ +} + +template Quaternion::Quaternion(T _w, T _x, T _y, T _z) : +w(_w), x(_x), y(_y), z(_z) +{ +} + +// Create a quaternion from a rotation matrix +template Quaternion::Quaternion(const Matrix3& m) +{ + T trace = m[0][0] + m[1][1] + m[2][2]; + T root; + + if (trace > 0) + { + root = (T) sqrt(trace + 1); + w = (T) 0.5 * root; + root = (T) 0.5 / root; + x = (m[2][1] - m[1][2]) * root; + y = (m[0][2] - m[2][0]) * root; + z = (m[1][0] - m[0][1]) * root; + } + else + { + int i = 0; + if (m[1][1] > m[i][i]) + i = 1; + if (m[2][2] > m[i][i]) + i = 2; + int j = (i == 2) ? 0 : i + 1; + int k = (j == 2) ? 0 : j + 1; + + root = (T) sqrt(m[i][i] - m[j][j] - m[k][k] + 1.0); + T* xyz[3] = { &x, &y, &z }; + *xyz[i] = (T) 0.5 * root; + + if(root!=0.0) + root = (T) 0.5 / root; + + w = (m[k][j] - m[j][k]) * root; //bug? rms 12/26/02 + + // w = (m[j][k] - m[k][j]) * root; + *xyz[j] = (m[j][i] + m[i][j]) * root; + *xyz[k] = (m[k][i] + m[i][k]) * root; + } +} + + +template Quaternion& Quaternion::operator+=(Quaternion a) +{ + x += a.x; y += a.y; z += a.z; w += a.w; + return *this; +} + +template Quaternion& Quaternion::operator-=(Quaternion a) +{ + x -= a.x; y -= a.y; z -= a.z; w -= a.w; + return *this; +} + +template Quaternion& Quaternion::operator*=(Quaternion q) +{ + *this = Quaternion(w * q.w - x * q.x - y * q.y - z * q.z, + w * q.x + x * q.w + y * q.z - z * q.y, + w * q.y + y * q.w + z * q.x - x * q.z, + w * q.z + z * q.w + x * q.y - y * q.x); + + return *this; +} + +template Quaternion& Quaternion::operator*=(T s) +{ + x *= s; y *= s; z *= s; w *= s; + return *this; +} + +// conjugate operator +template Quaternion Quaternion::operator~() +{ + return Quaternion(w, -x, -y, -z); +} + +template Quaternion Quaternion::operator-() +{ + return Quaternion(-w, -x, -y, -z); +} + +template Quaternion Quaternion::operator+() +{ + return *this; +} + + +template Quaternion operator+(Quaternion a, Quaternion b) +{ + return Quaternion(a.w + b.w, a.x + b.x, a.y + b.y, a.z + b.z); +} + +template Quaternion operator-(Quaternion a, Quaternion b) +{ + return Quaternion(a.w - b.w, a.x - b.x, a.y - b.y, a.z - b.z); +} + +template Quaternion operator*(Quaternion a, Quaternion b) +{ + return Quaternion(a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z, + a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y, + a.w * b.y + a.y * b.w + a.z * b.x - a.x * b.z, + a.w * b.z + a.z * b.w + a.x * b.y - a.y * b.x); +} + +template Quaternion operator*(T s, Quaternion q) +{ + return Quaternion(s * q.w, s * q.x, s * q.y, s * q.z); +} + +template Quaternion operator*(Quaternion q, T s) +{ + return Quaternion(s * q.w, s * q.x, s * q.y, s * q.z); +} + +// equivalent to multiplying by the quaternion (0, v) +template Quaternion operator*(Vector3 v, Quaternion q) +{ + return Quaternion(-v.x * q.x - v.y * q.y - v.z * q.z, + v.x * q.w + v.y * q.z - v.z * q.y, + v.y * q.w + v.z * q.x - v.x * q.z, + v.z * q.w + v.x * q.y - v.y * q.x); +} + +template Quaternion operator/(Quaternion q, T s) +{ + return q * (1 / s); +} + +template Quaternion operator/(Quaternion a, Quaternion b) +{ + return a * (~b / abs(b)); +} + + +template bool operator==(Quaternion a, Quaternion b) +{ + return a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w; +} + +template bool operator!=(Quaternion a, Quaternion b) +{ + return a.x != b.x || a.y != b.y || a.z != b.z || a.w != b.w; +} + + +// elementary functions +template Quaternion conjugate(Quaternion q) +{ + return Quaternion(q.w, -q.x, -q.y, -q.z); +} + +template T norm(Quaternion q) +{ + return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; +} + +template T abs(Quaternion q) +{ + return (T) sqrt(norm(q)); +} + +template Quaternion exp(Quaternion q) +{ + if (q.isReal()) + { + return Quaternion((T) exp(q.w)); + } + else + { + T l = (T) sqrt(q.x * q.x + q.y * q.y + q.z * q.z); + T s = (T) sin(l); + T c = (T) cos(l); + T e = (T) exp(q.w); + T t = e * s / l; + return Quaternion(e * c, t * q.x, t * q.y, t * q.z); + } +} + +template Quaternion log(Quaternion q) +{ + if (q.isReal()) + { + if (q.w > 0) + { + return Quaternion((T) log(q.w)); + } + else if (q.w < 0) + { + // The log of a negative purely real quaternion has + // infinitely many values, all of the form (ln(-w), PI * I), + // where I is any unit vector. We arbitrarily choose an I + // of (1, 0, 0) here and whereever else a similar choice is + // necessary. Geometrically, the set of roots is a sphere + // of radius PI centered at ln(-w) on the real axis. + return Quaternion((T) log(-q.w), (T) PI, 0, 0); + } + else + { + // error . . . ln(0) not defined + return Quaternion(0); + } + } + else + { + T l = (T) sqrt(q.x * q.x + q.y * q.y + q.z * q.z); + T r = (T) sqrt(l * l + q.w * q.w); + T theta = (T) atan2(l, q.w); + T t = theta / l; + return Quaternion((T) log(r), t * q.x, t * q.y, t * q.z); + } +} + + +template Quaternion pow(Quaternion q, T s) +{ + return exp(s * log(q)); +} + + +template Quaternion pow(Quaternion q, Quaternion p) +{ + return exp(p * log(q)); +} + + +template Quaternion sin(Quaternion q) +{ + if (q.isReal()) + { + return Quaternion((T) sin(q.w)); + } + else + { + T l = (T) sqrt(q.x * q.x + q.y * q.y + q.z * q.z); + T m = q.w; + T s = (T) sin(m); + T c = (T) cos(m); + T il = 1 / l; + T e0 = (T) exp(-l); + T e1 = (T) exp(l); + + T c0 = (T) -0.5 * e0 * il * c; + T c1 = (T) 0.5 * e1 * il * c; + + return Quaternion((T) 0.5 * e0 * s, c0 * q.x, c0 * q.y, c0 * q.z) + + Quaternion((T) 0.5 * e1 * s, c1 * q.x, c1 * q.y, c1 * q.z); + } +} + +template Quaternion cos(Quaternion q) +{ + if (q.isReal()) + { + return Quaternion((T) cos(q.w)); + } + else + { + T l = (T) sqrt(q.x * q.x + q.y * q.y + q.z * q.z); + T m = q.w; + T s = (T) sin(m); + T c = (T) cos(m); + T il = 1 / l; + T e0 = (T) exp(-l); + T e1 = (T) exp(l); + + T c0 = (T) 0.5 * e0 * il * s; + T c1 = (T) -0.5 * e1 * il * s; + + return Quaternion((T) 0.5 * e0 * c, c0 * q.x, c0 * q.y, c0 * q.z) + + Quaternion((T) 0.5 * e1 * c, c1 * q.x, c1 * q.y, c1 * q.z); + } +} + +template Quaternion sqrt(Quaternion q) +{ + // In general, the square root of a quaternion has two values, one + // of which is the negative of the other. However, any negative purely + // real quaternion has an infinite number of square roots. + // This function returns the positive root for positive reals and + // the root on the positive i axis for negative reals. + if (q.isReal()) + { + if (q.w >= 0) + return Quaternion((T) sqrt(q.w), 0, 0, 0); + else + return Quaternion(0, (T) sqrt(-q.w), 0, 0); + } + else + { + T b = (T) sqrt(q.x * q.x + q.y * q.y + q.z * q.z); + T r = (T) sqrt(q.w * q.w + b * b); + if (q.w >= 0) + { + T m = (T) sqrt((T) 0.5 * (r + q.w)); + T l = b / (2 * m); + T t = l / b; + return Quaternion(m, q.x * t, q.y * t, q.z * t); + } + else + { + T l = (T) sqrt((T) 0.5 * (r - q.w)); + T m = b / (2 * l); + T t = l / b; + return Quaternion(m, q.x * t, q.y * t, q.z * t); + } + } +} + +template T real(Quaternion q) +{ + return q.w; +} + +template Vector3 imag(Quaternion q) +{ + return Vector3(q.x, q.y, q.z); +} + + +// Quaternion methods + +template bool Quaternion::isReal() const +{ + return (x == 0 && y == 0 && z == 0); +} + +template bool Quaternion::isPure() const +{ + return w == 0; +} + +template T Quaternion::normalize() +{ + T s = (T) sqrt(w * w + x * x + y * y + z * z); + T invs = (T) 1 / (T) s; + x *= invs; + y *= invs; + z *= invs; + w *= invs; + + return s; +} + +// Set to the unit quaternion representing an axis angle rotation. Assume +// that axis is a unit vector +template void Quaternion::setAxisAngle(Vector3 axis, T angle) +{ + T s, c; + + Math::sincos(angle * (T) 0.5, s, c); + x = s * axis.x; + y = s * axis.y; + z = s * axis.z; + w = c; +} + + +// Assuming that this a unit quaternion, return the in axis/angle form the +// orientation which it represents. +template void Quaternion::getAxisAngle(Vector3& axis, + T& angle) const +{ + // The quaternion has the form: + // w = cos(angle/2), (x y z) = sin(angle/2)*axis + + T magSquared = x * x + y * y + z * z; + if (magSquared > (T) 1e-10) + { + T s = (T) 1 / (T) sqrt(magSquared); + axis.x = x * s; + axis.y = y * s; + axis.z = z * s; + if (w <= -1 || w >= 1) + angle = 0; + else + angle = (T) acos(w) * 2; + } + else + { + // The angle is zero, so we pick an arbitrary unit axis + axis.x = 1; + axis.y = 0; + axis.z = 0; + angle = 0; + } +} + + +// Convert this (assumed to be normalized) quaternion to a rotation matrix +template Matrix4 Quaternion::toMatrix4() const +{ + T wx = w * x * 2; + T wy = w * y * 2; + T wz = w * z * 2; + T xx = x * x * 2; + T xy = x * y * 2; + T xz = x * z * 2; + T yy = y * y * 2; + T yz = y * z * 2; + T zz = z * z * 2; + + return Matrix4(Vector4(1 - yy - zz, xy - wz, xz + wy, 0), + Vector4(xy + wz, 1 - xx - zz, yz - wx, 0), + Vector4(xz - wy, yz + wx, 1 - xx - yy, 0), + Vector4(0, 0, 0, 1)); +} + + +// Convert this (assumed to be normalized) quaternion to a rotation matrix +template Matrix3 Quaternion::toMatrix3() const +{ + T wx = w * x * 2; + T wy = w * y * 2; + T wz = w * z * 2; + T xx = x * x * 2; + T xy = x * y * 2; + T xz = x * z * 2; + T yy = y * y * 2; + T yz = y * z * 2; + T zz = z * z * 2; + + return Matrix3(Vector3(1 - yy - zz, xy - wz, xz + wy), + Vector3(xy + wz, 1 - xx - zz, yz - wx), + Vector3(xz - wy, yz + wx, 1 - xx - yy)); +} + + +template T dot(Quaternion a, Quaternion b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; +} + + +template Quaternion Quaternion::slerp(Quaternion q0, + Quaternion q1, + T t) +{ + T c = dot(q0, q1); + T angle = (T) acos(c); + + if (abs(angle) < (T) 1.0e-5) + return q0; + + T s = (T) sin(angle); + T is = (T) 1.0 / s; + + return q0 * ((T) sin((1 - t) * angle) * is) + + q1 * ((T) sin(t * angle) * is); +} + + +// Assuming that this is a unit quaternion representing an orientation, +// apply a rotation of angle radians about the specfied axis +template void Quaternion::rotate(Vector3 axis, T angle) +{ + Quaternion q; + q.setAxisAngle(axis, angle); + *this = q * *this; +} + + +// Assuming that this is a unit quaternion representing an orientation, +// apply a rotation of angle radians about the x-axis +template void Quaternion::xrotate(T angle) +{ + T s, c; + + Math::sincos(angle * (T) 0.5, s, c); + *this = Quaternion(c, s, 0, 0) * *this; +} + +// Assuming that this is a unit quaternion representing an orientation, +// apply a rotation of angle radians about the y-axis +template void Quaternion::yrotate(T angle) +{ + T s, c; + + Math::sincos(angle * (T) 0.5, s, c); + *this = Quaternion(c, 0, s, 0) * *this; +} + +// Assuming that this is a unit quaternion representing an orientation, +// apply a rotation of angle radians about the z-axis +template void Quaternion::zrotate(T angle) +{ + T s, c; + + Math::sincos(angle * (T) 0.5, s, c); + *this = Quaternion(c, 0, 0, s) * *this; +} + + +#endif // _MATHLIB_H_ diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/miniglu.h b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/miniglu.h new file mode 100644 index 0000000..0eddb99 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/miniglu.h @@ -0,0 +1,25 @@ +// +// miniglu.h +// OpenGLSolarSystem +// +// Created by mike on 9/17/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +void gluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, + GLfloat centerx, GLfloat centery, GLfloat centerz, + GLfloat upx, GLfloat upy, GLfloat upz); + + +GLKQuaternion gluGetOrientation(); + +void gluMultMatrixVector3f(const GLfloat matrix[16], const GLfloat in[4],GLfloat out[4]); +void gluGetScreenLocation(GLfloat xa,GLfloat ya,GLfloat za,GLfloat *sx, GLfloat *sy,GLfloat *sz); +GLint gluProject(GLfloat objx, GLfloat objy, GLfloat objz, + const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], + const GLint viewport[4], + GLfloat *winx, GLfloat *winy, GLfloat *winz); \ No newline at end of file diff --git a/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/miniglu.mm b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/miniglu.mm new file mode 100644 index 0000000..83c9464 --- /dev/null +++ b/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/miniglu.mm @@ -0,0 +1,142 @@ +// +// miniglu.m +// OpenGLSolarSystem +// +// Created by mike on 9/17/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "miniglu.h" + +static GLKQuaternion m_Quaternion; + +void gluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, + GLfloat centerx, GLfloat centery, GLfloat centerz, + GLfloat upx, GLfloat upy, GLfloat upz) +{ + GLKVector3 up; //1 + GLKVector3 from,to; + GLKVector3 lookat; + GLKVector3 axis; + float angle; + + lookat.x=centerx; //2 + lookat.y=centery; + lookat.z=centerz; + + from.x=eyex; + from.y=eyey; + from.z=eyez; + + to.x=lookat.x; + to.y=lookat.y; + to.z=lookat.z; + + up.x=upx; + up.y=upy; + up.z=upz; + + GLKVector3 temp = GLKVector3Subtract(to,from); //3 + GLKVector3 n=GLKVector3Normalize(temp); + + temp = GLKVector3CrossProduct(n,up); //3 + GLKVector3 v=GLKVector3Normalize(temp); + + GLKVector3 u = GLKVector3CrossProduct(v,n); //3 + + m_Quaternion=GLKQuaternionMakeWithMatrix3(GLKMatrix3MakeWithRows(v,u,GLKVector3Negate(n))); + + axis=GLKQuaternionAxis(m_Quaternion); + angle=GLKQuaternionAngle(m_Quaternion); + glRotatef(angle*57.29, axis.x, axis.y, axis.z); +} + +GLint gluProject(GLfloat objx, GLfloat objy, GLfloat objz, + const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], + const GLint viewport[4], + GLfloat *winx, GLfloat *winy, GLfloat *winz) +{ + float in[4]; + float out[4]; + + in[0]=objx; //1 + in[1]=objy; + in[2]=objz; + in[3]=1.0; + + gluMultMatrixVector3f(modelMatrix, in, out); //2 + + gluMultMatrixVector3f(projMatrix, out, in); + + if (in[3] == 0.0) + in[3]=1; + + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + + /* Map x, y and z to range 0-1 */ + + in[0] = in[0] * 0.5 + 0.5; //3 + in[1] = in[1] * 0.5 + 0.5; + in[2] = in[2] * 0.5 + 0.5; + + /* Map x,y to viewport */ + in[0] = in[0] * viewport[2] + viewport[0]; + in[1] = in[1] * viewport[3] + viewport[1]; + + *winx=in[0]; + *winy=in[1]; + *winz=in[3]; + + return(GL_TRUE); +} + +void gluGetScreenLocation(GLfloat xa,GLfloat ya,GLfloat za,GLfloat *sx, GLfloat *sy,GLfloat *sz) +{ + GLfloat mvmatrix[16]; + GLfloat projmatrix[16]; + GLfloat x,y,z; + GLint viewport[4]; + + glGetIntegerv(GL_VIEWPORT,viewport); //4 + glGetFloatv(GL_MODELVIEW_MATRIX,mvmatrix); + glGetFloatv(GL_PROJECTION_MATRIX,projmatrix); + + gluProject(xa,ya,za,mvmatrix,projmatrix,viewport,&x,&y,&z); + + y=viewport[3]-y; //5 + + *sx=x; + *sy=y; + + if(sz!=NULL) + *sz=z; + + float scale=[[UIScreen mainScreen] scale]; //6 + + *sx/=scale; + *sy/=scale; +} + +void gluMultMatrixVector3f(const GLfloat matrix[16], const GLfloat in[4],GLfloat out[4]) +{ + int i; + + for (i=0; i<4; i++) + { + out[i] = + in[0] * matrix[0*4+i] + + in[1] * matrix[1*4+i] + + in[2] * matrix[2*4+i] + + in[3] * matrix[3*4+i]; + } +} + +GLKQuaternion gluGetOrientation() +{ + return m_Quaternion; +} + + diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..070b158 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Freeware License, some rights reserved + +Copyright (c) 2011 Mike Smithwick + +Permission is hereby granted, free of charge, to anyone obtaining a copy +of this software and associated documentation files (the "Software"), +to work with the Software within the limits of freeware distribution and fair use. +This includes the rights to use, copy, and modify the Software for personal use. +Users are also allowed and encouraged to submit corrections and modifications +to the Software for the benefit of other users. + +It is not allowed to reuse, modify, or redistribute the Software for +commercial use in any way, or for a user’s educational materials such as books +or blog articles without prior permission from the copyright holder. + +The above copyright notice and this permission notice need to be included +in all copies or substantial portions of the software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..1495581 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +#Apress Source Code + +This repository accompanies [*Pro OpenGL ES for iOS*](http://www.apress.com/9781430238409) by Mike Smithwick (Apress, 2011). + +![Cover image](9781430238409.jpg) + +Download the files as a zip using the green button, or clone the repository to your machine using Git. + +##Releases + +Release v1.0 corresponds to the code in the published book, without corrections or updates. + +##Contributions + +See the file Contributing.md for more information on how you can contribute to this repository. diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/._.DS_Store new file mode 100644 index 0000000..321346b Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Bouncy Texture/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/BouncyTexture-without texture/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/OpenGLSolarSystem-with texture/OpenGLSolarSystem/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._Textured Square-Prefix.pch b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._Textured Square-Prefix.pch new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._Textured Square-Prefix.pch differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareAppDelegate.h b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareAppDelegate.h new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareAppDelegate.h differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareAppDelegate.m b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareAppDelegate.m new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareAppDelegate.m differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareViewController.h b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareViewController.h new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareViewController.h differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareViewController.m b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareViewController.m new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._TexturedSquareViewController.m differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._main.m b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._main.m new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/._main.m differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/Shaders/._Shader.fsh b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/Shaders/._Shader.fsh new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/Shaders/._Shader.fsh differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/Shaders/._Shader.vsh b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/Shaders/._Shader.vsh new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/Shaders/._Shader.vsh differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/assets/._.DS_Store b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/assets/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/assets/._.DS_Store differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._InfoPlist.strings b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..14f037e Binary files /dev/null and b/__MACOSX/978-1-4302-3840-9_Ch05/Chapter 5/Textured Square-mipmaps/Textured Square/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 1/._.DS_Store b/__MACOSX/Chapter 1/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 1/._.DS_Store differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/._.DS_Store b/__MACOSX/Chapter 1/OpeglBook First Project/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/._.DS_Store differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._.DS_Store b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._.DS_Store differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._OpeglBook First Project-Prefix.pch b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._OpeglBook First Project-Prefix.pch new file mode 100644 index 0000000..7001752 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._OpeglBook First Project-Prefix.pch differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesAppDelegate.h b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesAppDelegate.h new file mode 100644 index 0000000..676c70c Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesAppDelegate.h differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesAppDelegate.m b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesAppDelegate.m new file mode 100644 index 0000000..26dbe39 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesAppDelegate.m differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesViewController.h b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesViewController.h new file mode 100644 index 0000000..d783eb6 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesViewController.h differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesViewController.m b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesViewController.m new file mode 100644 index 0000000..5858e6b Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._TwoCubesViewController.m differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._main.m b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._main.m new file mode 100644 index 0000000..09a6352 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/._main.m differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/._Shader.fsh b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/._Shader.fsh new file mode 100644 index 0000000..c70ee53 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/._Shader.fsh differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/._Shader.vsh b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/._Shader.vsh new file mode 100644 index 0000000..b795084 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/Shaders/._Shader.vsh differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..fcf125e Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..6c209cb Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..58744c4 Binary files /dev/null and b/__MACOSX/Chapter 1/OpeglBook First Project/OpeglBook First Project/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 10/._.DS_Store b/__MACOSX/Chapter 10/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 10/._.DS_Store differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/._.DS_Store b/__MACOSX/Chapter 10/EarthAtNight/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/._.DS_Store differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._.DS_Store b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._.DS_Store differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNight-Prefix.pch b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNight-Prefix.pch new file mode 100644 index 0000000..1fcc92d Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNight-Prefix.pch differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightAppDelegate.h b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightAppDelegate.h new file mode 100644 index 0000000..5d120f5 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightAppDelegate.h differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightAppDelegate.m b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightAppDelegate.m new file mode 100644 index 0000000..f9350d8 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightAppDelegate.m differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightViewController.h b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightViewController.h new file mode 100644 index 0000000..a3cded6 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightViewController.h differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightViewController.m b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightViewController.m new file mode 100644 index 0000000..1ee4c9f Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._EarthAtNightViewController.m differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._OpenglIOS.h b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._OpenglIOS.h new file mode 100644 index 0000000..f781465 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._OpenglIOS.h differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._atmosphere.h b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._atmosphere.h new file mode 100644 index 0000000..8320a96 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._atmosphere.h differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._atmosphere.m b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._atmosphere.m new file mode 100644 index 0000000..2450b78 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._atmosphere.m differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._main.m b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._main.m new file mode 100644 index 0000000..650f5fc Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._main.m differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._planet.h b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._planet.h new file mode 100644 index 0000000..b69aa79 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._planet.h differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._planet.mm b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._planet.mm new file mode 100644 index 0000000..7df2484 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/._planet.mm differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._.DS_Store b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._.DS_Store differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._atmo.fsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._atmo.fsh new file mode 100644 index 0000000..66503bf Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._atmo.fsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._atmo.vsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._atmo.vsh new file mode 100644 index 0000000..aa51e38 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._atmo.vsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dark_fade1.vsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dark_fade1.vsh new file mode 100644 index 0000000..c8ac497 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dark_fade1.vsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside copy.fsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside copy.fsh new file mode 100644 index 0000000..b27c8e8 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside copy.fsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside copy.vsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside copy.vsh new file mode 100644 index 0000000..5f621fc Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside copy.vsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside.fsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside.fsh new file mode 100644 index 0000000..9ffc3cc Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside.fsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside.vsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside.vsh new file mode 100644 index 0000000..6011a9e Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._dayside.vsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._nightside.fsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._nightside.fsh new file mode 100644 index 0000000..c0a6e31 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._nightside.fsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._nightside.vsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._nightside.vsh new file mode 100644 index 0000000..7d775cf Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._nightside.vsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._specular.fsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._specular.fsh new file mode 100644 index 0000000..94f44b1 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._specular.fsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._specular.vsh b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._specular.vsh new file mode 100644 index 0000000..00a631c Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/Shaders/._specular.vsh differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._.DS_Store b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._.DS_Store differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._earth_atmo.plist b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._earth_atmo.plist new file mode 100644 index 0000000..4ca1964 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._earth_atmo.plist differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._earth_atmo_2.plist b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._earth_atmo_2.plist new file mode 100644 index 0000000..4ca1964 Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/assets/._earth_atmo_2.plist differ diff --git a/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..8713dfd Binary files /dev/null and b/__MACOSX/Chapter 10/EarthAtNight/AtmoShader/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/._.DS_Store b/__MACOSX/Chapter 10/GLKReflectionMap/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/._.DS_Store differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._.DS_Store b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._.DS_Store differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMap-Prefix.pch b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMap-Prefix.pch new file mode 100644 index 0000000..054af0d Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMap-Prefix.pch differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapAppDelegate.h b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapAppDelegate.h new file mode 100644 index 0000000..b725aa3 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapAppDelegate.h differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapAppDelegate.m b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapAppDelegate.m new file mode 100644 index 0000000..22f5973 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapAppDelegate.m differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapViewController.h b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapViewController.h new file mode 100644 index 0000000..d62988e Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapViewController.h differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapViewController.m b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapViewController.m new file mode 100644 index 0000000..f59e519 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._GLKReflectionMapViewController.m differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._OpenglIOS.h b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._OpenglIOS.h new file mode 100644 index 0000000..a2774fb Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._OpenglIOS.h differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._main.m b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._main.m new file mode 100644 index 0000000..e1478f0 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._main.m differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._planet.h b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._planet.h new file mode 100644 index 0000000..aaaa1ab Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._planet.h differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._planet.mm b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._planet.mm new file mode 100644 index 0000000..2f61bdd Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/._planet.mm differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/._Shader.fsh b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/._Shader.fsh new file mode 100644 index 0000000..6beb6ab Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/._Shader.fsh differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/._Shader.vsh b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/._Shader.vsh new file mode 100644 index 0000000..9766e95 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/Shaders/._Shader.vsh differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/._rgb_splats.256.png b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/._rgb_splats.256.png new file mode 100644 index 0000000..23d7c15 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/assets/._rgb_splats.256.png differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..d2e15aa Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..9bc9c13 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..055a095 Binary files /dev/null and b/__MACOSX/Chapter 10/GLKReflectionMap/GLKReflectionMap/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 3/._.DS_Store b/__MACOSX/Chapter 3/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 3/._.DS_Store differ diff --git a/__MACOSX/Chapter 3/BouncyCube/._.DS_Store b/__MACOSX/Chapter 3/BouncyCube/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/._.DS_Store differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._.DS_Store b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._.DS_Store differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCube-Prefix.pch b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCube-Prefix.pch new file mode 100644 index 0000000..6be0d65 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCube-Prefix.pch differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeAppDelegate.h b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeAppDelegate.h new file mode 100644 index 0000000..66d8fb2 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeAppDelegate.h differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeAppDelegate.m b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeAppDelegate.m new file mode 100644 index 0000000..37a4ab6 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeAppDelegate.m differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeViewController.h b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeViewController.h new file mode 100644 index 0000000..e7ba332 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeViewController.h differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeViewController.m b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeViewController.m new file mode 100644 index 0000000..c91257a Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._BouncyCubeViewController.m differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._main.m b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._main.m new file mode 100644 index 0000000..70cbc74 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/._main.m differ diff --git a/__MACOSX/Chapter 3/BouncyCube/BouncyCube/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..b20a754 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncyCube/BouncyCube/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 3/BouncySquare/._.DS_Store b/__MACOSX/Chapter 3/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquare-Prefix.pch b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquare-Prefix.pch new file mode 100644 index 0000000..7d1ea26 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquare-Prefix.pch differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareAppDelegate.h b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareAppDelegate.h new file mode 100644 index 0000000..15fee9e Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareAppDelegate.h differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareAppDelegate.m b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareAppDelegate.m new file mode 100644 index 0000000..d292aab Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareAppDelegate.m differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareViewController.h b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareViewController.h new file mode 100644 index 0000000..ef6f120 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareViewController.h differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareViewController.m b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareViewController.m new file mode 100644 index 0000000..e16cae9 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._BouncySquareViewController.m differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._main.m b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._main.m new file mode 100644 index 0000000..d74e797 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..3d37d44 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..f6f4ad4 Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..642836f Binary files /dev/null and b/__MACOSX/Chapter 3/BouncySquare/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/._.DS_Store b/__MACOSX/Chapter 3/OpenGLSolarSystem/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/._.DS_Store differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._.DS_Store b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._.DS_Store differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..eb7a7a4 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..86bf23e Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..1003cfb Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..697a1df Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..0dccc82 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._Planet.h b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._Planet.h new file mode 100644 index 0000000..9e6f66d Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._Planet.h differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._Planet.m b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._Planet.m new file mode 100644 index 0000000..b45766c Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._Planet.m differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystem.h b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystem.h new file mode 100644 index 0000000..491f0f5 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystem.h differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystemController.h b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystemController.h new file mode 100644 index 0000000..4246a35 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystemController.h differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystemController.m b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystemController.m new file mode 100644 index 0000000..cc9644e Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._SolarSystemController.m differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._main.m b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._main.m new file mode 100644 index 0000000..f122223 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/._main.m differ diff --git a/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..0da9ae8 Binary files /dev/null and b/__MACOSX/Chapter 3/OpenGLSolarSystem/OpenGLSolarSystem/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 4/._.DS_Store b/__MACOSX/Chapter 4/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 4/._.DS_Store differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/._.DS_Store b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/._.DS_Store differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..52cdb17 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystem.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystem.h new file mode 100644 index 0000000..c73e848 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystem.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..61b1ac7 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..32a868a Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemController.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemController.h new file mode 100644 index 0000000..5efce5d Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemController.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemController.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemController.m new file mode 100644 index 0000000..e2c7618 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemController.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..58cfc6e Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..dfb0302 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._Planet.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._Planet.h new file mode 100644 index 0000000..f7ab2c1 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._Planet.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._Planet.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._Planet.m new file mode 100644 index 0000000..8a0cd95 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._Planet.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._main.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._main.m new file mode 100644 index 0000000..ac099fb Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/._main.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..5fe19d1 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - final version/OpenGLSolarSystem/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/._.DS_Store b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/._.DS_Store differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..5c0a794 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystem.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystem.h new file mode 100644 index 0000000..2211367 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystem.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..93f67f1 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..3cd4c40 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemController.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemController.h new file mode 100644 index 0000000..f430f20 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemController.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemController.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemController.m new file mode 100644 index 0000000..f90cd2f Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemController.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..4e85586 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..8dfa925 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._Planet.h b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._Planet.h new file mode 100644 index 0000000..8a0d490 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._Planet.h differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._Planet.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._Planet.m new file mode 100644 index 0000000..f7ad2c4 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._Planet.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._main.m b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._main.m new file mode 100644 index 0000000..6078dea Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/._main.m differ diff --git a/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..6d3b212 Binary files /dev/null and b/__MACOSX/Chapter 4/OpenGLSolarSystem - first light/OpenGLSolarSystem/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/._.DS_Store b/__MACOSX/Chapter 6/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/._.DS_Store b/__MACOSX/Chapter 6/Bumpmapping/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._.DS_Store b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquare-Prefix.pch b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquare-Prefix.pch new file mode 100644 index 0000000..9ed2a8a Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquare-Prefix.pch differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareAppDelegate.h b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareAppDelegate.h new file mode 100644 index 0000000..8efd060 Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareAppDelegate.h differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareAppDelegate.m b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareAppDelegate.m new file mode 100644 index 0000000..02f8ee6 Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareAppDelegate.m differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareViewController.h b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareViewController.h new file mode 100644 index 0000000..81dce65 Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareViewController.h differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareViewController.m b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareViewController.m new file mode 100644 index 0000000..bb63786 Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._BouncySquareViewController.m differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._main.m b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._main.m new file mode 100644 index 0000000..59af52a Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/assets/._ggate_bridge.256.png b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/assets/._ggate_bridge.256.png new file mode 100644 index 0000000..37ef995 Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/assets/._ggate_bridge.256.png differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..a6b8f9f Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..41028ba Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..2f9712a Binary files /dev/null and b/__MACOSX/Chapter 6/Bumpmapping/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/._.DS_Store b/__MACOSX/Chapter 6/MultiTextureAnimation/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._.DS_Store b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquare-Prefix.pch b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquare-Prefix.pch new file mode 100644 index 0000000..d4fa8a9 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquare-Prefix.pch differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareAppDelegate.h b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareAppDelegate.h new file mode 100644 index 0000000..663e28b Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareAppDelegate.h differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareAppDelegate.m b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareAppDelegate.m new file mode 100644 index 0000000..fa6c788 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareAppDelegate.m differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareViewController.h b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareViewController.h new file mode 100644 index 0000000..c5316f1 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareViewController.h differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareViewController.m b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareViewController.m new file mode 100644 index 0000000..80e84c8 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._BouncySquareViewController.m differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._main.m b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._main.m new file mode 100644 index 0000000..8909539 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/assets/._ggate_bridge.256.png b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/assets/._ggate_bridge.256.png new file mode 100644 index 0000000..eee6958 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/assets/._ggate_bridge.256.png differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..c704b43 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..d42ee02 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..72204b4 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureAnimation/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/._.DS_Store b/__MACOSX/Chapter 6/MultiTextureCombining/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._.DS_Store b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquare-Prefix.pch b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquare-Prefix.pch new file mode 100644 index 0000000..e1d6fd0 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquare-Prefix.pch differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareAppDelegate.h b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareAppDelegate.h new file mode 100644 index 0000000..0ff4b39 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareAppDelegate.h differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareAppDelegate.m b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareAppDelegate.m new file mode 100644 index 0000000..dc63aa5 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareAppDelegate.m differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareViewController.h b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareViewController.h new file mode 100644 index 0000000..e0fac43 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareViewController.h differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareViewController.m b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareViewController.m new file mode 100644 index 0000000..8e1e5dc Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._BouncySquareViewController.m differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._main.m b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._main.m new file mode 100644 index 0000000..ec5a3ef Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/assets/._ggate_bridge.256.png b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/assets/._ggate_bridge.256.png new file mode 100644 index 0000000..247e86d Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/assets/._ggate_bridge.256.png differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..dd31bbd Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..ef3364f Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..da95093 Binary files /dev/null and b/__MACOSX/Chapter 6/MultiTextureCombining/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/._.DS_Store b/__MACOSX/Chapter 6/MulticolorBlending/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquare-Prefix.pch b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquare-Prefix.pch new file mode 100644 index 0000000..5743460 Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquare-Prefix.pch differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareAppDelegate.h b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareAppDelegate.h new file mode 100644 index 0000000..63a79c6 Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareAppDelegate.h differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareAppDelegate.m b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareAppDelegate.m new file mode 100644 index 0000000..67690aa Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareAppDelegate.m differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareViewController.h b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareViewController.h new file mode 100644 index 0000000..d0dcb44 Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareViewController.h differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareViewController.m b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareViewController.m new file mode 100644 index 0000000..4586db0 Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._BouncySquareViewController.m differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._main.m b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._main.m new file mode 100644 index 0000000..e376e72 Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..7e31f2a Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..92e4efb Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..b5d0000 Binary files /dev/null and b/__MACOSX/Chapter 6/MulticolorBlending/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/._.DS_Store b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._.DS_Store b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..a06c3aa Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystem.h b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystem.h new file mode 100644 index 0000000..e87dd97 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystem.h differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..7eb4817 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..f070a38 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemController.h b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemController.h new file mode 100644 index 0000000..d1d23b9 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemController.h differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemController.m b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemController.m new file mode 100644 index 0000000..14d7b47 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemController.m differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..42d9c39 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m new file mode 100644 index 0000000..6d7e221 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._OpenGLSolarSystemViewController.m differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._Planet.h b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._Planet.h new file mode 100644 index 0000000..610bfbd Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._Planet.h differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._Planet.m b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._Planet.m new file mode 100644 index 0000000..873b4c7 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._Planet.m differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._main.m b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._main.m new file mode 100644 index 0000000..7800147 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/._main.m differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/._.DS_Store b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/._ggate_bridge.256.png b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/._ggate_bridge.256.png new file mode 100644 index 0000000..c63f06d Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/assets/assets/._ggate_bridge.256.png differ diff --git a/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..509d052 Binary files /dev/null and b/__MACOSX/Chapter 6/OpenGLSolarSystem-bumpmapped Earth/OpenGLSolarSystem/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/SolidSquares/._.DS_Store b/__MACOSX/Chapter 6/SolidSquares/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquare-Prefix.pch b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquare-Prefix.pch new file mode 100644 index 0000000..077523a Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquare-Prefix.pch differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareAppDelegate.h b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareAppDelegate.h new file mode 100644 index 0000000..68b41be Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareAppDelegate.h differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareAppDelegate.m b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareAppDelegate.m new file mode 100644 index 0000000..e0b7f40 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareAppDelegate.m differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareViewController.h b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareViewController.h new file mode 100644 index 0000000..90bd0e9 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareViewController.h differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareViewController.m b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareViewController.m new file mode 100644 index 0000000..f31d033 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._BouncySquareViewController.m differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._main.m b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._main.m new file mode 100644 index 0000000..51a0d39 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..ba72ce4 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..24fa434 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..94c90c7 Binary files /dev/null and b/__MACOSX/Chapter 6/SolidSquares/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 6/TextureBlending/._.DS_Store b/__MACOSX/Chapter 6/TextureBlending/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._.DS_Store b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquare-Prefix.pch b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquare-Prefix.pch new file mode 100644 index 0000000..1ea064a Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquare-Prefix.pch differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareAppDelegate.h b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareAppDelegate.h new file mode 100644 index 0000000..0bd7d50 Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareAppDelegate.h differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareAppDelegate.m b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareAppDelegate.m new file mode 100644 index 0000000..e74972f Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareAppDelegate.m differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareViewController.h b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareViewController.h new file mode 100644 index 0000000..de75d8d Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareViewController.h differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareViewController.m b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareViewController.m new file mode 100644 index 0000000..0ee853c Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._BouncySquareViewController.m differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._main.m b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._main.m new file mode 100644 index 0000000..b4fdd0b Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/assets/._ggate_bridge.256.png b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/assets/._ggate_bridge.256.png new file mode 100644 index 0000000..80bbef9 Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/assets/._ggate_bridge.256.png differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..566d032 Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..12b9653 Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._MainStoryboard_iPad.storyboard differ diff --git a/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..1dfe3f8 Binary files /dev/null and b/__MACOSX/Chapter 6/TextureBlending/BouncySquare/en.lproj/._MainStoryboard_iPhone.storyboard differ diff --git a/__MACOSX/Chapter 7/._.DS_Store b/__MACOSX/Chapter 7/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 7/._.DS_Store differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/._.DS_Store b/__MACOSX/Chapter 7/FrameBufferObject/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/._.DS_Store differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._.DS_Store b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._.DS_Store differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureAppDelegate.h b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureAppDelegate.h new file mode 100644 index 0000000..28220f0 Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureAppDelegate.h differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureAppDelegate.m b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureAppDelegate.m new file mode 100644 index 0000000..aaea358 Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureAppDelegate.m differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureViewController.h b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureViewController.h new file mode 100644 index 0000000..f0312ae Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureViewController.h differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureViewController.m b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureViewController.m new file mode 100644 index 0000000..5c132ed Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._BouncyTextureViewController.m differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FBOController.h b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FBOController.h new file mode 100644 index 0000000..f5fc350 Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FBOController.h differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FBOController.m b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FBOController.m new file mode 100644 index 0000000..ca353ef Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FBOController.m differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FrameBufferObject-Prefix.pch b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FrameBufferObject-Prefix.pch new file mode 100644 index 0000000..55d9cac Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._FrameBufferObject-Prefix.pch differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._main.m b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._main.m new file mode 100644 index 0000000..90b164d Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/._main.m differ diff --git a/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..ff5db08 Binary files /dev/null and b/__MACOSX/Chapter 7/FrameBufferObject/BouncySquare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/._.DS_Store b/__MACOSX/Chapter 7/OpenGL Lens Flare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/._.DS_Store differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._.DS_Store b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._.DS_Store differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._EAGLView.h b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._EAGLView.h new file mode 100644 index 0000000..8ea91e6 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._EAGLView.h differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._EAGLView.m b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._EAGLView.m new file mode 100644 index 0000000..15b1347 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._EAGLView.m differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._Flare.h b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._Flare.h new file mode 100644 index 0000000..42f818c Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._Flare.h differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._Flare.m b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._Flare.m new file mode 100644 index 0000000..26f89a0 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._Flare.m differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._LensFlare.h b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._LensFlare.h new file mode 100644 index 0000000..787d4e0 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._LensFlare.h differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._LensFlare.mm b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._LensFlare.mm new file mode 100644 index 0000000..f119c0a Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._LensFlare.mm differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGL Lens Flare-Prefix.pch b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGL Lens Flare-Prefix.pch new file mode 100644 index 0000000..9728afb Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGL Lens Flare-Prefix.pch differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLCreateTexture.h b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLCreateTexture.h new file mode 100644 index 0000000..1a8a781 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLCreateTexture.h differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLCreateTexture.mm b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLCreateTexture.mm new file mode 100644 index 0000000..085b44a Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLCreateTexture.mm differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareAppDelegate.h b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareAppDelegate.h new file mode 100644 index 0000000..c3202fa Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareAppDelegate.h differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareAppDelegate.m b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareAppDelegate.m new file mode 100644 index 0000000..c9f8a90 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareAppDelegate.m differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareViewController.h b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareViewController.h new file mode 100644 index 0000000..2cf9b00 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareViewController.h differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareViewController.m b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareViewController.m new file mode 100644 index 0000000..da0e87b Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenGLLensFlareViewController.m differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenglIOS.h b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenglIOS.h new file mode 100644 index 0000000..ede8424 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._OpenglIOS.h differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._main.m b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._main.m new file mode 100644 index 0000000..1ddd687 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/._main.m differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/Shaders/._Shader.fsh b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/Shaders/._Shader.fsh new file mode 100644 index 0000000..71da1d5 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/Shaders/._Shader.fsh differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/Shaders/._Shader.vsh b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/Shaders/._Shader.vsh new file mode 100644 index 0000000..6262d3e Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/Shaders/._Shader.vsh differ diff --git a/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..4a02ccb Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL Lens Flare/OpenGL Lens Flare/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._EAGLView.h b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._EAGLView.h new file mode 100644 index 0000000..7060229 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._EAGLView.h differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._EAGLView.m b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._EAGLView.m new file mode 100644 index 0000000..3a295b6 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._EAGLView.m differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_Reflection-Prefix.pch b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_Reflection-Prefix.pch new file mode 100644 index 0000000..adc081f Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_Reflection-Prefix.pch differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionAppDelegate.h b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionAppDelegate.h new file mode 100644 index 0000000..312f660 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionAppDelegate.h differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionAppDelegate.m b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionAppDelegate.m new file mode 100644 index 0000000..0327a63 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionAppDelegate.m differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionViewController.h b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionViewController.h new file mode 100644 index 0000000..6ba9549 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionViewController.h differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionViewController.m b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionViewController.m new file mode 100644 index 0000000..9e8c5c1 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._OpenGL_ReflectionViewController.m differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._main.m b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._main.m new file mode 100644 index 0000000..b1c834c Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/._main.m differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/Shaders/._Shader.fsh b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/Shaders/._Shader.fsh new file mode 100644 index 0000000..13598ad Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/Shaders/._Shader.fsh differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/Shaders/._Shader.vsh b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/Shaders/._Shader.vsh new file mode 100644 index 0000000..c95b2e4 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/Shaders/._Shader.vsh differ diff --git a/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..4632197 Binary files /dev/null and b/__MACOSX/Chapter 7/OpenGL_Reflection/OpenGL_Reflection/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/._.DS_Store b/__MACOSX/Chapter 7/ShadowCasting/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/._.DS_Store differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._.DS_Store b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._.DS_Store differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._EAGLView.h b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._EAGLView.h new file mode 100644 index 0000000..8e3dd2e Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._EAGLView.h differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._EAGLView.m b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._EAGLView.m new file mode 100644 index 0000000..874dc41 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._EAGLView.m differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCaster.h b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCaster.h new file mode 100644 index 0000000..39cfedc Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCaster.h differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCaster.mm b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCaster.mm new file mode 100644 index 0000000..c12475b Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCaster.mm differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCasting-Prefix.pch b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCasting-Prefix.pch new file mode 100644 index 0000000..b5f542b Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCasting-Prefix.pch differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingAppDelegate.h b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingAppDelegate.h new file mode 100644 index 0000000..f2638ad Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingAppDelegate.h differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingAppDelegate.mm b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingAppDelegate.mm new file mode 100644 index 0000000..2490c38 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingAppDelegate.mm differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.broken.mm b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.broken.mm new file mode 100644 index 0000000..cccb9f3 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.broken.mm differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.h b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.h new file mode 100644 index 0000000..1aed34d Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.h differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.mm b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.mm new file mode 100644 index 0000000..19b1d14 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._ShadowCastingViewController.mm differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._main.m b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._main.m new file mode 100644 index 0000000..6a2265e Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/._main.m differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/Shaders/._Shader.fsh b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/Shaders/._Shader.fsh new file mode 100644 index 0000000..e140007 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/Shaders/._Shader.fsh differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/Shaders/._Shader.vsh b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/Shaders/._Shader.vsh new file mode 100644 index 0000000..0082f1b Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/Shaders/._Shader.vsh differ diff --git a/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..08667b4 Binary files /dev/null and b/__MACOSX/Chapter 7/ShadowCasting/ShadowCasting/en.lproj/._InfoPlist.strings differ diff --git a/__MACOSX/Chapter 8/._.DS_Store b/__MACOSX/Chapter 8/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 8/._.DS_Store differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/._.DS_Store b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/._.DS_Store differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._.DS_Store b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._.DS_Store differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Flare.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Flare.h new file mode 100644 index 0000000..9424de6 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Flare.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Flare.m b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Flare.m new file mode 100644 index 0000000..3034ba3 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Flare.m differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._LensFlare.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._LensFlare.h new file mode 100644 index 0000000..bb3a614 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._LensFlare.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._LensFlare.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._LensFlare.mm new file mode 100644 index 0000000..3fedd85 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._LensFlare.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLConstellations.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLConstellations.h new file mode 100644 index 0000000..dbae084 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLConstellations.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLConstellations.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLConstellations.mm new file mode 100644 index 0000000..4f7d172 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLConstellations.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLCreateTexture.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLCreateTexture.h new file mode 100644 index 0000000..f2d6953 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLCreateTexture.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLCreateTexture.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLCreateTexture.mm new file mode 100644 index 0000000..75dc29f Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLCreateTexture.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLOutlines.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLOutlines.h new file mode 100644 index 0000000..e437aa4 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLOutlines.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLOutlines.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLOutlines.mm new file mode 100644 index 0000000..f057cd2 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLOutlines.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch new file mode 100644 index 0000000..9176070 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystem-Prefix.pch differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystem.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystem.h new file mode 100644 index 0000000..2842b4d Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystem.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h new file mode 100644 index 0000000..5157d31 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m new file mode 100644 index 0000000..0cce6e4 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemAppDelegate.m differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemController.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemController.h new file mode 100644 index 0000000..b3dc47e Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemController.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemController.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemController.mm new file mode 100644 index 0000000..3dcf315 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemController.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h new file mode 100644 index 0000000..4591044 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemViewController.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemViewController.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemViewController.mm new file mode 100644 index 0000000..31fcb96 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLSolarSystemViewController.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLStars.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLStars.h new file mode 100644 index 0000000..8785fdf Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLStars.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLStars.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLStars.mm new file mode 100644 index 0000000..48910fd Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLStars.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLText.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLText.h new file mode 100644 index 0000000..00b1dd3 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLText.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLText.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLText.mm new file mode 100644 index 0000000..cef3c20 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLText.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLUtils.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLUtils.h new file mode 100644 index 0000000..33262c7 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLUtils.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLUtils.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLUtils.mm new file mode 100644 index 0000000..0b97387 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._OpenGLUtils.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Planet.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Planet.h new file mode 100644 index 0000000..fb73223 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Planet.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Planet.m b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Planet.m new file mode 100644 index 0000000..5676576 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._Planet.m differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._main.m b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._main.m new file mode 100644 index 0000000..f05e618 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._main.m differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._mathlib.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._mathlib.h new file mode 100644 index 0000000..b4abbbe Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._mathlib.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._miniglu.h b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._miniglu.h new file mode 100644 index 0000000..0d1e230 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._miniglu.h differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._miniglu.mm b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._miniglu.mm new file mode 100644 index 0000000..a1e7150 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/._miniglu.mm differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/._.DS_Store b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/._.DS_Store differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._New UIButton Builder Image.eml b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._New UIButton Builder Image.eml new file mode 100644 index 0000000..0ddac7c Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._New UIButton Builder Image.eml differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._bluebutton-100x35.png b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._bluebutton-100x35.png new file mode 100644 index 0000000..dde704c Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._bluebutton-100x35.png differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._bluebutton.png b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._bluebutton.png new file mode 100644 index 0000000..0a79ed2 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._bluebutton.png differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._greenbutton-100x35.png b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._greenbutton-100x35.png new file mode 100644 index 0000000..9d655d8 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._greenbutton-100x35.png differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._redbutton-100x35.png b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._redbutton-100x35.png new file mode 100644 index 0000000..8e408c2 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/assets/images/UI/._redbutton-100x35.png differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._.DS_Store b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._.DS_Store new file mode 100644 index 0000000..460d887 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._.DS_Store differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._outlines.plist b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._outlines.plist new file mode 100644 index 0000000..5f272e6 Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._outlines.plist differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._stars.plist b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._stars.plist new file mode 100644 index 0000000..246efbe Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/data/._stars.plist differ diff --git a/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/._InfoPlist.strings b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/._InfoPlist.strings new file mode 100644 index 0000000..6f0549f Binary files /dev/null and b/__MACOSX/Chapter 8/OpenGLSolarSystem-Complete_Final_Project/OpenGLSolarSystem/en.lproj/._InfoPlist.strings differ diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..f6005ad --- /dev/null +++ b/contributing.md @@ -0,0 +1,14 @@ +# Contributing to Apress Source Code + +Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. + +## How to Contribute + +1. Make sure you have a GitHub account. +2. Fork the repository for the relevant book. +3. Create a new branch on which to make your change, e.g. +`git checkout -b my_code_contribution` +4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. +5. Submit a pull request. + +Thank you for your contribution! \ No newline at end of file