2010-11-27 18:25:31 +08:00
|
|
|
#ifndef _APP_DELEGATE_H_
|
|
|
|
#define _APP_DELEGATE_H_
|
|
|
|
|
2011-03-07 17:11:57 +08:00
|
|
|
#include "CCApplication.h"
|
2011-03-01 12:41:57 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
@brief The cocos2d Application.
|
|
|
|
|
|
|
|
The reason for implement as private inheritance is to hide some interface call by CCDirector.
|
|
|
|
*/
|
2011-03-07 17:11:57 +08:00
|
|
|
class AppDelegate : private cocos2d::CCApplication
|
2010-11-27 18:25:31 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
AppDelegate();
|
2011-03-01 12:41:57 +08:00
|
|
|
virtual ~AppDelegate();
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Implement for initialize OpenGL instance, set source path, etc...
|
|
|
|
*/
|
|
|
|
virtual bool initInstance();
|
2010-11-27 18:25:31 +08:00
|
|
|
|
2011-01-22 16:24:54 +08:00
|
|
|
/**
|
2011-03-01 12:41:57 +08:00
|
|
|
@brief Implement CCDirector and CCScene init code here.
|
2011-01-22 16:24:54 +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();
|
2010-11-27 18:25:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _APP_DELEGATE_H_
|
|
|
|
|