Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose more of the game loop internals to the user #119

Open
1 of 4 tasks
17cupsofcoffee opened this issue Apr 27, 2019 · 2 comments
Open
1 of 4 tasks

Expose more of the game loop internals to the user #119

17cupsofcoffee opened this issue Apr 27, 2019 · 2 comments
Labels
Area: API/Ergonomics Issues relating to the crate's API and how it feels to use Area: Game Loop Issues relating to the main game loop. Type: Feature Request Improvements that could be made to the code/documentation.

Comments

@17cupsofcoffee
Copy link
Owner

17cupsofcoffee commented Apr 27, 2019

It'd be nice if it were possible for users to opt out of the standard game loop and write their own, if they so desire.

Most of the groundwork for this is already there - the missing bits are:

  • Access to the timing APIs (not strictly neccecary, as it's easy to implement yourself)
  • A way to force the engine to poll for SDL events
  • Access to the API that updates input state
  • A way to show/hide the window

The implementation of the actual looping needs to provided by Tetra, so that we can abstract over blocking/non-blocking APIs. I think this will probably boil down to the user providing a closure that represents one iteration of the game loop, and then scheduling that closure will be handled by the engine.

@17cupsofcoffee 17cupsofcoffee added Type: Feature Request Improvements that could be made to the code/documentation. Area: Game Loop Issues relating to the main game loop. Area: API/Ergonomics Issues relating to the crate's API and how it feels to use labels Apr 27, 2019
@17cupsofcoffee
Copy link
Owner Author

#122 might assist in this.

@17cupsofcoffee
Copy link
Owner Author

All of the functionality listed above is now exposed via the (private) platform API - just need to figure out a way of exposing that publicly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: API/Ergonomics Issues relating to the crate's API and how it feels to use Area: Game Loop Issues relating to the main game loop. Type: Feature Request Improvements that could be made to the code/documentation.
Projects
None yet
Development

No branches or pull requests

1 participant