show title splash while the game is loading

This commit is contained in:
georgemoralis 2024-05-16 16:58:14 +03:00
parent 55855b4195
commit c9b5b5e963
14 changed files with 8147 additions and 12 deletions

View file

@ -167,6 +167,7 @@ void VideoOutDriver::Flip(std::chrono::microseconds timeout) {
std::unique_lock lock{mutex};
submit_cond.wait_for(lock, timeout, [&] { return !requests.empty(); });
if (requests.empty()) {
renderer->ShowSplash();
return;
}
@ -175,8 +176,11 @@ void VideoOutDriver::Flip(std::chrono::microseconds timeout) {
requests.pop();
}
// Present the frame.
renderer->Present(req.frame);
if (!renderer->ShowSplash(
req.frame)) { // Whatever the game is rendering show splash if it is active
// Present the frame.
renderer->Present(req.frame);
}
std::scoped_lock lock{mutex};