first draft of ad code for iOS. Not adding admob/adwhirl/adSesnse libs to this commit. You will need to download them to get the port to build under XCode

This commit is contained in:
techdragon.nguyen@gmail.com
2011-12-08 20:50:36 +00:00
parent 69a0323c86
commit fe78345ef7
13 changed files with 726 additions and 114 deletions
+22
View File
@@ -11,6 +11,8 @@
- (void) applicationDidFinishLaunching:(UIApplication *)application
{
glViewController = [[EAGLViewController alloc] init];
[self.window addSubview:self.glViewController.view];
[self.window makeKeyAndVisible];
}
@@ -47,6 +49,26 @@
[eaglView stopAnimation];
}
- (void)handleWEngineCommand:(NSString *) command
{
BOOL isDevicePhone = (UI_USER_INTERFACE_IDIOM()) == UIUserInterfaceIdiomPhone;
if ([command isEqualToString: @"entergamestate:menu"] )
[glViewController.eaglView displayAds];
else if ([command isEqualToString: @"enterduelphase:end"] && isDevicePhone)
[glViewController.eaglView displayAds];
else if ([command isEqualToString: @"leaveduelphase:end"] ||
[command isEqualToString: @"leavegamestate:menu"])
{
if (isDevicePhone)
[glViewController.eaglView removeAds];
}
}
- (void)dealloc
{
[window release];