| 93 | : window_(w), simulation_(&s), renderer_(&r), captureController_(&c) {} |
| 94 | |
| 95 | int 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 | |
| 122 | void Interface::reloadUiFonts() { |
| 123 | if (!fontManager.load(styleManager.getScale())) { |
nothing calls this directly
no test coverage detected