zenilib
0.5.3.0
|
Go to the source code of this file.
Typedefs | |
typedef void * | param |
typedef int | SDL_TimerID |
Functions | |
DECLSPEC SDL_TimerID SDLCALL | SDL_AddTimer (Uint32 interval, SDL_TimerCallback callback, void *param) |
Add a new timer to the pool of timers already running. More... | |
DECLSPEC void SDLCALL | SDL_Delay (Uint32 ms) |
Wait a specified number of milliseconds before returning. More... | |
DECLSPEC Uint64 SDLCALL | SDL_GetPerformanceCounter (void) |
Get the current value of the high resolution counter. More... | |
DECLSPEC Uint64 SDLCALL | SDL_GetPerformanceFrequency (void) |
Get the count per second of the high resolution counter. More... | |
DECLSPEC Uint32 SDLCALL | SDL_GetTicks (void) |
Get the number of milliseconds since the SDL library initialization. More... | |
DECLSPEC SDL_bool SDLCALL | SDL_RemoveTimer (SDL_TimerID id) |
Remove a timer knowing its ID. More... | |
typedef | Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval |
Header for the SDL time management routines.
Definition in file SDL_timer.h.
Definition at line 70 of file SDL_timer.h.
typedef int SDL_TimerID |
Definition of the timer ID type.
Definition at line 75 of file SDL_timer.h.
DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer | ( | Uint32 | interval, |
SDL_TimerCallback | callback, | ||
void * | param | ||
) |
Add a new timer to the pool of timers already running.
Definition at line 284 of file SDL_timer.c.
References SDL_AtomicIncRef, SDL_AtomicLock(), SDL_AtomicUnlock(), SDL_FALSE, SDL_free(), SDL_GetTicks(), SDL_LockMutex(), SDL_malloc(), SDL_OutOfMemory, SDL_RemoveTimer(), SDL_SemPost(), SDL_timer_data, SDL_TimerInit(), and SDL_UnlockMutex().
Referenced by SDLTest_SetTestTimeout().
Wait a specified number of milliseconds before returning.
Definition at line 70 of file SDL_systimer.c.
Referenced by Zeni::Video_GL_Fixed::end_render(), Zeni::Video_GL_Shader::end_render(), FullscreenTo(), Zeni::Popup_Pause_State::perform_logic(), SDL_AtomicLock(), SDL_DestroySemaphore(), SDL_RunAudio(), SDL_SemWaitTimeout(), and SDL_WaitEventTimeout().
Get the current value of the high resolution counter.
Definition at line 59 of file SDL_systimer.c.
References SDL_GetTicks().
Get the count per second of the high resolution counter.
Definition at line 65 of file SDL_systimer.c.
Get the number of milliseconds since the SDL library initialization.
Definition at line 44 of file SDL_systimer.c.
References NULL, SDL_InitTicks(), and ticks_started.
Referenced by SDL_AddTimer(), SDL_GetPerformanceCounter(), SDL_PushEvent(), SDL_SemWaitTimeout(), SDL_TimerThread(), and SDL_WaitEventTimeout().
DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer | ( | SDL_TimerID | id | ) |
Remove a timer knowing its ID.
Definition at line 354 of file SDL_timer.c.
References NULL, SDL_FALSE, SDL_free(), SDL_LockMutex(), SDL_timer_data, SDL_TRUE, and SDL_UnlockMutex().
Referenced by SDL_AddTimer(), and SDLTest_RunTest().
Function prototype for the timer callback function.
The callback function is passed the current timer interval and returns the next timer interval. If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled. If the callback returns 0, the periodic alarm is cancelled.