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

Method applicationDidFinishLaunching

tests/lua-tests/Source/AppDelegate.cpp:46–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46bool AppDelegate::applicationDidFinishLaunching()
47{
48 ax::setLogFmtFlag(ax::LogFmtFlag::Colored);
49
50 // register lua engine
51 LuaEngine* pEngine = LuaEngine::getInstance();
52 ScriptEngineManager::getInstance()->setScriptEngine(pEngine);
53
54 LuaStack* stack = pEngine->getLuaStack();
55 lua_State* L = stack->getLuaState();
56
57 lua_module_register(L);
58
59 lua_getglobal(L, "_G");
60 if (lua_istable(L, -1)) // stack:...,_G,
61 {
62#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || \
63 AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC)
64 register_assetsmanager_test_sample(L);
65#endif
66 register_test_binding(L);
67 }
68 lua_pop(L, 1);
69
70 FileUtils::getInstance()->addSearchPath("src");
71 FileUtils::getInstance()->addSearchPath("res");
72 pEngine->executeScriptFile("controller.lua");
73
74 return true;
75}
76
77// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked.
78void AppDelegate::applicationDidEnterBackground()

Callers

nothing calls this directly

Calls 10

setLogFmtFlagFunction · 0.85
getInstanceFunction · 0.85
lua_module_registerFunction · 0.85
lua_getglobalFunction · 0.85
register_test_bindingFunction · 0.85
setScriptEngineMethod · 0.80
getLuaStateMethod · 0.80
addSearchPathMethod · 0.45
executeScriptFileMethod · 0.45

Tested by

no test coverage detected