Stardew Engine
Loading...
Searching...
No Matches
TimerPool.h
Go to the documentation of this file.
1#ifndef TIMERPOOL_H
2#define TIMERPOOL_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include <stdbool.h>
8#include "HandleDefs.h"
9
10struct SDTimer;
11
12
14typedef bool(*TimerCallbackFn)(struct SDTimer*);
15
17struct SDTimer
18{
19 bool bActive;
20 bool bRepeat;
22 double total;
23
25 void* pUserData;
26
27 // implementation details
28 double elapsed;
31};
32
33
40
41struct SDTimerPool TP_InitTimerPool(int initialSize);
43
44HTimer TP_GetTimer(struct SDTimerPool* pPool, const struct SDTimer* pTimer);
45void TP_FreeTimer(struct SDTimerPool* pPool, HTimer timer);
46
47void TP_DoTimers(struct SDTimerPool* pPool, double deltaT);
48
49#ifdef __cplusplus
50}
51#endif
52#endif
HGeneric HTimer
Definition HandleDefs.h:36
struct SDTimerPool TP_InitTimerPool(int initialSize)
Definition TimerPool.c:7
HTimer TP_GetTimer(struct SDTimerPool *pPool, const struct SDTimer *pTimer)
Definition TimerPool.c:21
void TP_FreeTimer(struct SDTimerPool *pPool, HTimer timer)
Definition TimerPool.c:44
void TP_DoTimers(struct SDTimerPool *pPool, double deltaT)
Definition TimerPool.c:67
bool(* TimerCallbackFn)(struct SDTimer *)
return true for the timer to be removed
Definition TimerPool.h:14
struct SDTimerPool TP_DestroyTimerPool(struct SDTimerPool *pPool)
Definition TimerPool.c:16
Definition TimerPool.h:35
HTimer hTimerListend
Definition TimerPool.h:38
struct SDTimer * pPool
Definition TimerPool.h:36
HTimer hTimerListhead
Definition TimerPool.h:37
SD == stardew to avoid name collisions.
Definition TimerPool.h:18
double total
Definition TimerPool.h:22
TimerCallbackFn fnCallback
Definition TimerPool.h:24
double elapsed
Definition TimerPool.h:28
bool bRepeat
Definition TimerPool.h:20
void * pUserData
Definition TimerPool.h:25
HTimer HPrev
Definition TimerPool.h:30
HTimer HNext
Definition TimerPool.h:29
bool bActive
Definition TimerPool.h:19
bool bAutoReset
Definition TimerPool.h:21