| 273 | } |
| 274 | |
| 275 | void MainLoopController::drawLoadingScreen() |
| 276 | { |
| 277 | //background color |
| 278 | glClearColor(0, 0, 0.1f, 1.0f); |
| 279 | glClear(GL_COLOR_BUFFER_BIT); |
| 280 | |
| 281 | auto& styleRep = StyleRepository::get(); |
| 282 | auto center = ImGui::GetMainViewport()->GetCenter(); |
| 283 | auto bottom = ImGui::GetMainViewport()->Pos.y + ImGui::GetMainViewport()->Size.y; |
| 284 | ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f)); |
| 285 | auto imageScale = scale(1.0f); |
| 286 | ImGui::SetNextWindowSize(ImVec2(_logo.width * imageScale + 10.0f, _logo.height * imageScale + 10.0f)); |
| 287 | |
| 288 | ImGuiWindowFlags windowFlags = 0 | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
| 289 | | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoBackground; |
| 290 | ImGui::Begin("##startup", NULL, windowFlags); |
| 291 | ImGui::Image((void*)(intptr_t)_logo.textureId, ImVec2(_logo.width * imageScale, _logo.height * imageScale)); |
| 292 | ImGui::End(); |
| 293 | |
| 294 | ImDrawList* drawList = ImGui::GetBackgroundDrawList(); |
| 295 | ImColor textColor = Const::ProgramVersionTextColor; |
| 296 | textColor.Value.w *= ImGui::GetStyle().Alpha; |
| 297 | |
| 298 | drawList->AddText(styleRep.getReefLargeFont(), scale(48.0f), {center.x - scale(175), bottom - scale(200)}, textColor, "Artificial Life Environment"); |
| 299 | |
| 300 | auto versionString = "Version " + Const::ProgramVersion; |
| 301 | drawList->AddText( |
| 302 | styleRep.getReefMediumFont(), |
| 303 | scale(24.0f), |
| 304 | {center.x - scale(toFloat(versionString.size()) * 3.4f), bottom - scale(140)}, |
| 305 | textColor, |
| 306 | versionString.c_str()); |
| 307 | |
| 308 | if (GlobalSettings::get().isDebugMode()) { |
| 309 | drawList->AddText( |
| 310 | styleRep.getReefMediumFont(), |
| 311 | scale(24.0f), |
| 312 | {center.x - scale(24.0f), bottom - scale(100)}, |
| 313 | textColor, |
| 314 | "DEBUG"); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | void MainLoopController::decreaseAlphaForFadeOutLoadingScreen() |
| 319 | { |
nothing calls this directly
no test coverage detected