As of now, the only way to gracefully quit a Game after Game::run is to implement Game::on_close_request and wait for a close request.
However, it is very common in games to have a UI option to "Quit the game". While we can use std::process::exit, it's not ideal as it doesn't gracefully stop the execution.
Therefore, I think we need to rethink the Game API a bit to allow graceful quits on demand.
As of now, the only way to gracefully quit a
Game
afterGame::run
is to implementGame::on_close_request
and wait for a close request.However, it is very common in games to have a UI option to "Quit the game". While we can use
std::process::exit
, it's not ideal as it doesn't gracefully stop the execution.Therefore, I think we need to rethink the
Game
API a bit to allow graceful quits on demand.