| 57 | } |
| 58 | |
| 59 | bool AppDelegate::applicationDidFinishLaunching() |
| 60 | { |
| 61 | // initialize director |
| 62 | auto director = Director::getInstance(); |
| 63 | auto renderView = director->getRenderView(); |
| 64 | if (!renderView) |
| 65 | { |
| 66 | #if (AX_TARGET_PLATFORM != AX_PLATFORM_ANDROID) && (AX_TARGET_PLATFORM != AX_PLATFORM_IOS) |
| 67 | renderView = RenderViewImpl::createWithRect( |
| 68 | "Dummy", ax::Rect(0, 0, designResolutionSize.width, designResolutionSize.height)); |
| 69 | #else |
| 70 | renderView = RenderViewImpl::create("Dummy"); |
| 71 | #endif |
| 72 | director->setRenderView(renderView); |
| 73 | } |
| 74 | |
| 75 | // turn on display FPS |
| 76 | director->setStatsDisplay(true); |
| 77 | |
| 78 | // set FPS. the default value is 1.0/60 if you don't call this |
| 79 | director->setAnimationInterval(1.0f / 60); |
| 80 | |
| 81 | // Set the design resolution |
| 82 | renderView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, |
| 83 | ResolutionPolicy::SHOW_ALL); |
| 84 | |
| 85 | #if !_AX_TESTS |
| 86 | // create a scene. it's an autorelease object |
| 87 | auto scene = utils::createInstance<MainScene>(); |
| 88 | |
| 89 | // run |
| 90 | director->runWithScene(scene); |
| 91 | #endif |
| 92 | |
| 93 | return true; |
| 94 | } |
| 95 | |
| 96 | // This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. |
| 97 | void AppDelegate::applicationDidEnterBackground() |
nothing calls this directly
no test coverage detected