AppDelegate.h Example File

demos/SimpleGameCocosNinja/cocos2d-x-Comparison/Classes/AppDelegate.h
 #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 CCDirector.
 */
 class  AppDelegate : private cocos2d::CCApplication
 {
 public:
     AppDelegate();
     virtual ~AppDelegate();

     /**
     @brief    Implement CCDirector and CCScene 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_

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support