World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл SDL_timer.h

См. исходные тексты.

Определения типов

typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param)
 
typedef int SDL_TimerID
 

Функции

DECLSPEC Uint32 SDLCALL SDL_GetTicks (void)
 Get the number of milliseconds since the SDL library initialization. Подробнее...
 
DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter (void)
 Get the current value of the high resolution counter. Подробнее...
 
DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency (void)
 Get the count per second of the high resolution counter. Подробнее...
 
DECLSPEC void SDLCALL SDL_Delay (Uint32 ms)
 Wait a specified number of milliseconds before returning. Подробнее...
 
DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer (Uint32 interval, SDL_TimerCallback callback, void *param)
 Add a new timer to the pool of timers already running. Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer (SDL_TimerID id)
 Remove a timer knowing its ID. Подробнее...
 

Подробное описание

Header for the SDL time management routines.

См. определение в файле SDL_timer.h

Типы

◆ SDL_TimerCallback

typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param)

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.

См. определение в файле SDL_timer.h строка 81

◆ SDL_TimerID

typedef int SDL_TimerID

Definition of the timer ID type.

См. определение в файле SDL_timer.h строка 86

Функции

◆ SDL_GetTicks()

DECLSPEC Uint32 SDLCALL SDL_GetTicks ( void  )

Get the number of milliseconds since the SDL library initialization.

Заметки
This value wraps if the program runs for more than ~49 days.

◆ SDL_GetPerformanceCounter()

DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter ( void  )

Get the current value of the high resolution counter.

◆ SDL_GetPerformanceFrequency()

DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency ( void  )

Get the count per second of the high resolution counter.

◆ SDL_Delay()

DECLSPEC void SDLCALL SDL_Delay ( Uint32  ms)

Wait a specified number of milliseconds before returning.

Используется в main().

+ Граф вызова функции:

◆ SDL_AddTimer()

DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer ( Uint32  interval,
SDL_TimerCallback  callback,
void param 
)

Add a new timer to the pool of timers already running.

Возвращает
A timer ID, or 0 when an error occurs.

◆ SDL_RemoveTimer()

DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer ( SDL_TimerID  id)

Remove a timer knowing its ID.

Возвращает
A boolean value indicating success or failure.
Предупреждения
It is not safe to remove a timer multiple times.