| 136 | } |
| 137 | |
| 138 | int32_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 | |
| 164 | void Engine::destroy() { |
| 165 | cc::DeferredReleasePool::clear(); |
nothing calls this directly
no test coverage detected