package bogue
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=991bc2e85df38feb23bddf84addd758d
sha512=8b777f7b479946528626c4112bf45600bee9aed0d94742e3eed0659f9a0517e41d0eaf398299920fd5b9f86065bd0e24035662d2df36f24f6a044c78e61dee01
doc/bogue/Bogue/Time/index.html
Module Bogue.TimeSource
Time in msec.
Dependency graph
Time elapsed from the initialization of SDL (roughly, since the start of your program).
Create helper functions to help controlling the frame rate of the graphics loop. This is only useful if you have your own graphics loop, and do not use Main.run.
adaptive_fps 60 returns two functions start,fps. The statement start () will start the timing. At each iteration of your loop, you should call fps (), which will try to sleep long enough to achieve the desired 60FPS rate. It works on average: if some frames take longer, it will shorten the next frame to keep up. However, it tries to be nice to the CPU: even if one is really too slow, it will guarantee a 5ms sleep to the CPU and not try to keep up.
vsync is false by default, when true it sets GL swap interval to 1 to wait for next vsync, and if it can't keep up with that during animation it will set swap interval to -1 if supported by platform to use adaptive vsync. (Which should avoid forcing the animation rate to an integer ratio of monitor refresh rate.)
See also Main.get_monitor_refresh_rate