MCPcopy Create free account
hub / github.com/axmolengine/axmol / applicationDidFinishLaunching

Method applicationDidFinishLaunching

templates/cpp/Source/AppDelegate.cpp:59–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59bool 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.
97void AppDelegate::applicationDidEnterBackground()

Callers

nothing calls this directly

Calls 7

getInstanceFunction · 0.85
createFunction · 0.85
setRenderViewMethod · 0.80
runWithSceneMethod · 0.80
RectClass · 0.50
setAnimationIntervalMethod · 0.45

Tested by

no test coverage detected