update
[sdlgit/SDL-Site.git] / pages / SDL-Video.html-inc
index 2333e0e..107b2a9 100644 (file)
 <li><a href="#list_modes_formats_flags">list_modes(formats,flags)</a></li>
 <li><a href="#video_mode_ok_width_height_bpp_flags">video_mode_ok(width,height,bpp,flags)</a></li>
 <li><a href="#set_video_mode_width_height_bpp_flag">set_video_mode(width,height,bpp,flags)</a>
-<ul>
-<li>
 <ul><li><a href="#List_of_avalaibles_flags">List of avalaibles flags</a></li>
 </ul>
 </li>
-</ul>
-</li>
 <li><a href="#update_rect_surface_x_y_width_height">update_rect(surface,x,y,width,height)</a></li>
 <li><a href="#update_rects_surface_rects">update_rects(surface,rects) </a></li>
 <li><a href="#flip_surface">flip(surface)</a></li>
@@ -122,36 +118,67 @@ It returns 0 if the mode is not supported at all, or the suggested bpp.</p>
 set_video_mode returns a SDL::Surface on succés or it returns undef on error, the error message is retrieved using <code>SDL::get_error</code>.</p>
 
 </div>
-<h4 id="List_of_avalaibles_flags">List of avalaibles flags</h4>
+<h3 id="List_of_avalaibles_flags">List of avalaibles flags</h3>
 <div id="List_of_avalaibles_flags_CONTENT">
