</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;
</div>
<h1 id="CONSTANTS">CONSTANTS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="CONSTANTS_CONTENT">
-<p>The constants are not exported by default. You can export them into your namespace by doing:</p>
-<pre> use SDL::Video ':all';
+<p>The constants are exported by default. You can avoid this by doing:</p>
+<pre> use SDL::Video ();
</pre>
-<p>or access them directly:</p>
+<p>and access them directly:</p>
<pre> SDL::Video::SDL_SWSURFACE;
</pre>
SDL_GRAB_FULLSCREEN Used interally
</pre>
+<p>Export tag ':gl'</p>
+<pre> SDL_GL_RED_SIZE
+ SDL_GL_GREEN_SIZE
+ SDL_GL_BLUE_SIZE
+ SDL_GL_ALPHA_SIZE
+ SDL_GL_BUFFER_SIZE
+ SDL_GL_DOUBLEBUFFER
+ SDL_GL_DEPTH_SIZE
+ SDL_GL_STENCIL_SIZE
+ SDL_GL_ACCUM_RED_SIZE
+ SDL_GL_ACCUM_GREEN_SIZE
+ SDL_GL_ACCUM_BLUE_SIZE
+ SDL_GL_ACCUM_ALPHA_SIZE
+ SDL_GL_STEREO
+ SDL_GL_MULTISAMPLEBUFFERS
+ SDL_GL_MULTISAMPLESAMPLES
+ SDL_GL_ACCELERATED_VISUAL
+ SDL_GL_SWAP_CONTROL
+
+</pre>
</div>
<h1 id="Core_Functions">Core Functions</h1><p><a href="#TOP" class="toplink">Top</a></p>
<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)