</div>
<h2 id="list_modes_formats_flags">list_modes(formats,flags)</h2>
<div id="list_modes_formats_flags_CONTENT">
-<pre> my @modes = @{ SDL::Video::list_modes($video_info->vfmt, SDL_NOFRAME) };
+<pre> my @modes = @{ SDL::Video::list_modes( $pixel_format, $flags ) };
</pre>
-<p>Returns a pointer to an array of available screen dimensions for the given format and video flags,
-or it return undef if no modes are avalaibles.</p>
+<p>Returns a ref to an array of available screen dimensions for the given format and video flags,
+or it return undef if no modes are available.</p>
<p>Example:</p>
<pre> use SDL;
use SDL::Video;
</div>
<h2 id="video_mode_ok_width_height_bpp_flags">video_mode_ok(width,height,bpp,flags)</h2>
<div id="video_mode_ok_width_height_bpp_flags-2">
-<p>Checks to see if a particular video mode of the given width,height,bpp and flags is supported.
-It returns 0 if the mode is not supported at all, or the suggested bpp.</p>
+<pre> my $bpp_ok = SDL::Video::video_mode_ok( $width, $height, $bpp, $flags );
+
+</pre>
+<p>This function is used to check whether the requested mode is supported by the current video device. The arguments passed to this function
+are the same as those you would pass to <a href="#set_video_mode_width_height_bpp_flag">SDL::Video::set_video_mode</a>.
+It returns <code>0</code> if the mode is not supported at all, otherwise the suggested <code>bpp</code>.</p>
+<p>Example:</p>
+<pre> use SDL;
+ use SDL::Video;
+
+ SDL::init(SDL_INIT_VIDEO);
+
+ my $video_mode_ok = SDL::Video::video_mode_ok( 800, 600, 32, SDL_SWSURFACE );
+
+ unless($video_mode_ok)
+ {
+ printf("this video mode ist not supported\n" );
+ }
+
+ SDL::quit();
+
+
+
+
+</pre>
</div>
<h2 id="set_video_mode_width_height_bpp_flag">set_video_mode(width,height,bpp,flags)</h2>
<pre> my $surface = SDL::Video::set_video_mode( 800, 600, 32, SDL_SWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN);
</pre>
-<p>Sets up a video mode with the specified width, height, bits-per-pixel and flags.
-<code>set_video_mode</code> returns a <a href="/SDL-Surface.html">SDL::Surface</a> on success or it returns undef on error, the error message is retrieved using <code>SDL::get_error</code>.</p>
+<p>Sets up a video mode with the specified width, height, bits-per-pixel and flags.
+<code>set_video_mode</code> returns a <a href="/SDL-Surface.html">SDL::Surface</a> on success otherwise it returns undef on error, the error message is retrieved
+using <code>SDL::get_error</code>.</p>
</div>
<h3 id="List_of_avalaibles_flags">List of avalaibles flags</h3>
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
+<p><strong>Note 1</strong>: Use <code>SDL_SWSURFACE</code> 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 <code>SDL_HWSURFACE</code> 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>
-<p>User note 1: Some have found that enabling OpenGL attributes like SDL_GL_STENCIL_SIZE (the stencil buffer size) before the video mode has
+when using <code>SDL_FULLSCREEN</code>. The <code>SDL_HWSURFACE</code> flag is best used when the surfaces you'll be blitting can also be stored in video memory.</p>
+<p><strong>Note 2</strong>: If you want to control the position on the screen when creating a windowed surface, you may do so by setting the environment
+variables <code>SDL_VIDEO_CENTERED=center</code> or <code>SDL_VIDEO_WINDOW_POS=x,y</code>. You can also set them via <code>SDL::putenv</code>.</p>
+<p><strong>Note 3</strong>: This function should be called in the main thread of your application.</p>
+<p><strong>User note 1</strong>: Some have found that enabling OpenGL attributes like <code>SDL_GL_STENCIL_SIZE</code> (the stencil buffer size) before the video mode has
been set causes the application to simply ignore those attributes, while enabling attributes after the video mode has been set works fine.</p>
-<p>User note 2: Also note that, in Windows, setting the video mode resets the current OpenGL context. You must execute again the OpenGL
+<p><strong>User note 2</strong>: Also note that, in Windows, setting the video mode resets the current OpenGL context. You must execute again the OpenGL
initialization code (set the clear color or the shade model, or reload textures, for example) after calling SDL::set_video_mode. In Linux,
-however, it works fine, and the initialization code only needs to be executed after the first call to SDL::set_video_mode (although there
-is no harm in executing the initialization code after each call to SDL::set_video_mode, for example for a multiplatform application). </p>
-
-
-
-
-
-
-
-
-
-
+however, it works fine, and the initialization code only needs to be executed after the first call to
+<a href="#set_video_mode_width_height_bpp_flag">SDL::Video::set_video_mode</a> (although there is no harm in executing the initialization code after
+each call to <a href="#set_video_mode_width_height_bpp_flag">SDL::Video::set_video_mode</a>, for example for a multiplatform application). </p>
</div>
<h2 id="update_rect_surface_x_y_width_height">update_rect(surface,x,y,width,height)</h2>
<div id="update_rect_surface_x_y_width_height-2">
+<pre> update_rect( $surface, $left, $top, $width, $height );
+
+</pre>
<p>Makes sure the given area is updated on the given screen.
The rectangle must be confined within the screen boundaries because there's no clipping.
update_rect doesn't returns any value.</p>
-<p>Note : This function should not be called while screen is locked by SDL::lock_surface
-Note2 : If x, y, width and height are all equal to 0, SDL_UpdateRect will update the entire screen. </p>
+<p><strong>Note</strong>: This function should not be called while screen is locked by <a href="#lock_surface_surface">SDL::Video::lock_surface</a></p>
+<p><strong>Note2</strong>: If <code>x</code>, <code>y</code>, <code>width</code> and <code>height</code> are all equal to 0, <code>update_rect</code> will update the entire screen. </p>
+<p>For an example see <a href="#SYNOPSIS">SYNOPSIS</a></p>
</div>
<h2 id="update_rects_surface_rects">update_rects(surface,rects) </h2>
<div id="update_rects_surface_rects_CONTENT">
+<pre> update_rects( $surface, @rects );
+
+</pre>
<p>Makes sure the given list of rectangles is updated on the given screen.
The rectangle must be confined within the screen boundaries because there's no clipping.
-update_rects doesn't returns any value.</p>
-<p>Note : This function should not be called while screen is locked by SDL::lock_surface</p>
+<code>update_rects</code> doesn't returns any value.</p>
+<p><strong>Note</strong>: This function should not be called while screen is locked by <a href="#lock_surface_surface">SDL::Video::lock_surface</a>.</p>
+<p>Example:</p>
+<pre> use SDL;
+ use SDL::Video;
+ use SDL::Surface;
+ use SDL::Rect;
+
+ # the size of the window box or the screen resolution if fullscreen
+ my $screen_width = 800;
+ my $screen_height = 600;
+
+ SDL::init(SDL_INIT_VIDEO);
+
+ # setting video mode
+ my $screen_surface = SDL::Video::set_video_mode($screen_width, $screen_height, 32, SDL_SWSURFACE);
+
+ # drawing the whole screen blue
+ my $mapped_color = SDL::Video::map_RGB($screen_surface->format(), 0, 0, 255); # blue
+ SDL::Video::fill_rect($screen_surface,
+ SDL::Rect->new(0, 0, $screen_width, $screen_height),
+ $mapped_color);
+
+ my @rects = ();
+ push(@rects, SDL::Rect->new(200, 0, 400, 600));
+ push(@rects, SDL::Rect->new( 0, 150, 800, 300));
+
+ # updating parts of the screen (should look like a cross)
+ SDL::Video::update_rects($screen_surface, @rects);
+
+ sleep(2);
+
+ SDL::quit();
+
+</pre>
</div>
<h2 id="flip_surface">flip(surface)</h2>
<li><a href="#quit">quit</a></li>
<li><a href="#was_init_flags">was_init(flags)</a></li>
<li><a href="#get_error">get_error()</a></li>
-<li><a href="#set_error_error_need_to_be_coded">set_error(error) *need to be coded</a></li>
+<li><a href="#set_error_real_error_values">set_error_real(error, @values) </a></li>
<li><a href="#error_code_need_to_be_coded">error(code) * need to be coded</a></li>
-<li><a href="#clear_error_need_to_be_coded">clear_error() * need to be coded</a></li>
+<li><a href="#clear_error">clear_error() </a></li>
<li><a href="#load_object">load_object()</a></li>
<li><a href="#load_function">load_function()</a></li>
<li><a href="#unload_object">unload_object()</a></li>
<li><a href="#delay_ms">delay(ms)</a></li>
</ul>
</li>
-<li><a href="#STUFF_TO_BE_DONE_for_the_documentati">STUFF TO BE DONE for the documentation</a>
+<li><a href="#AUTHORS">AUTHORS</a>
</li>
</ul><hr />
<!-- INDEX END -->
<code>SDL::get_error</code>, which returns a scalar containing the text of the message if any.</p>
</div>
-<h2 id="set_error_error_need_to_be_coded">set_error(error) *need to be coded</h2>
-<div id="set_error_error_need_to_be_coded_CON">
+<h2 id="set_error_real_error_values">set_error_real(error, @values) </h2>
+<div id="set_error_real_error_values_CONTENT">
<p>SDL::get_error sets the SDL error to a printf style formatted string.
it doesn't returns any values.</p>
</div>
-<h2 id="clear_error_need_to_be_coded">clear_error() * need to be coded</h2>
-<div id="clear_error_need_to_be_coded_CONTENT">
+<h2 id="clear_error">clear_error() </h2>
+<div id="clear_error_CONTENT">
<p>SDL::clear_error deletes all information about the last internal SDL error. Useful if the error has been handled by the program.
it doesn't returns any value.</p>
</div>
-<h1 id="STUFF_TO_BE_DONE_for_the_documentati">STUFF TO BE DONE for the documentation</h1><p><a href="#TOP" class="toplink">Top</a></p>
-<div id="STUFF_TO_BE_DONE_for_the_documentati-2">
-<pre>
-
-
- SDL:: to improve
- SDL::Video add examples, need general improvement.
- Event.pod need to be checked against Events.pod
- SDL::Events need to be completed
- SDL::Cdrom need some examples.
- SDL::MultiThread to be created( once implemented ).
- SDL::Timer need examples.
- SDL::RW to be created.
- SDL::Mouse need to be created.
- SDL::Joystick need to be created.
- SDL::Audio need to be created.
+<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="AUTHORS_CONTENT">
+<p>magnet, kthakore</p>
+
+
+
-</pre>
</div>
</div>
\ No newline at end of file