Add sample code for plugin admob on iOS.

This commit is contained in:
zhangbin 2013-06-18 10:36:23 +08:00
parent 6da209331f
commit b0b24e09c5
11 changed files with 752 additions and 10 deletions

View File

@ -40,6 +40,8 @@ bool AppDelegate::applicationDidFinishLaunching() {
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
pEGLView->setDesignResolutionSize(960.0f, 640.0f, kResolutionNoBorder);
// turn on display FPS
pDirector->setDisplayStats(true);

View File

@ -73,7 +73,13 @@ bool HelloWorld::init()
m_pAdmob = dynamic_cast<ProtocolAds*>(PluginManager::getInstance()->loadPlugin("AdsAdmob"));
TAdsDeveloperInfo devInfo;
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
devInfo["AdmobID"] = "a1517500cc8f794";
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
devInfo["AdmobID"] = "a1516fb6b16b12f";
#endif
m_pAdmob->configDeveloperInfo(devInfo);
m_pListener = new MyAdsListener();
m_pAdmob->setAdsListener(m_pListener);
@ -91,8 +97,7 @@ bool HelloWorld::init()
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback));
CC_CALLBACK_1(HelloWorld::menuCloseCallback, this));
pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2));
@ -102,21 +107,20 @@ bool HelloWorld::init()
pMenu->setPosition(CCPointZero);
CCLabelTTF* label1 = CCLabelTTF::create("ShowAds", "Arial", 24);
CCMenuItemLabel* pItemShow = CCMenuItemLabel::create(label1, this, menu_selector(HelloWorld::testShow));
CCMenuItemLabel* pItemShow = CCMenuItemLabel::create(label1, CC_CALLBACK_1(HelloWorld::testShow, this));
pItemShow->setAnchorPoint(ccp(0.5f, 0));
pMenu->addChild(pItemShow, 0);
pItemShow->setPosition(ccpAdd(posMid, ccp(-100, -120)));
CCLabelTTF* label2 = CCLabelTTF::create("HideAds", "Arial", 24);
CCMenuItemLabel* pItemHide = CCMenuItemLabel::create(label2, this, menu_selector(HelloWorld::testHide));
CCMenuItemLabel* pItemHide = CCMenuItemLabel::create(label2, CC_CALLBACK_1(HelloWorld::testHide, this));
pItemHide->setAnchorPoint(ccp(0.5f, 0));
pMenu->addChild(pItemHide, 0);
pItemHide->setPosition(ccpAdd(posMid, ccp(100, -120)));
// create optional menu
// cases item
m_pCaseItem = CCMenuItemToggle::createWithTarget(this,
menu_selector(HelloWorld::caseChanged),
m_pCaseItem = CCMenuItemToggle::createWithCallback(CC_CALLBACK_1(HelloWorld::caseChanged, this),
CCMenuItemFont::create( s_aTestCases[0].c_str() ),
NULL );
int caseLen = sizeof(s_aTestCases) / sizeof(std::string);
@ -128,8 +132,7 @@ bool HelloWorld::init()
pMenu->addChild(m_pCaseItem);
// type item
m_pTypeItem = CCMenuItemToggle::createWithTarget(this,
menu_selector(HelloWorld::typeChanged),
m_pTypeItem = CCMenuItemToggle::createWithCallback(CC_CALLBACK_1(HelloWorld::typeChanged, this),
CCMenuItemFont::create( s_aTestTypes[0].c_str() ),
NULL );
int typeLen = sizeof(s_aTestTypes) / sizeof(std::string);
@ -141,8 +144,7 @@ bool HelloWorld::init()
pMenu->addChild(m_pTypeItem);
// poses item
m_pPosItem = CCMenuItemToggle::createWithTarget(this,
menu_selector(HelloWorld::posChanged),
m_pPosItem = CCMenuItemToggle::createWithCallback(CC_CALLBACK_1(HelloWorld::posChanged, this),
CCMenuItemFont::create( s_aTestPoses[0].c_str() ),
NULL );
int posLen = sizeof(s_aTestPoses) / sizeof(std::string);

View File

@ -0,0 +1,11 @@
#import <UIKit/UIKit.h>
@class RootViewController;
@interface AppController : NSObject <UIApplicationDelegate> {
UIWindow *window;
RootViewController *viewController;
}
@end

View File

@ -0,0 +1,112 @@
#import "AppController.h"
#import "EAGLView.h"
#import "cocos2d.h"
#import "AppDelegate.h"
#import "RootViewController.h"
@implementation AppController
#pragma mark -
#pragma mark Application lifecycle
// cocos2d application instance
static AppDelegate s_sharedApplication;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
// Init the EAGLView
EAGLView *__glView = [EAGLView viewWithFrame: [window bounds]
pixelFormat: kEAGLColorFormatRGB565
depthFormat: GL_DEPTH24_STENCIL8_OES
preserveBackbuffer: NO
sharegroup: nil
multiSampling: NO
numberOfSamples: 0];
// Use RootViewController manage EAGLView
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
viewController.view = __glView;
// Set RootViewController to window
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
// warning: addSubView doesn't work on iOS6
[window addSubview: viewController.view];
}
else
{
// use this method on ios6
[window setRootViewController:viewController];
}
[window makeKeyAndVisible];
[[UIApplication sharedApplication] setStatusBarHidden:true];
cocos2d::CCApplication::sharedApplication()->run();
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
cocos2d::CCDirector::sharedDirector()->pause();
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
cocos2d::CCDirector::sharedDirector()->resume();
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/
cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground();
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
/*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/
cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground();
}
- (void)applicationWillTerminate:(UIApplication *)application {
/*
Called when the application is about to terminate.
See also applicationDidEnterBackground:.
*/
}
#pragma mark -
#pragma mark Memory management
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
/*
Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
*/
}
- (void)dealloc {
[window release];
[super dealloc];
}
@end

