Limits the frame rate to the given value (default 240 fps). Limiting the frame
rate will reduce the processor load and can be used to work around script
bugs causing speed differences and other effects on extremely high frame
400 (default: 240)
, or 0 for no limit.
- The Windows Sleep function is normally used for idling the system
and giving task time back to the Windows task scheduler
can be inaccurate by several milliseconds, depending on
the tasks running on the sytem.
This can have the
effect of 'locking' the frame rate at certain values
within a wide range of fps_max settings,
and of 'stuttering' motions dependent on background tasks. A7.08 For overcoming this problem, Sleep is only used for idle times greater than 10 ms. Smaller times are 'burned' in a CPU loop.
Limiting the frame rate through fps_max is normally only required in window mode.
Fullscreen mode is synchronized to the monitor and causes the frame rate to be an integer fraction of the
monitor frequency (such as 60 or 30 Hz), regardless of this setting.
fps_max = 40; // limit the frame rate at 40 fps
time_step, time_factor, fps_min, fps_lock, total_ticks, total_frames, wait,