mirror of https://github.com/axmolengine/axmol.git
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef _APP_DELEGATE_H_
|
|
#define _APP_DELEGATE_H_
|
|
|
|
#include "platform/CCApplication.h"
|
|
#include "base/CCEventCustom.h"
|
|
#include "2d/CCScene.h"
|
|
|
|
/**
|
|
@brief The cocos2d Application.
|
|
|
|
The reason for implement as private inheritance is to hide some interface call by Director.
|
|
*/
|
|
class AppDelegate : private cocos2d::Application
|
|
{
|
|
public:
|
|
AppDelegate();
|
|
virtual ~AppDelegate();
|
|
|
|
virtual void initGLContextAttrs();
|
|
/**
|
|
@brief Implement Director and Scene init code here.
|
|
@return true Initialize success, app continue.
|
|
@return false Initialize failed, app terminate.
|
|
*/
|
|
virtual bool applicationDidFinishLaunching();
|
|
|
|
/**
|
|
@brief The function be called when the application enter background
|
|
@param the pointer of the application
|
|
*/
|
|
virtual void applicationDidEnterBackground();
|
|
|
|
/**
|
|
@brief The function be called when the application enter foreground
|
|
@param the pointer of the application
|
|
*/
|
|
virtual void applicationWillEnterForeground();
|
|
|
|
void onEvent(cocos2d::EventCustom *event);
|
|
|
|
private:
|
|
cocos2d::Scene* createScene() const;
|
|
};
|
|
|
|
#endif // _APP_DELEGATE_H_
|
|
|