//
//
EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
- pixelFormat:kEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8
- depthFormat:0 // GL_DEPTH_COMPONENT16_OES
- ];
+ pixelFormat:kEAGLColorFormatRGBA8
+ depthFormat:0 // GL_DEPTH_COMPONENT16_OES
+ ];
// attach the openglView to the director
[director setOpenGLView:glView];
-// // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
-// if( ! [director enableRetinaDisplay:YES] )
-// CCLOG(@"Retina Display Not supported");
+ // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
+ //if( ! [director enableRetinaDisplay:YES] )
+ // CCLOG(@"Retina Display Not supported");
//
// VERY IMPORTANT:
// make the OpenGLView a child of the view controller
[viewController setView:glView];
- // make the View Controller a child of the main window
+ // make the View in the View Controller a child of the main window
[window addSubview: viewController.view];
+ // this also lets the system know that we're ready to handle events
[window makeKeyAndVisible];
// Default texture format for PNG/BMP/TIFF/JPEG/GIF images
}
+// Pausing
- (void)applicationWillResignActive:(UIApplication *)application {
[[CCDirector sharedDirector] pause];
}
+// Resuming
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[CCDirector sharedDirector] resume];
}
+// Low on memory
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
[[CCDirector sharedDirector] purgeCachedData];
}
+// Alt-tabbed out? Update but don't render?
-(void) applicationDidEnterBackground:(UIApplication*)application {
[[CCDirector sharedDirector] stopAnimation];
}
+// Alt-tabbed in?
-(void) applicationWillEnterForeground:(UIApplication*)application {
[[CCDirector sharedDirector] startAnimation];
}
+// Killing
- (void)applicationWillTerminate:(UIApplication *)application {
CCDirector *director = [CCDirector sharedDirector];
[director end];
}
+// What's this?
- (void)applicationSignificantTimeChange:(UIApplication *)application {
[[CCDirector sharedDirector] setNextDeltaTimeZero:YES];
}
+// Killed
- (void)dealloc {
[[CCDirector sharedDirector] release];
[window release];