Skip to content

CF_OnUpdateFn

Category: time
GitHub: cute_time.h


An optional function pointer (callback), called whenever an update should occur, after calling cf_update_time.

typedef void (CF_OnUpdateFn)(void* udata);

Remarks

This callback can be used to implement your main-loop, and is generally used to update your gameplay/logic/physics. Usually rendering will occur outside of this callback one time per frame. This callback is only really useful when using a fixed timestep (see cf_set_fixed_timestep), as multiple calls can occur given a single frame's update.

cf_set_fixed_timestep
cf_set_fixed_timestep_max_updates
cf_update_time
CF_DELTA_TIME_FIXED
CF_DELTA_TIME_INTERPOLANT
cf_set_target_framerate