2012-02-09 17:54:25 +08:00
|
|
|
#ifndef _APP_DELEGATE_H_
|
|
|
|
#define _APP_DELEGATE_H_
|
|
|
|
|
|
|
|
#include "CCApplication.h"
|
|
|
|
|
|
|
|
/**
|
2012-04-19 14:35:52 +08:00
|
|
|
@brief The cocos2d Application.
|
2012-02-09 17:54:25 +08:00
|
|
|
|
|
|
|
The reason for implement as private inheritance is to hide some interface call by CCDirector.
|
|
|
|
*/
|
|
|
|
class AppDelegate : private cocos2d::CCApplication
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
AppDelegate();
|
|
|
|
virtual ~AppDelegate();
|
2012-02-09 17:54:25 +08:00
|
|
|
|
|
|
|
/**
|
2012-04-19 14:35:52 +08:00
|
|
|
@brief Implement for initialize OpenGL instance, set source path, etc...
|
2012-02-09 17:54:25 +08:00
|
|
|
*/
|
|
|
|
virtual bool initInstance();
|
|
|
|
|
|
|
|
/**
|
2012-04-19 14:35:52 +08:00
|
|
|
@brief Implement CCDirector and CCScene init code here.
|
2012-02-09 17:54:25 +08:00
|
|
|
@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();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _APP_DELEGATE_H_
|
|
|
|
|