hecrj / coffee

An opinionated 2D game engine for Rust
https://docs.rs/coffee
MIT License
1.09k stars 55 forks source link

Add `Game::on_close_request` #14

Closed jalbert-dev closed 5 years ago

jalbert-dev commented 5 years ago

Fixes #11

Tried to stick to the style of the original code and documentation. Let me know if there are any issues.

hecrj commented 5 years ago

Thank you very much! :clinking_glasses:

I am thinking that maybe we could also pass a mutable reference of Self::Input as an argument to this method, like we do in on_input. This way games can track the close request if they need to. Could you add that?

jalbert-dev commented 5 years ago

It hadn't occurred to me that a close request from the OS would be something the user might want to store in their Input type, but that does make sense! Went ahead and made that change. I also altered the function description comment to be more in line with yours, and to be a little more specific about what type of close requests the function handles.

hecrj commented 5 years ago

Awesome! Thank you again!