nannou
nannou copied to clipboard
Improve loop timing and revisit `LoopMode`s
This is a reminder for myself to revisit our approach to application loop timing, and perhaps implement some options based on the game loop article here.
Options that we definitely want:
-
Loop once:
model
runs once,update
runs once thenview
runs once. Following this, the application simply waits on window, application and input events.update
andview
are never called again. This would be best implemented a manner that allows any number of loops. OurLoopMode::NTimes
is basically this. -
Wait:
model
runs once,update
runs once thenview
runs once. Following this, the application waits on window, application and input events. Once events are cleared,update
and thenview
run, and the application goes back to waiting for events. This is currently implemented asLoopMode::Wait
. -
A continuous loop mode: We currently have
RefreshSync
andRate
modes, but both are a little unstable on different platforms. This article describes a nice solution which may solve the issues that we currently have with both.
This article might be useful as well: https://gafferongames.com/post/fix_your_timestep/
This seems like an integral part of Nannou... As it stands, the Rate
mode does not even follow the user preference for a given update rate. It's been two years — are there still plans to work on this?