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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user