MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / init

Method init

App/GUI/interface/interface.cpp:95–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 : window_(w), simulation_(&s), renderer_(&r), captureController_(&c) {}
94
95int Interface::init() {
96 ImGui::CreateContext();
97 {
98 std::error_code fsError;
99 std::filesystem::create_directories(std::filesystem::path(AppPaths::kUserDirectory), fsError);
100 }
101 ImGui::GetIO().IniFilename = AppPaths::kImguiIniPath.data();
102
103 styleManager.applyCustomStyle();
104 syncWindowMetrics();
105
106 if (!fontManager.load(styleManager.getScale())) {
107 return EXIT_FAILURE;
108 }
109 ImGui_ImplGlfw_InitForOther(window_, true);
110
111 auto& ctx = WGPUContext::instance();
112 ImGui_ImplWGPU_InitInfo wgpuInfo{};
113 wgpuInfo.Device = (WGPUDevice)(*ctx.device());
114 wgpuInfo.RenderTargetFormat = (WGPUTextureFormat)ctx.surfaceFormat();
115 wgpuInfo.DepthStencilFormat = WGPUTextureFormat_Depth24Plus;
116 ImGui_ImplWGPU_Init(&wgpuInfo);
117 imguiBackendReady_ = true;
118
119 return EXIT_SUCCESS;
120}
121
122void Interface::reloadUiFonts() {
123 if (!fontManager.load(styleManager.getScale())) {

Callers

nothing calls this directly

Calls 4

applyCustomStyleMethod · 0.80
getScaleMethod · 0.80
surfaceFormatMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected