AppDelegate.cpp 945 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "AppDelegate.h"
  2. #include <vector>
  3. #include <string>
  4. #include "ExampleScene.h"
  5. USING_NS_CC;
  6. using namespace std;
  7. AppDelegate::AppDelegate() {
  8. }
  9. AppDelegate::~AppDelegate() {
  10. }
  11. bool AppDelegate::applicationDidFinishLaunching() {
  12. CCDirector* director = CCDirector::sharedDirector();
  13. CCEGLView* view = CCEGLView::sharedOpenGLView();
  14. director->setOpenGLView(view);
  15. view->setViewName("Spine Example");
  16. view->setFrameSize(640, 480);
  17. view->setDesignResolutionSize(640, 480, kResolutionNoBorder);
  18. director->setDisplayStats(true);
  19. director->runWithScene(ExampleScene::scene());
  20. return true;
  21. }
  22. void AppDelegate::applicationDidEnterBackground() {
  23. CCDirector::sharedDirector()->stopAnimation();
  24. // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
  25. }
  26. void AppDelegate::applicationWillEnterForeground() {
  27. CCDirector::sharedDirector()->startAnimation();
  28. // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
  29. }