#include "AppDelegate.h"
#include <vector>
#include <string>
#include "PlayingScene.h"
#include "AppMacros.h"
USING_NS_CC;
using
namespace std;
#define DESIGN_WIDTH 420
#define DESIGN_HEIGHT 720
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate()
{
}
bool
AppDelegate::applicationDidFinishLaunching() {
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
pEGLView->setDesignResolutionSize(DESIGN_WIDTH, DESIGN_HEIGHT, kResolutionShowAll);
pDirector->setAnimationInterval(1.0 / 60);
CCScene *pScene = PlayingScene::scene();
pDirector->runWithScene(pScene);
return
true ;
}
void
AppDelegate::applicationDidEnterBackground() {
CCDirector::sharedDirector()->stopAnimation();
}
void
AppDelegate::applicationWillEnterForeground() {
CCDirector::sharedDirector()->startAnimation();
}<br><br>main.cpp
|