MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / init

Method init

Source/Basic/Director.cpp:216–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216bool Director::init() {
217 _profilerInfo.init();
218 SharedView.reset();
219 if (!SharedImGui.init()) {
220 Error("failed to initialize ImGui.");
221 return false;
222 }
223 if (!SharedKeyboard.init()) {
224 Error("failed to initialize Keyboard.");
225 return false;
226 }
227 if (!SharedAudio.init()) {
228 Warn("audio function is not available.");
229 }
230#ifndef DORA_NO_RUST
231 if (!dora_rust_init()) {
232 Error("failed to initialize Rust runtime.");
233 return false;
234 }
235#endif // DORA_NO_RUST
236 if (!SharedContent.visitDir(SharedContent.getAssetPath(), [](String file, String path) {
237 switch (Switch::hash(file.toLower())) {
238 case "init.yue"_hash:
239 case "init.tl"_hash:
240 case "init.lua"_hash:
241 case "init.wasm"_hash:
242 SharedLuaEngine.executeModule(Path::concat({path, Path::getName(file.toString())}));
243 return true;
244 }
245 return false;
246 })) {
247 Info("Dora SSR started without script entry.");
248 }
249 return true;
250}
251
252void Director::handleTouchEvents() {
253 /* handle ImGui touch */

Callers

nothing calls this directly

Calls 15

dora_rust_initFunction · 0.85
InfoStruct · 0.85
stringFunction · 0.85
getCapsFunction · 0.85
visitDirMethod · 0.80
toLowerMethod · 0.80
executeModuleMethod · 0.80
toStringMethod · 0.65
getMethod · 0.65
clearMethod · 0.65
insertMethod · 0.65
ErrorEnum · 0.50

Tested by

no test coverage detected