// // eaglAppDelegate.m // eagl // // Created by pin xue on 4/8/08. // Copyright http://www.play3d.net 2008. All rights reserved. // #import "eaglAppDelegate.h" #import "eglView.h" #include "callbacks.h" @implementation eaglAppDelegate @synthesize window; @synthesize contentView; - (void)applicationDidFinishLaunching:(UIApplication *)application { // Create window self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Set up content view // mode: window with status bar //self.contentView = [[[eglView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; // mode: full screen //self.contentView = [[[eglView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; UIView * glview = [[[eglView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; [window addSubview:glview]; // Show window [window makeKeyAndVisible]; rendering(); //Configure and start accelerometer [[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / 10)]; [[UIAccelerometer sharedAccelerometer] setDelegate:self]; } - (void)dealloc { [contentView release]; [window release]; [super dealloc]; } - (void) accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration { accelerating(acceleration.x, acceleration.y, acceleration.z); } @end