17cupsofcoffee / tetra

🎮 A simple 2D game framework written in Rust
MIT License
907 stars 63 forks source link

Add the option to disable the 1000 FPS limit #321

Closed fililip closed 1 year ago

fililip commented 1 year ago

Let the user choose whether they want the thread sleep based FPS limiting behavior to be present when rendering their games.

When creating a new context, the user can do so by calling fps_limit(false) on a ContextBuilder instance.

ContextBuilder::new("app", 1280, 720)
    .vsync(false)
    .fps_limit(false)
    .build()?
    .run(GameState::new)?;
17cupsofcoffee commented 1 year ago

Thanks - this seems like a sensible thing to add, as I've had people complain about the (admittedly janky) FPS limiter before, and it's pointless having it on if you're using vsync too.