Penguin
Blame: SDL_SetTimer(3)
EditPageHistoryDiffInfoLikePages
Annotated edit history of SDL_SetTimer(3) version 2 showing authors affecting page license. View with all changes included.
Rev Author # Line
1 perry 1 SDL_!SetTimer
2 !!!SDL_!SetTimer
3 NAME
4 SYNOPSIS
5 CALLBACK
6 DESCRIPTION
7 EXAMPLES
8 SEE ALSO
9 ----
10 !!NAME
11
12
13 SDL_!SetTimer- Set a callback to run after the specified number of milliseconds has elapsed.
14 !!SYNOPSIS
15
16
17 __#include __
18
19
20 __int SDL_!SetTimer__(__Uint32 interval,
21 SDL_!TimerCallback callback__);
22 !!CALLBACK
23
24
25 /* Function prototype for the timer callback function */
26 typedef Uint32 (*SDL_!TimerCallback)(Uint32
27 interval);
28 !!DESCRIPTION
29
30
31 Set a callback to run after the specified number of
32 milliseconds has elapsed. The callback function is passed
33 the current timer interval and returns the next timer
34 interval. If the returned value is the same as the one
35 passed in, the periodic alarm continues, otherwise a new
36 alarm is scheduled.
37
38
39 To cancel a currently running timer, call __SDL_!SetTimer(0,
40 NULL);__
41
42
43 The timer callback function may run in a different thread
44 than your main constant, and so shouldn't call any functions
45 from within itself.
46
47
48 The maximum resolution of this timer is 10 ms, which means
49 that if you request a 16 ms timer, your callback will run
50 approximately 20 ms later on an unloaded system. If you
51 wanted to set a flag signaling a frame update at 30 frames
52 per second (every 33 ms), you might set a timer for 30 ms
53 (see example below).
54
55
56 If you use this function, you need to pass
57 __SDL_INIT_TIMER__ to __SDL_Init()__.
58
59
60 __Note:__
61
62
63 This function is kept for compatibility but has been
64 superceeded by the new timer functions ''SDL_!AddTimer''
65 and ''SDL_!RemoveTimer'' which support multiple
66 timers.
67 !!EXAMPLES
68
69
70 SDL_!SetTimer((33/10)*10, my_callback);
71 !!SEE ALSO
72
73
74 __SDL_!AddTimer__
75 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.