home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_SetVideoMode.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  4.6 KB  |  125 lines

  1. <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
  2. <!-- available at http://polyglotman.sourceforge.net/ -->
  3.  
  4. <html>
  5. <head>
  6. <title>"SDL_SetVideoMode"("3") manual page</title>
  7. </head>
  8. <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
  9. <a href='#toc'>Table of Contents</a><p>
  10.  
  11. <h2><a name='sect0' href='#toc0'>Name</a></h2>
  12. SDL_SetVideoMode- Set up a video mode with the specified width, height
  13. and bits-per-pixel. 
  14. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  15. <p>
  16. <b>#include "SDL.h" <p>
  17. </b><b>SDL_Surface *<b>SDL_SetVideoMode</b></b>(<b>int
  18. width, int height, int bpp, Uint32 flags</b>); 
  19. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  20. <p>
  21. Set up a video mode
  22. with the specified width, height and bits-per-pixel. <p>
  23. If <b>bpp</b> is 0, it is treated
  24. as the current display bits per pixel. <p>
  25. The <b>flags</b> parameter is the same as
  26. the <b>flags</b> field of the <i><b>SDL_Surface</b></i> structure. OR'd combinations of the following
  27. values are valid. 
  28. <dl>
  29.  
  30. <dt><b>SDL_SWSURFACE</b> </dt>
  31. <dd>Create the video surface in system memory
  32. </dd>
  33.  
  34. <dt><b>SDL_HWSURFACE</b> </dt>
  35. <dd>Create the video surface in video memory </dd>
  36.  
  37. <dt><b>SDL_ASYNCBLIT</b> </dt>
  38. <dd>Enables
  39. the use of asynchronous updates of the display surface. This will usually
  40. slow down blitting on single CPU machines, but may provide a speed increase
  41. on SMP systems. </dd>
  42.  
  43. <dt><b>SDL_ANYFORMAT</b> </dt>
  44. <dd>Normally, if a video surface of the requested
  45. bits-per-pixel (<b>bpp</b>) is not available, SDL will emulate one with a shadow
  46. surface. Passing <b>SDL_ANYFORMAT</b> prevents this and causes SDL to use the video
  47. surface, regardless of its pixel depth. </dd>
  48.  
  49. <dt><b>SDL_HWPALETTE</b> </dt>
  50. <dd>Give SDL exclusive
  51. palette access. Without this flag you may not always get the the colors
  52. you request with <i><b>SDL_SetColors</b></i> or <i><b>SDL_SetPalette</b></i>. </dd>
  53.  
  54. <dt><b>SDL_DOUBLEBUF</b> </dt>
  55. <dd>Enable hardware
  56. double buffering; only valid with SDL_HWSURFACE. Calling <i><b>SDL_Flip</b></i> will flip
  57. the buffers and update the screen. All drawing will take place on the surface
  58. that is not displayed at the moment. If double buffering could not be enabled
  59. then <b>SDL_Flip</b> will just perform a <i><b>SDL_UpdateRect</b></i> on the entire screen. </dd>
  60.  
  61. <dt><b>SDL_FULLSCREEN</b>
  62. </dt>
  63. <dd>SDL will attempt to use a fullscreen mode. If a hardware resolution change
  64. is not possible (for whatever reason), the next higher resolution will
  65. be used and the display window centered on a black background. </dd>
  66.  
  67. <dt><b>SDL_OPENGL</b>
  68. </dt>
  69. <dd>Create an OpenGL rendering context. You should have previously set OpenGL
  70. video attributes with <i><b>SDL_GL_SetAttribute</b></i>. </dd>
  71.  
  72. <dt><b>SDL_OPENGLBLIT</b> </dt>
  73. <dd>Create an OpenGL
  74. rendering context, like above, but allow normal blitting operations. The
  75. <a href='screen.2.html'>screen (2D)</a>
  76.  surface may have an alpha channel, and <i><b>SDL_UpdateRects</b></i> must
  77. be used for updating changes to the screen surface. </dd>
  78.  
  79. <dt><b>SDL_RESIZABLE</b> </dt>
  80. <dd>Create
  81. a resizable window. When the window is resized by the user a <i><b>SDL_VIDEORESIZE</b></i>
  82. event is generated and <b>SDL_SetVideoMode</b> can be called again with the new
  83. size. </dd>
  84.  
  85. <dt><b>SDL_NOFRAME</b> </dt>
  86. <dd>If possible, <b>SDL_NOFRAME</b> causes SDL to create a window
  87. with no title bar or frame decoration. Fullscreen modes automatically have
  88. this flag set. </dd>
  89. </dl>
  90. <p>
  91. <blockquote><b>Note:   <p>
  92. Whatever <b>flags</b></b> <b>SDL_SetVideoMode</b> could satisfy are
  93. set in the <b>flags</b> member of the returned surface. </blockquote>
  94. <p>
  95. <blockquote><b>Note:   <p>
  96. The <b>bpp</b></b> parameter
  97. is the number of bits per pixel, so a <b>bpp</b> of 24 uses the packed representation
  98. of 3 bytes/pixel. For the more common 4 bytes/pixel mode, use a <b>bpp</b> of 32.
  99. Somewhat oddly, both 15 and 16 will request a 2 bytes/pixel mode, but different
  100. pixel formats. </blockquote>
  101.  
  102. <h2><a name='sect3' href='#toc3'>Return Value</a></h2>
  103. <p>
  104. The framebuffer surface, or <b>NULL</b> if it fails.
  105. The surface returned is freed by SDL_Quit() and should nt be freed by the
  106. caller. 
  107. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  108. <p>
  109. <i><b>SDL_LockSurface</b></i>, <i><b>SDL_SetColors</b></i>, <i><b>SDL_Flip</b></i>, <i><b>SDL_Surface</b></i> 
  110. <!--
  111.   
  112.  <p>
  113.  
  114. <hr><p>
  115. <a name='toc'><b>Table of Contents</b></a><p>
  116. <ul>
  117. <li><a name='toc0' href='#sect0'>Name</a></li>
  118. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  119. <li><a name='toc2' href='#sect2'>Description</a></li>
  120. <li><a name='toc3' href='#sect3'>Return Value</a></li>
  121. <li><a name='toc4' href='#sect4'>See Also</a></li>
  122. </ul>
  123. </body>
  124. </html>
  125.