-<pre>
-
-
-       SDL_SWSURFACE   Create the video surface in system memory
-       SDL_HWSURFACE   Create the video surface in video memory
-       SDL_ASYNCBLIT   Enables the use of asynchronous updates of the display surface. 
-                       This will usually slow down blitting on single CPU machines, but may provide a speed increase on SMP systems.
-       SDL_ANYFORMAT   Normally, if a video surface of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface.
-                       Passing SDL_ANYFORMAT prevents this and causes SDL to use the video surface, regardless of its pixel depth.
-       SDL_HWPALETTE   Give SDL exclusive palette access. Without this flag you may not always get the colors you request with SDL::set_colors or SDL::set_palette.
-       SDL_DOUBLEBUF   Enable hardware double buffering; only valid with SDL_HWSURFACE. Calling SDL::flip will flip the buffers and update the screen. 
-                       All drawing will take place on the surface that is not displayed at the moment. 
-                       If double buffering could not be enabled then SDL_Flip will just perform a SDL::update_rect on the entire screen.
-       SDL_FULLSCREEN  SDL will attempt to use a fullscreen mode. If a hardware resolution change is not possible (for whatever reason), 
-                       the next higher resolution will be used and the display window centered on a black background.
-       SDL_OPENGL      Create an OpenGL rendering context. You should have previously set OpenGL video attributes with SDL::gl_setattribute.
-       SDL_OPENGLBLIT  Create an OpenGL rendering context, like above, but allow normal blitting operations. 
-                       The screen (2D) surface may have an alpha channel, and SDL::update_rects must be used for updating changes to the screen surface. 
-                       NOTE: This option is kept for compatibility only, and will be removed in next versions. Is not recommended for new code.
-       SDL_RESIZABLE   Create a resizable window. 
-                       When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL::set_video_mode  can be called again with the new size.
-       SDL_NOFRAME     If possible, SDL_NOFRAME causes SDL to create a window with no title bar or frame decoration. 
-                       Fullscreen modes automatically have this flag set.
-
-
-
-
-</pre>
+<dl>
+       <dt>SDL_SWSURFACE</dt>
+       <dd>
+               <p>Create the video surface in system memory</p>
+       </dd>
+       <dt>SDL_HWSURFACE</dt>
+       <dd>
+               <p>Create the video surface in video memory</p>
+       </dd>
+       <dt>SDL_ASYNCBLIT</dt>
+       <dd>
+               <p>Enables the use of asynchronous updates of the display surface. 
+This will usually slow down blitting on single CPU machines, but may provide a speed increase on SMP systems.</p>
+       </dd>
+       <dt>SDL_ANYFORMAT</dt>
+       <dd>
+               <p>Normally, if a video surface of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface.
+Passing SDL_ANYFORMAT prevents this and causes SDL to use the video surface, regardless of its pixel depth.</p>
+       </dd>
+       <dt>SDL_HWPALETTE</dt>
+       <dd>
+               <p>Give SDL exclusive palette access. Without this flag you may not always get the colors you request with SDL::set_colors or SDL::set_palette.</p>
+       </dd>
+       <dt>SDL_DOUBLEBUF</dt>
+       <dd>
+               <p>Enable hardware double buffering; only valid with SDL_HWSURFACE. Calling SDL::flip will flip the buffers and update the screen. 
+All drawing will take place on the surface that is not displayed at the moment. 
+If double buffering could not be enabled then SDL_Flip will just perform a SDL::update_rect on the entire screen.</p>
+       </dd>
+       <dt>SDL_FULLSCREEN</dt>
+       <dd>
+               <p>SDL will attempt to use a fullscreen mode. If a hardware resolution change is not possible (for whatever reason), 
+the next higher resolution will be used and the display window centered on a black background.</p>
+       </dd>
+       <dt>SDL_OPENGL</dt>
+       <dd>
+               <p>Create an OpenGL rendering context. You should have previously set OpenGL video attributes with SDL::gl_setattribute.</p>
+       </dd>
+       <dt>SDL_OPENGLBLIT</dt>
+       <dd>
+               <p>Create an OpenGL rendering context, like above, but allow normal blitting operations. 
+The screen (2D) surface may have an alpha channel, and SDL::update_rects must be used for updating changes to the screen surface. 
+NOTE: This option is kept for compatibility only, and will be removed in next versions. Is not recommended for new code.</p>
+       </dd>
+       <dt>SDL_RESIZABLE</dt>
+       <dd>
+               <p>Create a resizable window. 
+When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL::set_video_mode  can be called again with the new size.</p>
+
+
+
+
+       </dd>
+       <dt>SDL_NOFRAME</dt>
+       <dd>
+               <p>If possible, SDL_NOFRAME causes SDL to create a window with no title bar or frame decoration. 
+Fullscreen modes automatically have this flag set.</p>
+       </dd>
+</dl>
 <p>Note 1: Use SDL_SWSURFACE if you plan on doing per-pixel manipulations, or blit surfaces with alpha channels, and require a high framerate. When you use hardware surfaces (by passing the flag SDL_HWSURFACE as parameter), SDL copies the surfaces from video memory to system memory when you lock them, and back when you unlock them. This can cause a major performance hit. Be aware that you may request a hardware surface, but receive a software surface because the video driver doesn't support hardware surface. Many platforms can only provide a hardware surface when using SDL_FULLSCREEN. The SDL_HWSURFACE flag is best used when the surfaces you'll be blitting can also be stored in video memory.</p>
 <p>Note 2: If you want to control the position on the screen when creating a windowed surface, you may do so by setting the environment variables SDL_VIDEO_CENTERED=center or SDL_VIDEO_WINDOW_POS=x,y. You can also set them via <code>SDL::putenv</code>.</p>
 <p>Note 3: This function should be called in the main thread of your application.</p>
@@ -284,27 +311,37 @@ This function uses the entire 8-bit [0..255] range when converting color compone
 <p>Creates an empty SDL::Surface from pixel data
 Allocate an empty surface (must be called after SDL::set_video_mode)
 If bitsPerPixel is 8 an empty palette is allocated for the surface, otherwise a 'packed-pixel' SDL::pixel_format is created using the [RGBA]mask's provided (see SDL::pixel_format). The flags specifies the type of surface that should be created, it is an OR'd combination of the following possible values. </p>
