2015-04-16 18:07:35 +08:00
|
|
|
#ifndef _APP_DELEGATE_H_
|
|
|
|
#define _APP_DELEGATE_H_
|
|
|
|
|
|
|
|
#include "platform/CCApplication.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();
|
|
|
|
|
|
|
|
void initGLContextAttrs() override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Implement Director and Scene init code here.
|
|
|
|
@return true Initialize success, app continue.
|
|
|
|
@return false Initialize failed, app terminate.
|
|
|
|
*/
|
2015-10-16 13:58:53 +08:00
|
|
|
virtual bool applicationDidFinishLaunching() override;
|
2015-04-16 18:07:35 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
@brief The function be called when the application enter background
|
|
|
|
@param the pointer of the application
|
|
|
|
*/
|
2015-10-16 13:58:53 +08:00
|
|
|
virtual void applicationDidEnterBackground() override;
|
2015-04-16 18:07:35 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
@brief The function be called when the application enter foreground
|
|
|
|
@param the pointer of the application
|
|
|
|
*/
|
2015-10-16 13:58:53 +08:00
|
|
|
virtual void applicationWillEnterForeground() override;
|
2015-04-16 18:07:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _APP_DELEGATE_H_
|
|
|
|
|