fixed docs for SDL::Video::list_modes
[sdlgit/SDL-Site.git] / pages / SDL-Video.html-inc
index d1de821..86b96b8 100644 (file)
@@ -97,8 +97,8 @@
 </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 ':flags';
+<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>Available flags for <a href="/SDL-Video.html#set_video_mode">SDL::Video::set_video_mode</a>:</p>
-<dl>
-       <dt>SDL_ANYFORMAT</dt>
-       <dd>
-               <p>Allow any pixel-format *</p>
-       </dd>
-       <dt>SDL_HWPALETTE</dt>
-       <dd>
-               <p>Have an exclusive palette</p>
-       </dd>
-       <dt>SDL_DOUBLEBUF</dt>
-       <dd>
-               <p>Double buffered *</p>
-       </dd>
-       <dt>SDL_FULLSCREEN</dt>
-       <dd>
-               <p>Full screen surface *</p>
-       </dd>
-       <dt>SDL_OPENGL</dt>
-       <dd>
-               <p>Have an OpenGL context *</p>
-       </dd>
-       <dt>SDL_OPENGLBLIT</dt>
-       <dd>
-               <p>Support OpenGL blitting *. NOTE: This option is kept for compatibility only, and is not recommended for new code.</p>
-       </dd>
-       <dt>SDL_RESIZABLE</dt>
-       <dd>
-               <p>Resizable surface *</p>
-       </dd>
-       <dt>SDL_NOFRAME</dt>
-       <dd>
-               <p>No window caption or edge frame</p>
-       </dd>
-</dl>
-<p>Used internally</p>
-<dl>
-       <dt>SDL_HWACCEL</dt>
-       <dd>
-               <p>Use hardware acceleration blit</p>
-       </dd>
-       <dt>SDL_SRCCOLORKEY</dt>
-       <dd>
-               <p>Use colorkey blitting</p>
-       </dd>
-       <dt>SDL_RLEACCELOK</dt>
-       <dd>
-               <p>Private flag</p>
-       </dd>
-       <dt>SDL_RLEACCEL</dt>
-       <dd>
-               <p>Accelerated colorkey blitting with RLE</p>
-       </dd>
-       <dt>SDL_SRCALPHA</dt>
-       <dd>
-               <p>Use alpha blending blit</p>
-       </dd>
-       <dt>SDL_PREALLOC</dt>
-       <dd>
-               <p>Use preallocated memory</p>
-       </dd>
-</dl>
-
-
-
+<p>The constants are exported by default. You can avoid this by doing:</p>
+<pre> use SDL::Video ();
+
+</pre>
+<p>and access them directly:</p>
+<pre> SDL::Video::SDL_SWSURFACE;
+
+</pre>
+<p>or by choosing the export tags below:</p>
+<p>Export tag: ':surface'</p>
+<pre> SDL_ASYNCBLIT       Use asynchronous blit if possible
+ SDL_SWSURFACE       Stored in the system memory.
+ SDL_HWSURFACE       Stored in video memory
+
+</pre>
+<p>Export tag: ':video'</p>
+<pre> SDL_ANYFORMAT       Allow any pixel-format
+ SDL_HWPALETTE       Have an exclusive palette
+ SDL_DOUBLEBUF       Double buffered
+ SDL_FULLSCREEN      Full screen surface
+ SDL_OPENGL          Have an OpenGL context
+ SDL_OPENGLBLIT      Support OpenGL blitting. 
+                     NOTE: This option is kept for compatibility only, and is not recommended for new code.
+ SDL_RESIZABLE       Resizable surface
+ SDL_NOFRAME         No window caption or edge frame
+ SDL_HWACCEL Use     Hardware acceleration blit
+ SDL_SRCCOLORKEY     Use colorkey blitting
+ SDL_RLEACCELOK      Private flag
+ SDL_RLEACCEL        Accelerated colorkey blitting with RLE
+ SDL_SRCALPHA        Use alpha blending blit
+ SDL_PREALLOC        Use preallocated memory
+
+</pre>
+<p>Export tag ':overlay'</p>
+<pre> SDL_YV12_OVERLAY    Planar mode: Y + V + U  (3 planes)
+ SDL_IYUV_OVERLAY    Planar mode: Y + U + V  (3 planes)
+ SDL_YUY2_OVERLAY    Packed mode: Y0+U0+Y1+V0 (1 plane)
+ SDL_UYVY_OVERLAY    Packed mode: U0+Y0+V0+Y1 (1 plane)
+ SDL_YVYU_OVERLAY    Packed mode: Y0+V0+Y1+U0 (1 plane)
+
+</pre>
+<p>Export tag ':palette'</p>
+<pre> SDL_LOGPAL          Logical palette, which controls how blits are mapped to/from the surface
+ SDL_PHYSPAL         Physical palette, which controls how pixels look on the screen
+
+</pre>
+<p>Export tag ':grab'</p>
+<pre> SDL_GRAB_QUERY
+ SDL_GRAB_OFF
+ SDL_GRAB_ON
+ 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>
@@ -268,8 +275,16 @@ word identifier like <code>&quot;x11&quot;</code>, <code>&quot;windib&quot;</cod
 <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>
+<dl>
+       <dt>*
+of available screen dimensions (as <code>SDL::Rect</code>'s) for the given format and video flags. </dt>
+       <dt>*
+with first array element 'all'. In this case you can set all modes.</dt>
+       <dt>*
+with first array element 'none' if no mode is available.</dt>
+</dl>
+<p><strong>Note</strong>: &lt;list_modes&gt; 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;
@@ -286,9 +301,9 @@ or it return undef if no modes are available.</p>
  if($#modes &gt; 0)
  {
      print(&quot;available modes:\n&quot;);
-     foreach my $index ( @modes )
+     foreach my $mode ( @modes )
      {
-         printf(&quot;%03d: %d x %d\n&quot;, $index, $modes[$index]-&gt;w, $modes[$index]-&gt;h );
+         printf(&quot;%d x %d\n&quot;, $mode-&gt;w, $mode-&gt;h );
      }
  }
  elsif($#modes == 0)