<li><a href="#wm_toggle_fullscreen">wm_toggle_fullscreen</a></li>
</ul>
</li>
-<li><a href="#AUTHOR">AUTHOR</a></li>
+<li><a href="#AUTHORS">AUTHORS</a></li>
<li><a href="#SEE_ALSO">SEE ALSO</a>
<ul><li><a href="#Category_Objects">Category Objects</a>
</li>
</div>
<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="SYNOPSIS_CONTENT">
-<pre> use SDL ':init';
- use SDL::Video ':all';
+<pre> use SDL;
+ use SDL::Video;
use SDL::Surface;
use SDL::Rect;
<pre> my @modes = @{ SDL::Video::list_modes( $pixel_format, $flags ) };
</pre>
-<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>Returns a reference to an array:</p>
+<ul>
+ <li>of available screen dimensions (as <code>SDL::Rect</code>'s) for the given format and video flags. </li>
+ <li>with first array element 'all'. In this case you can set all modes. </li>
+ <li>with first array element 'none' if no mode is available.</li>
+</ul>
+
+<p><strong>Note</strong>: <list_modes> should be called before the video_mode ist set. Otherwise you will always get 'all'.</p>
<p>Example:</p>
<pre> use SDL;
use SDL::Video;
if($#modes > 0)
{
print("available modes:\n");
- foreach my $index ( @modes )
+ foreach my $mode ( @modes )
{
- printf("%03d: %d x %d\n", $index, $modes[$index]->w, $modes[$index]->h );
+ printf("%d x %d\n", $mode->w, $mode->h );
}
}
elsif($#modes == 0)
sub main
{
- carp 'Unable to init SDL: '.SDL::get_error() if( SDL::init(SDL_INIT_VIDEO) < 0);
+ Carp::cluck 'Unable to init SDL: '.SDL::get_error() if( SDL::init(SDL_INIT_VIDEO) < 0);
$screen = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE);
- carp 'Unable to set 640x480x32 video' . SDL::get_error() if(!$screen);
+ Carp::cluck 'Unable to set 640x480x32 video' . SDL::get_error() if(!$screen);
while(1)
{
is experimental).</p>
</div>
-<h1 id="AUTHOR">AUTHOR</h1><p><a href="#TOP" class="toplink">Top</a></p>
-<div id="AUTHOR_CONTENT">
-<p>magnet, Tobias Leich (FROGGS)</p>
+<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="AUTHORS_CONTENT">
+<p>See <b>AUTHORS</b> in <cite>SDL</cite>.</p>
</div>
<h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>