| 351 | } |
| 352 | |
| 353 | std::optional<bool> WindowSplash::loop() { |
| 354 | // Splash window rendering loop |
| 355 | this->fullFrame(); |
| 356 | |
| 357 | // Check if all background tasks have finished so the splash screen can be closed |
| 358 | if (m_tasksSucceeded.wait_for(0s) == std::future_status::ready) { |
| 359 | if (m_tasksSucceeded.get()) { |
| 360 | log::debug("All tasks finished successfully!"); |
| 361 | return true; |
| 362 | } else { |
| 363 | log::warn("All tasks finished, but some failed"); |
| 364 | return false; |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | return std::nullopt; |
| 369 | } |
| 370 | |
| 371 | void WindowSplash::initGLFW() { |
| 372 | glfwSetErrorCallback([](int errorCode, const char *desc) { |