MCPcopy Create free account
hub / github.com/cocos/cocos-engine / init

Method init

native/cocos/engine/Engine.cpp:138–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138int32_t Engine::init() {
139 _scheduler = std::make_shared<Scheduler>();
140 _fs = createFileUtils();
141 // May create gfx device in render subsystem in future.
142 _gfxDevice = gfx::DeviceManager::create();
143 _programLib = ccnew ProgramLib();
144 _builtinResMgr = ccnew BuiltinResMgr;
145
146#if CC_USE_DEBUG_RENDERER
147 _debugRenderer = ccnew DebugRenderer();
148#endif
149
150#if CC_USE_PROFILER
151 _profiler = ccnew Profiler();
152#endif
153
154 EventDispatcher::init();
155
156 BasePlatform *platform = BasePlatform::getPlatform();
157
158 se::ScriptEngine::getInstance()->addRegisterCallback(setCanvasCallback);
159 emit<EngineStatusChange>(ON_START);
160 _inited = true;
161 return 0;
162}
163
164void Engine::destroy() {
165 cc::DeferredReleasePool::clear();

Callers

nothing calls this directly

Calls 7

ProgramLibClass · 0.70
DebugRendererClass · 0.70
ProfilerClass · 0.70
createFileUtilsFunction · 0.50
createFunction · 0.50
initFunction · 0.50
addRegisterCallbackMethod · 0.45

Tested by

no test coverage detected