util.c: floating point timers for game loop
This commit is contained in:
10
src/util.h
10
src/util.h
@@ -118,4 +118,14 @@ typedef struct fvec2 {
|
||||
void tick_timer(int *value);
|
||||
|
||||
|
||||
/* decrements a floating point second-based timer, stopping at 0.0 */
|
||||
/* meant for poll based real time logic in game logic */
|
||||
/* note that it should be decremented only on the next tick after its creation */
|
||||
void tick_ftimer(float *value);
|
||||
|
||||
/* same as `tick_ftimer` but instaed of clamping it repeats */
|
||||
/* returns true if value was cycled */
|
||||
bool tick_ftimer_repeat(float *value, float at);
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user