DEADSOFTWARE

moved to SDL2
[d2df-sdl.git] / src / lib / sdl2 / sdltimer.inc
1 //from "sdl_timer.h"
3 {**
4 * Get the number of milliseconds since the SDL library initialization.
5 *
6 * This value wraps if the program runs for more than ~49 days.
7 *}
8 function SDL_GetTicks: UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTicks' {$ENDIF} {$ENDIF};
10 {**
11 * Get the current value of the high resolution counter
12 *}
13 function SDL_GetPerformanceCounter: UInt64 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetPerformanceCounter' {$ENDIF} {$ENDIF};
15 {**
16 * Get the count per second of the high resolution counter
17 *}
18 function SDL_GetPerformanceFrequency: UInt64 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetPerformanceFrequency' {$ENDIF} {$ENDIF};
20 {**
21 * Wait a specified number of milliseconds before returning.
22 *}
23 procedure SDL_Delay(ms: UInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_Delay' {$ENDIF} {$ENDIF};
25 {**
26 * Function prototype for the timer callback function.
27 *
28 * The callback function is passed the current timer interval and returns
29 * the next timer interval. If the returned value is the same as the one
30 * passed in, the periodic alarm continues, otherwise a new alarm is
31 * scheduled. If the callback returns 0, the periodic alarm is cancelled.
32 *}
34 type
35 TSDL_TimerCallback = function(interval: UInt32; param: Pointer): UInt32; cdecl;
37 {**
38 * Definition of the timer ID type.
39 *}
40 TSDL_TimerID = SInt32;
42 {**
43 * Add a new timer to the pool of timers already running.
44 *
45 * A timer ID, or NULL when an error occurs.
46 *}
47 function SDL_AddTimer(interval: UInt32; callback: TSDL_TimerCallback; param: Pointer): TSDL_TimerID cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_AddTimer' {$ENDIF} {$ENDIF};
49 {**
50 * Remove a timer knowing its ID.
51 *
52 * A boolean value indicating success or failure.
53 *
54 * It is not safe to remove a timer multiple times.
55 *}
56 function SDL_RemoveTimer(id: TSDL_TimerID): Boolean cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RemoveTimer' {$ENDIF} {$ENDIF};
58 {**
59 * Compare SDL ticks values, and return true if A has passed B.
60 *}
61 function SDL_TICKS_PASSED(Const A, B:UInt32):Boolean;