Mercurial > sdl-ios-xcode
comparison docs/html/sdladdtimer.html @ 55:55f1f1b3e27d
Added new docs for SDL 1.2.1
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Sun, 10 Jun 2001 19:31:57 +0000 |
parents | 74212992fb08 |
children | e5bc29de3f0a |
comparison
equal
deleted
inserted
replaced
54:028447a8a758 | 55:55f1f1b3e27d |
---|---|
2 ><HEAD | 2 ><HEAD |
3 ><TITLE | 3 ><TITLE |
4 >SDL_AddTimer</TITLE | 4 >SDL_AddTimer</TITLE |
5 ><META | 5 ><META |
6 NAME="GENERATOR" | 6 NAME="GENERATOR" |
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.61 | 7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
8 "><LINK | 8 "><LINK |
9 REL="HOME" | 9 REL="HOME" |
10 TITLE="SDL Library Documentation" | 10 TITLE="SDL Library Documentation" |
11 HREF="index.html"><LINK | 11 HREF="index.html"><LINK |
12 REL="UP" | 12 REL="UP" |
71 >SDL_AddTimer</A | 71 >SDL_AddTimer</A |
72 ></H1 | 72 ></H1 |
73 ><DIV | 73 ><DIV |
74 CLASS="REFNAMEDIV" | 74 CLASS="REFNAMEDIV" |
75 ><A | 75 ><A |
76 NAME="AEN7854" | 76 NAME="AEN7933" |
77 ></A | 77 ></A |
78 ><H2 | 78 ><H2 |
79 >Name</H2 | 79 >Name</H2 |
80 >SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has | 80 >SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has |
81 elapsed.</DIV | 81 elapsed.</DIV |
82 ><DIV | 82 ><DIV |
83 CLASS="REFSYNOPSISDIV" | 83 CLASS="REFSYNOPSISDIV" |
84 ><A | 84 ><A |
85 NAME="AEN7857" | 85 NAME="AEN7936" |
86 ></A | 86 ></A |
87 ><H2 | 87 ><H2 |
88 >Synopsis</H2 | 88 >Synopsis</H2 |
89 ><DIV | 89 ><DIV |
90 CLASS="FUNCSYNOPSIS" | 90 CLASS="FUNCSYNOPSIS" |
91 ><A | 91 ><A |
92 NAME="AEN7858" | 92 NAME="AEN7937" |
93 ></A | 93 ></A |
94 ><P | 94 ><P |
95 ></P | 95 ></P |
96 ><PRE | 96 ><PRE |
97 CLASS="FUNCSYNOPSISINFO" | 97 CLASS="FUNCSYNOPSISINFO" |
123 typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);</PRE | 123 typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);</PRE |
124 ></DIV | 124 ></DIV |
125 ><DIV | 125 ><DIV |
126 CLASS="REFSECT1" | 126 CLASS="REFSECT1" |
127 ><A | 127 ><A |
128 NAME="AEN7867" | 128 NAME="AEN7946" |
129 ></A | 129 ></A |
130 ><H2 | 130 ><H2 |
131 >Description</H2 | 131 >Description</H2 |
132 ><P | 132 ><P |
133 >Adds a callback function to be run after the specified number of | 133 >Adds a callback function to be run after the specified number of |
151 CLASS="FUNCTION" | 151 CLASS="FUNCTION" |
152 >SDL_AddTimer</TT | 152 >SDL_AddTimer</TT |
153 >.</P | 153 >.</P |
154 ><P | 154 ><P |
155 >The timer callback function may run in a different thread than your | 155 >The timer callback function may run in a different thread than your |
156 main program, and so shouldn't call any functions from within itself.</P | 156 main program, and so shouldn't call any functions from within itself. |
157 ><P | 157 You may always call <A |
158 >The maximum resolution of this timer is 10 ms, which means that if | 158 HREF="sdlpushevent.html" |
159 >SDL_PushEvent</A | |
160 >, however.</P | |
161 ><P | |
162 >The granularity of the timer is platform-dependent, but you should count | |
163 on it being at least 10 ms as this is the most common number. | |
164 This means that if | |
159 you request a 16 ms timer, your callback will run approximately 20 ms | 165 you request a 16 ms timer, your callback will run approximately 20 ms |
160 later on an unloaded system. If you wanted to set a flag signaling | 166 later on an unloaded system. If you wanted to set a flag signaling |
161 a frame update at 30 frames per second (every 33 ms), you might set a | 167 a frame update at 30 frames per second (every 33 ms), you might set a |
162 timer for 30 ms (see example below). | 168 timer for 30 ms (see example below). |
163 | 169 |
171 >.</P | 177 >.</P |
172 ></DIV | 178 ></DIV |
173 ><DIV | 179 ><DIV |
174 CLASS="REFSECT1" | 180 CLASS="REFSECT1" |
175 ><A | 181 ><A |
176 NAME="AEN7878" | 182 NAME="AEN7958" |
177 ></A | 183 ></A |
178 ><H2 | 184 ><H2 |
179 >Return Value</H2 | 185 >Return Value</H2 |
180 ><P | 186 ><P |
181 >Returns an ID value for the added timer or | 187 >Returns an ID value for the added timer or |
185 > if there was an error.</P | 191 > if there was an error.</P |
186 ></DIV | 192 ></DIV |
187 ><DIV | 193 ><DIV |
188 CLASS="REFSECT1" | 194 CLASS="REFSECT1" |
189 ><A | 195 ><A |
190 NAME="AEN7882" | 196 NAME="AEN7962" |
191 ></A | 197 ></A |
192 ><H2 | 198 ><H2 |
193 >Examples</H2 | 199 >Examples</H2 |
194 ><P | 200 ><P |
195 ><PRE | 201 ><PRE |
198 ></P | 204 ></P |
199 ></DIV | 205 ></DIV |
200 ><DIV | 206 ><DIV |
201 CLASS="REFSECT1" | 207 CLASS="REFSECT1" |
202 ><A | 208 ><A |
203 NAME="AEN7886" | 209 NAME="AEN7966" |
204 ></A | 210 ></A |
205 ><H2 | 211 ><H2 |
206 >See Also</H2 | 212 >See Also</H2 |
207 ><P | 213 ><P |
208 ><A | 214 ><A |
209 HREF="sdlremovetimer.html" | 215 HREF="sdlremovetimer.html" |
210 ><TT | 216 ><TT |
211 CLASS="FUNCTION" | 217 CLASS="FUNCTION" |
212 >SDL_RemoveTimer</TT | 218 >SDL_RemoveTimer</TT |
219 ></A | |
220 >, | |
221 <A | |
222 HREF="sdlpushevent.html" | |
223 ><TT | |
224 CLASS="FUNCTION" | |
225 >SDL_PushEvent</TT | |
213 ></A | 226 ></A |
214 ></P | 227 ></P |
215 ></DIV | 228 ></DIV |
216 ><DIV | 229 ><DIV |
217 CLASS="NAVFOOTER" | 230 CLASS="NAVFOOTER" |