I was adding a FrameRateLimit to my app and tried to move the config to a file following: FrameRateLimitConfig doc
I noticed there is no example of using the FrameRateLimitConfig in the doc, nor in amethyst-repo/examples. I made one myself based on the example in frame_limiter doc but new users may benefit from a concrete example (I guess it’s trivial to convert a struct into a RON for more advanced users, but it took me some time to find out).
It could also be added to the Pong Tutorial in Setting up the project (either using
with_frame_limit_config + a RON) since other config files are made in that step. Also, the tutorial never mentioned that the default FPS was 144 so it surprised me when I debugged the timer, as I was expecting 30 or 60FPS.
By the way, here is my
frame_limiter.ron for those looking for an example:
( strategy: SleepAndYield(Duration(secs: 0, nanos: 2000000)), fps: 60, ) # usage .with_frame_limit_config(frame_limit_config)
.with_frame_limit( FrameRateLimitStrategy::SleepAndYield(Duration::from_millis(2)), 60, )