-<pre>  SDL_SWSURFACE   SDL will create the surface in system memory. 
-                       This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.
-
-       SDL_HWSURFACE   SDL will attempt to create the surface in video memory. 
-                       This will allow SDL to take advantage of Video-&gt;Video blits (which are often accelerated).
-
-       SDL_SRCCOLORKEY This flag turns on color keying for blits from this surface. 
-                       If SDL_HWSURFACE is also specified and color keyed blits are hardware-accelerated, then SDL will attempt to place the surface in video memory.
-                       If the screen is a hardware surface and color keyed blits are hardware-accelerated then the SDL_HWSURFACE flag will be set. 
-                       Use SDL_SetColorKey to set or clear this flag after surface creation.
-
-       SDL_SRCALPHA    This flag turns on alpha-blending for blits from this surface. 
-                       If SDL_HWSURFACE is also specified and alpha-blending blits are hardware-accelerated, 
-                       then the surface will be placed in video memory if possible. 
-                       If the screen is a hardware surface and alpha-blending blits are hardware-accelerated then the SDL_HWSURFACE flag will be set. 
-                       Use SDL_SetAlpha to set or clear this flag after surface creation.
+<dl>
+       <dt>SDL_SWSURFACE</dt>
+       <dd>
+               <p>SDL will create the surface in system memory. 
+This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.</p>
+       </dd>
+       <dt>SDL_HWSURFACE</dt>
+       <dd>
+               <p>SDL will attempt to create the surface in video memory. 
+This will allow SDL to take advantage of Video-&gt;Video blits (which are often accelerated).</p>
+       </dd>
+       <dt>SDL_SRCCOLORKEY</dt>
+       <dd>
+               <p>This flag turns on color keying for blits from this surface. 
+If SDL_HWSURFACE is also specified and color keyed blits are hardware-accelerated, then SDL will attempt to place the surface in video memory.
+If the screen is a hardware surface and color keyed blits are hardware-accelerated then the SDL_HWSURFACE flag will be set. 
+Use SDL_SetColorKey to set or clear this flag after surface creation.</p>
+       </dd>
+       <dt>SDL_SRCALPHA</dt>
+       <dd>
+               <p>This flag turns on alpha-blending for blits from this surface. 
+If SDL_HWSURFACE is also specified and alpha-blending blits are hardware-accelerated, 
+then the surface will be placed in video memory if possible. 
+If the screen is a hardware surface and alpha-blending blits are hardware-accelerated then the SDL_HWSURFACE flag will be set. 
+Use SDL_SetAlpha to set or clear this flag after surface creation.</p>
+       </dd>
+</dl>
 
 
 
 
-</pre>
 <p>[RGBA]mask are the bitmasks used to extract that colour from a pixel.
 For instance, Rmask being FF000000 means the red data is stored in the most significant byte. 
 Using zeros for the RGB masks sets a default value, based on the depth. (e.g. SDL::create_RGB_surface(flags,w,h,32,0,0,0,0);).
@@ -401,35 +438,49 @@ If SDL_SRCALPHA is not passed as a flag then all alpha information is ignored wh
 The alpha parameter is the per-surface alpha value; a surface need not have an alpha channel to use per-surface alpha and blitting can still be accelerated with SDL_RLEACCEL.</p>
 <p>Note: The per-surface alpha value of 128 is considered a special case and is optimised, so it's much faster than other per-surface values.</p>
 <p>Alpha affects surface blitting in the following ways: </p>
