comparison docs/html/sdlsetvideomode.html @ 181:e5bc29de3f0a

Updated from the SDL Documentation Project
author Sam Lantinga <slouken@libsdl.org>
date Fri, 14 Sep 2001 02:41:09 +0000
parents 55f1f1b3e27d
children 355632dca928
comparison
equal deleted inserted replaced
180:578815880307 181:e5bc29de3f0a
71 >SDL_SetVideoMode</A 71 >SDL_SetVideoMode</A
72 ></H1 72 ></H1
73 ><DIV 73 ><DIV
74 CLASS="REFNAMEDIV" 74 CLASS="REFNAMEDIV"
75 ><A 75 ><A
76 NAME="AEN834" 76 NAME="AEN856"
77 ></A 77 ></A
78 ><H2 78 ><H2
79 >Name</H2 79 >Name</H2
80 >SDL_SetVideoMode&nbsp;--&nbsp;Set up a video mode with the specified width, height and bits-per-pixel.</DIV 80 >SDL_SetVideoMode&nbsp;--&nbsp;Set up a video mode with the specified width, height and bits-per-pixel.</DIV
81 ><DIV 81 ><DIV
82 CLASS="REFSYNOPSISDIV" 82 CLASS="REFSYNOPSISDIV"
83 ><A 83 ><A
84 NAME="AEN837" 84 NAME="AEN859"
85 ></A 85 ></A
86 ><H2 86 ><H2
87 >Synopsis</H2 87 >Synopsis</H2
88 ><DIV 88 ><DIV
89 CLASS="FUNCSYNOPSIS" 89 CLASS="FUNCSYNOPSIS"
90 ><A 90 ><A
91 NAME="AEN838" 91 NAME="AEN860"
92 ></A 92 ></A
93 ><P 93 ><P
94 ></P 94 ></P
95 ><PRE 95 ><PRE
96 CLASS="FUNCSYNOPSISINFO" 96 CLASS="FUNCSYNOPSISINFO"
110 ></DIV 110 ></DIV
111 ></DIV 111 ></DIV
112 ><DIV 112 ><DIV
113 CLASS="REFSECT1" 113 CLASS="REFSECT1"
114 ><A 114 ><A
115 NAME="AEN844" 115 NAME="AEN866"
116 ></A 116 ></A
117 ><H2 117 ><H2
118 >Description</H2 118 >Description</H2
119 ><P 119 ><P
120 >Set up a video mode with the specified width, height and bits-per-pixel.</P 120 >Set up a video mode with the specified width, height and bits-per-pixel.</P
145 ></A 145 ></A
146 > structure. OR'd combinations of the following values are valid.</P 146 > structure. OR'd combinations of the following values are valid.</P
147 ><DIV 147 ><DIV
148 CLASS="INFORMALTABLE" 148 CLASS="INFORMALTABLE"
149 ><A 149 ><A
150 NAME="AEN854" 150 NAME="AEN876"
151 ></A 151 ></A
152 ><P 152 ><P
153 ></P 153 ></P
154 ><TABLE 154 ><TABLE
155 BORDER="1" 155 BORDER="1"
190 >SDL_ASYNCBLIT</TT 190 >SDL_ASYNCBLIT</TT
191 ></TD 191 ></TD
192 ><TD 192 ><TD
193 ALIGN="LEFT" 193 ALIGN="LEFT"
194 VALIGN="TOP" 194 VALIGN="TOP"
195 >Enables the use of asynchronous to the display surface. This will usually slow down blitting on single CPU machines, but may provide a speed increase on SMP systems.</TD 195 >Enables the use of asynchronous updates of the display surface. This will
196 usually slow down blitting on single CPU machines, but may provide a speed
197 increase on SMP systems.</TD
196 ></TR 198 ></TR
197 ><TR 199 ><TR
198 ><TD 200 ><TD
199 ALIGN="LEFT" 201 ALIGN="LEFT"
200 VALIGN="TOP" 202 VALIGN="TOP"
203 >SDL_ANYFORMAT</TT 205 >SDL_ANYFORMAT</TT
204 ></TD 206 ></TD
205 ><TD 207 ><TD
206 ALIGN="LEFT" 208 ALIGN="LEFT"
207 VALIGN="TOP" 209 VALIGN="TOP"
208 >Normally, if a video surface of the requested depth (<TT 210 >Normally, if a video surface of the requested bits-per-pixel (<TT
209 CLASS="PARAMETER" 211 CLASS="PARAMETER"
210 ><I 212 ><I
211 >bpp</I 213 >bpp</I
212 ></TT 214 ></TT
213 >) is not available, SDL will emulate one with a shadow surface. Passing <TT 215 >) is not available, SDL will emulate one with a shadow surface. Passing <TT
214 CLASS="LITERAL" 216 CLASS="LITERAL"
215 >SDL_ANYFORMAT</TT 217 >SDL_ANYFORMAT</TT
216 > prevents this and causes SDL to use the video surface, regardless of its depth.</TD 218 > prevents this and causes SDL to use the video surface, regardless of its pixel depth.</TD
217 ></TR 219 ></TR
218 ><TR 220 ><TR
219 ><TD 221 ><TD
220 ALIGN="LEFT" 222 ALIGN="LEFT"
221 VALIGN="TOP" 223 VALIGN="TOP"
230 HREF="sdlsetcolors.html" 232 HREF="sdlsetcolors.html"
231 ><TT 233 ><TT
232 CLASS="FUNCTION" 234 CLASS="FUNCTION"
233 >SDL_SetColors</TT 235 >SDL_SetColors</TT
234 ></A 236 ></A
237 > or <A
238 HREF="sdlsetpalette.html"
239 ><TT
240 CLASS="FUNCTION"
241 >SDL_SetPalette</TT
242 ></A
235 >.</TD 243 >.</TD
236 ></TR 244 ></TR
237 ><TR 245 ><TR
238 ><TD 246 ><TD
239 ALIGN="LEFT" 247 ALIGN="LEFT"
243 >SDL_DOUBLEBUF</TT 251 >SDL_DOUBLEBUF</TT
244 ></TD 252 ></TD
245 ><TD 253 ><TD
246 ALIGN="LEFT" 254 ALIGN="LEFT"
247 VALIGN="TOP" 255 VALIGN="TOP"
248 >Enable double buffering; only valid with SDL_HWSURFACE. Calling <A 256 >Enable hardware double buffering; only valid with SDL_HWSURFACE. Calling
257 <A
249 HREF="sdlflip.html" 258 HREF="sdlflip.html"
250 ><TT 259 ><TT
251 CLASS="FUNCTION" 260 CLASS="FUNCTION"
252 >SDL_Flip</TT 261 >SDL_Flip</TT
253 ></A 262 ></A
254 > will flip the buffers and update the screen. If double buffering could not be enabled then <TT 263 > will flip the
264 buffers and update the screen. All drawing will take place on the surface
265 that is not displayed at the moment. If double buffering could not be enabled
266 then <TT
255 CLASS="FUNCTION" 267 CLASS="FUNCTION"
256 >SDL_Flip</TT 268 >SDL_Flip</TT
257 > will just perform a <A 269 > will just perform a
270 <A
258 HREF="sdlupdaterect.html" 271 HREF="sdlupdaterect.html"
259 ><TT 272 ><TT
260 CLASS="FUNCTION" 273 CLASS="FUNCTION"
261 >SDL_UpdateRect</TT 274 >SDL_UpdateRect</TT
262 ></A 275 ></A
263 > on the entire screen.</TD 276 >
277 on the entire screen.</TD
264 ></TR 278 ></TR
265 ><TR 279 ><TR
266 ><TD 280 ><TD
267 ALIGN="LEFT" 281 ALIGN="LEFT"
268 VALIGN="TOP" 282 VALIGN="TOP"
271 >SDL_FULLSCREEN</TT 285 >SDL_FULLSCREEN</TT
272 ></TD 286 ></TD
273 ><TD 287 ><TD
274 ALIGN="LEFT" 288 ALIGN="LEFT"
275 VALIGN="TOP" 289 VALIGN="TOP"
276 >SDL will attempt to use a fullscreen mode</TD 290 >SDL will attempt to use a fullscreen mode. If a hardware resolution change is
291 not possible (for whatever reason), the next higher resolution will be used and
292 the display window centered on a black background.</TD
277 ></TR 293 ></TR
278 ><TR 294 ><TR
279 ><TD 295 ><TD
280 ALIGN="LEFT" 296 ALIGN="LEFT"
281 VALIGN="TOP" 297 VALIGN="TOP"
303 >SDL_OPENGLBLIT</TT 319 >SDL_OPENGLBLIT</TT
304 ></TD 320 ></TD
305 ><TD 321 ><TD
306 ALIGN="LEFT" 322 ALIGN="LEFT"
307 VALIGN="TOP" 323 VALIGN="TOP"
308 >Create an OpenGL rendering context, like above, but allow normal blitting operations.</TD 324 >Create an OpenGL rendering context, like above, but allow normal blitting
325 operations. The screen (2D) surface may have an alpha channel, and
326 <A
327 HREF="sdlupdaterects.html"
328 ><TT
329 CLASS="FUNCTION"
330 >SDL_UpdateRects</TT
331 ></A
332 >
333 must be used for updating changes to the screen surface.</TD
309 ></TR 334 ></TR
310 ><TR 335 ><TR
311 ><TD 336 ><TD
312 ALIGN="LEFT" 337 ALIGN="LEFT"
313 VALIGN="TOP" 338 VALIGN="TOP"
371 >flags</I 396 >flags</I
372 ></TT 397 ></TT
373 > member of the returned surface.</P 398 > member of the returned surface.</P
374 ></BLOCKQUOTE 399 ></BLOCKQUOTE
375 ></DIV 400 ></DIV
401 ><DIV
402 CLASS="NOTE"
403 ><BLOCKQUOTE
404 CLASS="NOTE"
405 ><P
406 ><B
407 >Note: </B
408 >The <TT
409 CLASS="PARAMETER"
410 ><I
411 >bpp</I
412 ></TT
413 > parameter is the number of bits per pixel,
414 so a <TT
415 CLASS="PARAMETER"
416 ><I
417 >bpp</I
418 ></TT
419 > of 24 uses the packed representation of
420 3 bytes/pixel. For the more common 4 bytes/pixel mode, use a
421 <TT
422 CLASS="PARAMETER"
423 ><I
424 >bpp</I
425 ></TT
426 > of 32. Somewhat oddly, both 15 and 16 will
427 request a 2 bytes/pixel mode, but different pixel formats.</P
428 ></BLOCKQUOTE
429 ></DIV
376 ></DIV 430 ></DIV
377 ><DIV 431 ><DIV
378 CLASS="REFSECT1" 432 CLASS="REFSECT1"
379 ><A 433 ><A
380 NAME="AEN921" 434 NAME="AEN952"
381 ></A 435 ></A
382 ><H2 436 ><H2
383 >Return Value</H2 437 >Return Value</H2
384 ><P 438 ><P
385 >The framebuffer surface, or <SPAN 439 >The framebuffer surface, or <SPAN
386 CLASS="RETURNVALUE" 440 CLASS="RETURNVALUE"
387 >NULL</SPAN 441 >NULL</SPAN
388 > if it fails.</P 442 > if it fails.
443 The surface returned is freed by SDL_Quit() and should nt be freed by
444 the caller.</P
389 ></DIV 445 ></DIV
390 ><DIV 446 ><DIV
391 CLASS="REFSECT1" 447 CLASS="REFSECT1"
392 ><A 448 ><A
393 NAME="AEN925" 449 NAME="AEN956"
394 ></A 450 ></A
395 ><H2 451 ><H2
396 >See Also</H2 452 >See Also</H2
397 ><P 453 ><P
398 ><A 454 ><A