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

Method applicationDidFinishLaunching

tests/unit-tests/Source/AppDelegate.cpp:47–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46
47bool AppDelegate::applicationDidFinishLaunching()
48{
49 // Enable logging output colored text style and prefix timestamp
50 ax::setLogFmtFlag(ax::LogFmtFlag::Full);
51
52 // whether enable global SDF font render support, since axmol-2.0.1
53 FontFreeType::setGlobalSDFEnabled(true);
54
55 // initialize director
56 auto director = Director::getInstance();
57 auto renderView = director->getRenderView();
58 if (!renderView)
59 {
60 std::string title = "Unit Tests";
61 #ifdef AX_PLATFORM_PC
62 renderView = RenderViewImpl::createWithRect(title, Rect(0, 0, gWindowSize.x, gWindowSize.y), 1.0F, true);
63 #else
64 renderView = RenderViewImpl::createWithRect(title, Rect(0, 0, gWindowSize.x, gWindowSize.y));
65 #endif
66 director->setRenderView(renderView);
67 }
68
69 director->setStatsDisplay(true);
70
71 #ifdef AX_PLATFORM_PC
72 director->setAnimationInterval(1.0f / glfwGetVideoMode(glfwGetPrimaryMonitor())->refreshRate);
73 #else
74 director->setAnimationInterval(1.0f / 60);
75 #endif
76
77 auto screenSize = renderView->getFrameSize();
78
79 renderView->setDesignResolutionSize(gWindowSize.x, gWindowSize.y, ResolutionPolicy::SHOW_ALL);
80
81 return true;
82}
83
84
85void AppDelegate::applicationDidEnterBackground()

Callers

nothing calls this directly

Calls 10

setLogFmtFlagFunction · 0.85
setGlobalSDFEnabledFunction · 0.85
getInstanceFunction · 0.85
glfwGetVideoModeFunction · 0.85
glfwGetPrimaryMonitorFunction · 0.85
setRenderViewMethod · 0.80
getFrameSizeMethod · 0.80
RectClass · 0.50
setAnimationIntervalMethod · 0.45

Tested by

no test coverage detected