2014-03-10 15:32:48 +08:00
|
|
|
#ifndef __APP_DELEGATE_H__
|
|
|
|
#define __APP_DELEGATE_H__
|
|
|
|
|
|
|
|
#include "cocos2d.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();
|
|
|
|
|
2014-08-22 16:22:16 +08:00
|
|
|
void initGLContextAttrs();
|
2014-03-10 15:32:48 +08:00
|
|
|
/**
|
|
|
|
@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();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __APP_DELEGATE_H__
|
|
|
|
|