View File

@ -0,0 +1 @@
66c6d1cead373b45218424f6a82f370897e443e4

View File

@ -0,0 +1 @@
84689888a14a2123d2b39f7f2f61be8c15207479

View File

@ -0,0 +1,520 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1AC3624916D4A1E8000847F2 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3624316D4A1E8000847F2 /* AppController.mm */; };
1AC3624B16D4A1E8000847F2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3624516D4A1E8000847F2 /* main.m */; };
1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; };
1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; };
1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; };
1AFAF8BD16D35E4900DB1158 /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; };
1AFCDA8216D4A25900906EA6 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFCDA8116D4A25900906EA6 /* RootViewController.mm */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
7855E0E1153FEF240059DD9A /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 7855E0DF153FEF240059DD9A /* Default.png */; };
BF171245129291EC00B8313A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB012928DE900B8313A /* OpenGLES.framework */; };
BF1712461292920000B8313A /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB212928DE900B8313A /* libxml2.dylib */; };
BF1712471292920000B8313A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB412928DE900B8313A /* libz.dylib */; };
BF1C47F01293687400B63C5D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF1C47EA1293683800B63C5D /* QuartzCore.framework */; };
D41A0AD1160F154A004552AE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D41A0AD0160F154A004552AE /* Default-568h@2x.png */; };
D446FD6E16102124000ADA7B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D446FD6D16102124000ADA7B /* Default@2x.png */; };
D44C620C132DFF330009C878 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620B132DFF330009C878 /* OpenAL.framework */; };
D44C620E132DFF430009C878 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620D132DFF430009C878 /* AVFoundation.framework */; };
D44C6210132DFF4E0009C878 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620F132DFF4E0009C878 /* AudioToolbox.framework */; };
D4EF949A15BD2D8B00D803EB /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949915BD2D8B00D803EB /* Icon-57.png */; };
D4EF949C15BD2D8E00D803EB /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949B15BD2D8E00D803EB /* Icon-114.png */; };
D4EF949E15BD2D9600D803EB /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949D15BD2D9600D803EB /* Icon-72.png */; };
D4EF94A015BD2D9800D803EB /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949F15BD2D9800D803EB /* Icon-144.png */; };
FADC4535176F0ED900B2D5ED /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC4534176F0DC500B2D5ED /* libcocos2dx.a */; };
FADC4547176F103900B2D5ED /* libPluginAdmob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC4541176F100B00B2D5ED /* libPluginAdmob.a */; };
FADC4548176F103900B2D5ED /* libPluginProtocol.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC453B176F0FFD00B2D5ED /* libPluginProtocol.a */; };
FADC454B176F104600B2D5ED /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC454A176F104600B2D5ED /* AdSupport.framework */; };
FADC454D176F105A00B2D5ED /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC454C176F105A00B2D5ED /* StoreKit.framework */; };
FADC454F176F10A100B2D5ED /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC454E176F10A100B2D5ED /* SystemConfiguration.framework */; };
FADC4551176F10FF00B2D5ED /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC4550176F10FF00B2D5ED /* MediaPlayer.framework */; };
FADC4553176F110F00B2D5ED /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC4552176F110F00B2D5ED /* MessageUI.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
FADC4533176F0DC500B2D5ED /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15A3D87E1682F7B3002FB0C5 /* cocos2dx.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 1551A33F158F2AB200E66CFE;
remoteInfo = cocos2dx;
};
FADC453A176F0FFD00B2D5ED /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FADC4536176F0FFC00B2D5ED /* PluginProtocol.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FA09A321168ADBC2008C1C7B;
remoteInfo = PluginProtocol;
};
FADC4540176F100B00B2D5ED /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FADC453C176F100B00B2D5ED /* PluginAdmob.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FADC44A7176EA82000B2D5ED;
remoteInfo = PluginAdmob;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
15A3D87E1682F7B3002FB0C5 /* cocos2dx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2dx.xcodeproj; path = ../../../../cocos2dx/proj.ios/cocos2dx.xcodeproj; sourceTree = "<group>"; };
1AC3624216D4A1E8000847F2 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = SOURCE_ROOT; };
1AC3624316D4A1E8000847F2 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = SOURCE_ROOT; };
1AC3624516D4A1E8000847F2 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
1AC3624616D4A1E8000847F2 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = SOURCE_ROOT; };
1ACB3243164770DE00914215 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = "<group>"; };
1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = "<group>"; };
1AFAF8B416D35DE700DB1158 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = "<group>"; };
1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = "<group>"; };
1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../Classes/HelloWorldScene.h; sourceTree = "<group>"; };
1AFAF8B916D35E4900DB1158 /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = "<group>"; };
1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = "<group>"; };
1AFCDA8016D4A25900906EA6 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = SOURCE_ROOT; };
1AFCDA8116D4A25900906EA6 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = SOURCE_ROOT; };
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D6058910D05DD3D006BFB54 /* HelloAds.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloAds.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
7855E0DF153FEF240059DD9A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = SOURCE_ROOT; };
BF170DB012928DE900B8313A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
BF170DB212928DE900B8313A /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
BF170DB412928DE900B8313A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
BF1C47EA1293683800B63C5D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
D41A0AD0160F154A004552AE /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../proj.ios/Default-568h@2x.png"; sourceTree = "<group>"; };
D446FD6D16102124000ADA7B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "../proj.ios/Default@2x.png"; sourceTree = "<group>"; };
D44C620B132DFF330009C878 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
D44C620D132DFF430009C878 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
D44C620F132DFF4E0009C878 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
D4EF949915BD2D8B00D803EB /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-57.png"; path = "../proj.ios/Icon-57.png"; sourceTree = "<group>"; };
D4EF949B15BD2D8E00D803EB /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-114.png"; path = "../proj.ios/Icon-114.png"; sourceTree = "<group>"; };
D4EF949D15BD2D9600D803EB /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "../proj.ios/Icon-72.png"; sourceTree = "<group>"; };
D4EF949F15BD2D9800D803EB /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-144.png"; path = "../proj.ios/Icon-144.png"; sourceTree = "<group>"; };
D4F9F37B12E54555005CA6D2 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
FADC4536176F0FFC00B2D5ED /* PluginProtocol.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PluginProtocol.xcodeproj; path = ../../../protocols/proj.ios/PluginProtocol.xcodeproj; sourceTree = "<group>"; };
FADC453C176F100B00B2D5ED /* PluginAdmob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PluginAdmob.xcodeproj; path = ../../../plugins/admob/proj.ios/PluginAdmob.xcodeproj; sourceTree = "<group>"; };
FADC454A176F104600B2D5ED /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
FADC454C176F105A00B2D5ED /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
FADC454E176F10A100B2D5ED /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
FADC4550176F10FF00B2D5ED /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
FADC4552176F110F00B2D5ED /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FADC4553176F110F00B2D5ED /* MessageUI.framework in Frameworks */,
FADC4551176F10FF00B2D5ED /* MediaPlayer.framework in Frameworks */,
FADC454F176F10A100B2D5ED /* SystemConfiguration.framework in Frameworks */,
FADC454D176F105A00B2D5ED /* StoreKit.framework in Frameworks */,
FADC454B176F104600B2D5ED /* AdSupport.framework in Frameworks */,
FADC4547176F103900B2D5ED /* libPluginAdmob.a in Frameworks */,
FADC4548176F103900B2D5ED /* libPluginProtocol.a in Frameworks */,
FADC4535176F0ED900B2D5ED /* libcocos2dx.a in Frameworks */,
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
BF171245129291EC00B8313A /* OpenGLES.framework in Frameworks */,
BF1712461292920000B8313A /* libxml2.dylib in Frameworks */,
BF1712471292920000B8313A /* libz.dylib in Frameworks */,
BF1C47F01293687400B63C5D /* QuartzCore.framework in Frameworks */,
D44C620C132DFF330009C878 /* OpenAL.framework in Frameworks */,
D44C620E132DFF430009C878 /* AVFoundation.framework in Frameworks */,
D44C6210132DFF4E0009C878 /* AudioToolbox.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* ios */ = {
isa = PBXGroup;
children = (
1AC3624216D4A1E8000847F2 /* AppController.h */,
1AC3624316D4A1E8000847F2 /* AppController.mm */,
D4F9F37B12E54555005CA6D2 /* Info.plist */,
1AC3624516D4A1E8000847F2 /* main.m */,
1AC3624616D4A1E8000847F2 /* Prefix.pch */,
1AFCDA8016D4A25900906EA6 /* RootViewController.h */,
1AFCDA8116D4A25900906EA6 /* RootViewController.mm */,
);
name = ios;
path = Classes;
sourceTree = "<group>";
};
15AA9C4015B7EC450033D6C2 /* Classes */ = {
isa = PBXGroup;
children = (
1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */,
1AFAF8B416D35DE700DB1158 /* AppDelegate.h */,
1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */,
1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */,
);
name = Classes;
path = ../classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* HelloAds.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
FADC453C176F100B00B2D5ED /* PluginAdmob.xcodeproj */,
FADC4536176F0FFC00B2D5ED /* PluginProtocol.xcodeproj */,
15A3D87E1682F7B3002FB0C5 /* cocos2dx.xcodeproj */,
15AA9C4015B7EC450033D6C2 /* Classes */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
080E96DDFE201D6D7F000001 /* ios */,
19C28FACFE9D520D11CA2CBB /* Products */,
78C7DDAA14EBA5050085D0C2 /* Resources */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
FADC4552176F110F00B2D5ED /* MessageUI.framework */,
FADC4550176F10FF00B2D5ED /* MediaPlayer.framework */,
FADC454E176F10A100B2D5ED /* SystemConfiguration.framework */,
FADC454C176F105A00B2D5ED /* StoreKit.framework */,
FADC454A176F104600B2D5ED /* AdSupport.framework */,
1ACB3243164770DE00914215 /* libcurl.a */,
BF170DB212928DE900B8313A /* libxml2.dylib */,
BF170DB412928DE900B8313A /* libz.dylib */,
D44C620F132DFF4E0009C878 /* AudioToolbox.framework */,
D44C620D132DFF430009C878 /* AVFoundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
D44C620B132DFF330009C878 /* OpenAL.framework */,
BF170DB012928DE900B8313A /* OpenGLES.framework */,
BF1C47EA1293683800B63C5D /* QuartzCore.framework */,
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
78C7DDAA14EBA5050085D0C2 /* Resources */ = {
isa = PBXGroup;
children = (
1AFAF8B916D35E4900DB1158 /* CloseNormal.png */,
1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */,
D41A0AD0160F154A004552AE /* Default-568h@2x.png */,
7855E0DF153FEF240059DD9A /* Default.png */,
D446FD6D16102124000ADA7B /* Default@2x.png */,
D4EF949B15BD2D8E00D803EB /* Icon-114.png */,
D4EF949F15BD2D9800D803EB /* Icon-144.png */,
D4EF949915BD2D8B00D803EB /* Icon-57.png */,
D4EF949D15BD2D9600D803EB /* Icon-72.png */,
);
name = Resources;
path = ../Resources;
sourceTree = "<group>";
};
FADC4530176F0DC500B2D5ED /* Products */ = {
isa = PBXGroup;
children = (
FADC4534176F0DC500B2D5ED /* libcocos2dx.a */,
);
name = Products;
sourceTree = "<group>";
};
FADC4537176F0FFC00B2D5ED /* Products */ = {
isa = PBXGroup;
children = (
FADC453B176F0FFD00B2D5ED /* libPluginProtocol.a */,
);
name = Products;
sourceTree = "<group>";
};
FADC453D176F100B00B2D5ED /* Products */ = {
isa = PBXGroup;
children = (
FADC4541176F100B00B2D5ED /* libPluginAdmob.a */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* HelloAds */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloAds" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = HelloAds;
productName = iphone;
productReference = 1D6058910D05DD3D006BFB54 /* HelloAds.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0430;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloAds" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = FADC4530176F0DC500B2D5ED /* Products */;
ProjectRef = 15A3D87E1682F7B3002FB0C5 /* cocos2dx.xcodeproj */;
},
{
ProductGroup = FADC453D176F100B00B2D5ED /* Products */;
ProjectRef = FADC453C176F100B00B2D5ED /* PluginAdmob.xcodeproj */;
},
{
ProductGroup = FADC4537176F0FFC00B2D5ED /* Products */;
ProjectRef = FADC4536176F0FFC00B2D5ED /* PluginProtocol.xcodeproj */;
},
);
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* HelloAds */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
FADC4534176F0DC500B2D5ED /* libcocos2dx.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcocos2dx.a;
remoteRef = FADC4533176F0DC500B2D5ED /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FADC453B176F0FFD00B2D5ED /* libPluginProtocol.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libPluginProtocol.a;
remoteRef = FADC453A176F0FFD00B2D5ED /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FADC4541176F100B00B2D5ED /* libPluginAdmob.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libPluginAdmob.a;
remoteRef = FADC4540176F100B00B2D5ED /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7855E0E1153FEF240059DD9A /* Default.png in Resources */,
D4EF949A15BD2D8B00D803EB /* Icon-57.png in Resources */,
D4EF949C15BD2D8E00D803EB /* Icon-114.png in Resources */,
D4EF949E15BD2D9600D803EB /* Icon-72.png in Resources */,
D4EF94A015BD2D9800D803EB /* Icon-144.png in Resources */,
D41A0AD1160F154A004552AE /* Default-568h@2x.png in Resources */,
D446FD6E16102124000ADA7B /* Default@2x.png in Resources */,
1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */,
1AFAF8BD16D35E4900DB1158 /* CloseSelected.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */,
1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */,
1AC3624916D4A1E8000847F2 /* AppController.mm in Sources */,
1AC3624B16D4A1E8000847F2 /* main.m in Sources */,
1AFCDA8216D4A25900906EA6 /* RootViewController.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = (
USE_FILE32API,
CC_TARGET_OS_IPHONE,
"COCOS2D_DEBUG=1",
CC_ENABLE_CHIPMUNK_INTEGRATION,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = "";
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../../cocos2dx\"",
"\"$(SRCROOT)/../../../../cocos2dx/include\"",
"\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"",
"\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"",
"\"$(SRCROOT)/../../../../cocos2dx/platform/ios/Simulation\"",
"\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"",
"\"$(SRCROOT)/../../../protocols/include\"",
);
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"",
"\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"",
);
OTHER_CFLAGS = "-O2";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = HelloAds;
PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "";
VALID_ARCHS = "armv6 armv7 i386";
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = (
USE_FILE32API,
CC_TARGET_OS_IPHONE,
CC_ENABLE_CHIPMUNK_INTEGRATION,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = "";
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../../cocos2dx\"",
"\"$(SRCROOT)/../../../../cocos2dx/include\"",
"\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/ios\"",
"\"$(SRCROOT)/../../../../cocos2dx/platform/ios\"",
"\"$(SRCROOT)/../../../../cocos2dx/platform/ios/Simulation\"",
"\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"",
"\"$(SRCROOT)/../../../protocols/include\"",
);
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"",
"\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = HelloAds;
PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = iphoneos;
VALID_ARCHS = "armv6 armv7 i386";
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALID_ARCHS = "armv6 armv7 i386";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloAds" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloAds" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

View File

@ -0,0 +1,8 @@
//
// Prefix header for all source files of the 'iphone' target in the 'iphone' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif

View File

@ -0,0 +1,8 @@
#import <UIKit/UIKit.h>
@interface RootViewController : UIViewController {
}
@end

View File

@ -0,0 +1,65 @@
#import "RootViewController.h"
@implementation RootViewController
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
// Custom initialization
}
return self;
}
*/
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
// Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {
return YES;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end

View File

@ -0,0 +1,12 @@
#import <UIKit/UIKit.h>
// Under iOS and the Simulator, we can use an alternate Accelerometer interface
#import "AccelerometerSimulation.h"
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
[pool release];
return retVal;
}