#import "app_delegate.h"
#import "glview.h"

@implementation AppDelegate

- (BOOL)application: (UIApplication*)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
	window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame]];
	glview = [[GLView alloc] initWithFrame: window.frame];
	
	[window addSubview: glview];
	[window makeKeyAndVisible];
	
	//window.rootViewController = [[UIViewController alloc] init];
	
    [glview startAnimation];
    return YES;
}

- (void)applicationWillResignActive: (UIApplication*)application
{
    [glview stopAnimation];
}

- (void)applicationDidBecomeActive: (UIApplication*)application
{
    [glview startAnimation];
}

- (void)applicationWillTerminate: (UIApplication*)application
{
    [glview stopAnimation];
}

- (void)dealloc
{
	//[window.rootViewController dealloc];
    [window release];
    [glview release];

    [super dealloc];
}

@end