-<pre>  RGBA-&gt;RGB with SDL_SRCALPHA  The source is alpha-blended with the destination, using the alpha channel. 
-                                       SDL_SRCCOLORKEY and the per-surface alpha are ignored.
-
-       RGBA-&gt;RGB without SDL_SRCALPHA       The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored. 
-                                       If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
-
-       RGB-&gt;RGBA with SDL_SRCALPHA  The source is alpha-blended with the destination using the per-surface alpha value. 
-                                       If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied. 
-                                       The alpha channel of the copied pixels is set to opaque.
-
-       RGB-&gt;RGBA without SDL_SRCALPHA       The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque. 
-                                       If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
-
-       RGBA-&gt;RGBA with SDL_SRCALPHA The source is alpha-blended with the destination using the source alpha channel. 
-                                       The alpha channel in the destination surface is left untouched. SDL_SRCCOLORKEY is ignored.
-
-       RGBA-&gt;RGBA without SDL_SRCALPHA      The RGBA data is copied to the destination surface.
-                                        If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
-
-       RGB-&gt;RGB with SDL_SRCALPHA   The source is alpha-blended with the destination using the per-surface alpha value. 
-                                       If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
-
-       RGB-&gt;RGB without SDL_SRCALPHA        The RGB data is copied from the source. 
-                                       If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
-
-
-
-
-</pre>
+<dl>
+       <dt>RGBA-&gt;RGB with SDL_SRCALPHA</dt>
+       <dd>
+               <p>The source is alpha-blended with the destination, using the alpha channel. 
+SDL_SRCCOLORKEY and the per-surface alpha are ignored.</p>
+       </dd>
+       <dt>RGBA-&gt;RGB without SDL_SRCALPHA</dt>
+       <dd>
+               <p>The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored. 
+If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.</p>
+       </dd>
+       <dt>RGB-&gt;RGBA with SDL_SRCALPHA</dt>
+       <dd>
+               <p>The source is alpha-blended with the destination using the per-surface alpha value. 
+If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied. 
+The alpha channel of the copied pixels is set to opaque.</p>
+       </dd>
+       <dt>RGB-&gt;RGBA without SDL_SRCALPHA</dt>
+       <dd>
+               <p>The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque. 
+If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.</p>
+       </dd>
+       <dt>RGBA-&gt;RGBA with SDL_SRCALPHA</dt>
+       <dd>
+               <p>The source is alpha-blended with the destination using the source alpha channel. 
+The alpha channel in the destination surface is left untouched. SDL_SRCCOLORKEY is ignored.</p>
+       </dd>
+       <dt>RGBA-&gt;RGBA without SDL_SRCALPHA</dt>
+       <dd>
+               <p>The RGBA data is copied to the destination surface.
+If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.</p>
+       </dd>
+       <dt>RGB-&gt;RGB with SDL_SRCALPHA</dt>
+       <dd>
+               <p>The source is alpha-blended with the destination using the per-surface alpha value. 
+If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.</p>
+       </dd>
+       <dt>RGB-&gt;RGB without SDL_SRCALPHA</dt>
+       <dd>
+               <p>The RGB data is copied from the source. 
+If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.</p>
+       </dd>
+</dl>
 <p>Note: When blitting, the presence or absence of SDL_SRCALPHA is relevant only on the source surface, not the destination.
 Note: Note that RGBA-&gt;RGBA blits (with SDL_SRCALPHA set) keep the alpha of the destination surface. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from &quot;overlaying&quot; them; the destination alpha will work as a mask.</p>
 <p>Note: Also note that per-pixel and per-surface alpha cannot be combined; the per-pixel alpha is always used if available. </p>
@@ -527,10 +578,8 @@ It returns 0 on succés or -1 on error.</p>
 </div>
 <h2 id="unlock_YUV_overlay_overlay">unlock_YUV_overlay(overlay)</h2>
 <div id="unlock_YUV_overlay_overlay_CONTENT">
-<p>The opposite to <code>SDL::lock_YUV_overlay. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed. 
-It returns 0 on succés or -1 on error.
-
-</code></p>
+<p>The opposite to <code>SDL::lock_YUV_overlay</code>. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed. 
+It returns 0 on succés or -1 on error.</p>
 
 </div>
 <h2 id="display_YUV_overlay_overlay_dstrect">display_YUV_overlay(overlay,dstrect)</h2>