//
//  Week3WithText2DAppDelegate.m
//  Week3WithText2D
//
//  Created by Ay on 2008/9/22.
//  Copyright NA 2008. All rights reserved.
//

#import "Week3WithText2DAppDelegate.h"
#import "EAGLView.h"

@implementation Week3WithText2DAppDelegate

@synthesize window;
@synthesize glView;
@synthesize label;

- (void)applicationDidFinishLaunching:(UIApplication *)application {

	glView.animationInterval = 1.0 / 60.0;	
	
	animationInterval = 1.0/60.0;
	animationTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(getScores) userInfo:nil repeats:YES];
	[glView startAnimation];
	
}

-(void)getScores{
	label.text = [NSString stringWithFormat:@"%d",glView.scores];
}


- (void)applicationWillResignActive:(UIApplication *)application {
	glView.animationInterval = 1.0 / 5.0;
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
	glView.animationInterval = 1.0 / 60.0;
}

- (void)dealloc {
	[window release];
	[glView release];
	[super dealloc];
}

@end
