note on how to import contants
[sdlgit/SDL-Site.git] / pages / SDL.html-inc
index 34e5c9f..bb561e5 100644 (file)
@@ -2,7 +2,10 @@
 <!-- INDEX START -->
 <h3 id="TOP">Index</h3>
 
-<ul><li><a href="#NAME">NAME</a></li>
+<ul><li><a href="#NAME">NAME</a>
+<ul><li><a href="#CATEGORY">CATEGORY</a></li>
+</ul>
+</li>
 <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
 <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
 <li><a href="#The_SDL_Perl_2009_Development_Team">The SDL Perl 2009 Development Team</a>
@@ -22,9 +25,9 @@
 <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="#version">version()</a></li>
 <li><a href="#linked_version">linked_version</a></li>
 <li><a href="#get_error-2">get_error()</a></li>
-<li><a href="#delay_ms">delay(ms)</a>
-</li>
+<li><a href="#delay_ms">delay(ms)</a></li>
 </ul>
 </li>
+<li><a href="#AUTHORS">AUTHORS</a>
+</li>
 </ul><hr />
 <!-- INDEX END -->
 
 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
 <div id="NAME_CONTENT">
-<p>SDL_perl - Simple DirectMedia Layer for Perl</p>
+<p>SDL - Simple DirectMedia Layer for Perl</p>
+
+</div>
+<h2 id="CATEGORY">CATEGORY</h2>
+<div id="CATEGORY_CONTENT">
+<p>Core</p>
 
 </div>
 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
@@ -130,23 +139,31 @@ per class basis.</p>
 <h2 id="init_flags">init(flags) </h2>
 <div id="init_flags_CONTENT">
 <p>As with the C language API, SDL_perl initializes the SDL environment through
-the <code>SDL::init</code> subroutine.  This routine takes a mode flag constructed through
-the bitwise OR product of the following constants:</p>
+the <code>SDL::init</code> subroutine. This routine takes a mode flag constructed through
+the bitwise OR product of the SDL_INIT_* constants.</p>
+<p>The constants are not exported by default. You can export them into your namespace by doing:</p>
+<pre> use SDL ':all';
+
+</pre>
+<p>or access them directly:</p>
+<pre> SDL::SDL_INIT_AUDIO;
+
+</pre>
 <dl>
        <dt>*
-INIT_AUDIO</dt>
+SDL_INIT_AUDIO</dt>
        <dt>*
-INIT_VIDEO</dt>
+SDL_INIT_VIDEO</dt>
        <dt>*
-INIT_CDROM</dt>
+SDL_INIT_CDROM</dt>
        <dt>*
-INIT_EVERYTHING</dt>
+SDL_INIT_EVERYTHING</dt>
        <dt>*
-INIT_NOPARACHUTE</dt>
+SDL_INIT_NOPARACHUTE</dt>
        <dt>*
-INIT_JOYSTICK</dt>
+SDL_INIT_JOYSTICK</dt>
        <dt>*
-INIT_TIMER</dt>
+SDL_INIT_TIMER</dt>
 </dl>
 <p><code>SDL::Init</code> returns 0 on success, or -1 on error.</p>
 
@@ -167,7 +184,8 @@ The flags tells SDL::quit_subSystem which subsystems to shut down, it uses the s
 </div>
 <h2 id="quit">quit</h2>
 <div id="quit_CONTENT">
-<p>Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources. This should always be called before you exit.</p>
+<p>Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources.</p>
+<p><strong>Note</strong>: This will be called automatically when perl exits. You don't need to call this, except you want to initialize SDL after this again.</p>
 <p>SDL::quit doesn't returns any value.</p>
 
 </div>
@@ -188,8 +206,8 @@ If 'flags' is 0 or SDL_INIT_EVERYTHING, it returns a mask of all initialized sub
 <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>
 
@@ -198,24 +216,43 @@ it doesn't returns any values.</p>
 <div id="error_code_need_to_be_coded_CONTENT">
 <p>Sets the SDL error message to one of several predefined strings specified by code. </p>
 <p>code can be :</p>
-<pre>          SDL_errorcode   The corresponding error string
-
-               SDL_ENOMEM      Out of memory
-               SDL_EFREAD      Error reading from datastream
-               SDL_EFWRITE     Error writing to datastream
-               SDL_EFSEEK      Error seeking in datastream
-               SDL_UNSUPPORTED Unknown SDL error
-               SDL_LASTERROR   Unknown SDL error
-               any other value Unknown SDL error
-
-
-
-
-               Note 1: SDL_LASTERROR marks the highest numbered predefined error.
-               Note 2: SDL also defines SDL_OutOfMemory() and SDL_Unsupported() for internal use
-               which are equivalent to SDL_Error(SDL_ENOMEM) and SDL_Error(SDL_UNSUPPORTED) respectively. 
-
-</pre>
+<dl>
+       <dt>SDL_errorcode</dt>
+       <dd>
+               <p>The corresponding error string</p>
+       </dd>
+       <dt>SDL_ENOMEM</dt>
+       <dd>
+               <p>Out of memory</p>
+       </dd>
+       <dt>SDL_EFREAD</dt>
+       <dd>
+               <p>Error reading from datastream</p>
+       </dd>
+       <dt>SDL_EFWRITE</dt>
+       <dd>
+               <p>Error writing to datastream</p>
+       </dd>
+       <dt>SDL_EFSEEK</dt>
+       <dd>
+               <p>Error seeking in datastream</p>
+       </dd>
+       <dt>SDL_UNSUPPORTED</dt>
+       <dd>
+               <p>Unknown SDL error</p>
+       </dd>
+       <dt>SDL_LASTERROR</dt>
+       <dd>
+               <p>Unknown SDL error</p>
+       </dd>
+       <dt>any other value</dt>
+       <dd>
+               <p>Unknown SDL error</p>
+       </dd>
+</dl>
+<p>Note 1: SDL_LASTERROR marks the highest numbered predefined error.
+Note 2: SDL also defines SDL_OutOfMemory() and SDL_Unsupported() for internal use
+which are equivalent to SDL_Error(SDL_ENOMEM) and SDL_Error(SDL_UNSUPPORTED) respectively. </p>
 <p>SDL::Error doesn't returns any value.</p>
 
 
@@ -223,8 +260,8 @@ 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>
 
@@ -275,6 +312,12 @@ than the specified depending on the underlying OS.</p>
 
 
 
+</div>
+<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="AUTHORS_CONTENT">
+<p>magnet, kthakore</p>
+
+