added credits
[sdlgit/SDL-Site.git] / pages / SDL.html-inc
CommitLineData
162a0989 1<div class="pod">
2<!-- INDEX START -->
3<h3 id="TOP">Index</h3>
4
bfdd9c2e 5<ul><li><a href="#NAME">NAME</a>
6<ul><li><a href="#CATEGORY">CATEGORY</a></li>
7</ul>
8</li>
162a0989 9<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
10<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
162a0989 11<li><a href="#Functions_exported_by_SDL_pm">Functions exported by SDL.pm</a>
12<ul><li><a href="#init_flags">init(flags) </a></li>
13<li><a href="#init_subsystem_flags">init_subsystem(flags)</a></li>
14<li><a href="#quit_subsystem_flags">quit_subsystem(flags)</a></li>
15<li><a href="#quit">quit</a></li>
16<li><a href="#was_init_flags">was_init(flags)</a></li>
17<li><a href="#get_error">get_error()</a></li>
096d8dc8 18<li><a href="#set_error_real_error_values">set_error_real(error, @values) </a></li>
162a0989 19<li><a href="#error_code_need_to_be_coded">error(code) * need to be coded</a></li>
096d8dc8 20<li><a href="#clear_error">clear_error() </a></li>
162a0989 21<li><a href="#load_object">load_object()</a></li>
22<li><a href="#load_function">load_function()</a></li>
23<li><a href="#unload_object">unload_object()</a></li>
24<li><a href="#VERSION">VERSION()</a></li>
25<li><a href="#version">version()</a></li>
26<li><a href="#linked_version">linked_version</a></li>
27<li><a href="#get_error-2">get_error()</a></li>
ecabf8b7 28<li><a href="#delay_ms">delay(ms)</a></li>
162a0989 29</ul>
30</li>
096d8dc8 31<li><a href="#AUTHORS">AUTHORS</a>
ecabf8b7 32</li>
162a0989 33</ul><hr />
34<!-- INDEX END -->
35
36<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
37<div id="NAME_CONTENT">
879e3e79 38<p>SDL - Simple DirectMedia Layer for Perl</p>
162a0989 39
40</div>
bfdd9c2e 41<h2 id="CATEGORY">CATEGORY</h2>
42<div id="CATEGORY_CONTENT">
43<p>Core</p>
44
45</div>
162a0989 46<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
47<div id="SYNOPSIS_CONTENT">
a17227e6 48<pre> use SDL ':all';
162a0989 49
50</pre>
51
52</div>
53<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
54<div id="DESCRIPTION_CONTENT">
55<p>SDL_perl is a package of perl modules that provides both functional and object orient
56interfaces to the Simple DirectMedia Layer for Perl 5. This package does take some
57liberties with the SDL API, and attempts to adhere to the spirit of both the SDL
58and Perl. This document describes the low-level functional SDL_perl API. For the
59object oriented programming interface please see the documentation provided on a
60per class basis.</p>
61
62</div>
162a0989 63<h1 id="Functions_exported_by_SDL_pm">Functions exported by SDL.pm</h1><p><a href="#TOP" class="toplink">Top</a></p>
64<div id="Functions_exported_by_SDL_pm_CONTENT">
65
66</div>
67<h2 id="init_flags">init(flags) </h2>
68<div id="init_flags_CONTENT">
69<p>As with the C language API, SDL_perl initializes the SDL environment through
30652763 70the <code>SDL::init</code> subroutine. This routine takes a mode flag constructed through
71the bitwise OR product of the SDL_INIT_* constants.</p>
72<p>The constants are not exported by default. You can export them into your namespace by doing:</p>
73<pre> use SDL ':all';
74
75</pre>
76<p>or access them directly:</p>
77<pre> SDL::SDL_INIT_AUDIO;
78
79</pre>
162a0989 80<dl>
81 <dt>*
30652763 82SDL_INIT_AUDIO</dt>
162a0989 83 <dt>*
30652763 84SDL_INIT_VIDEO</dt>
162a0989 85 <dt>*
30652763 86SDL_INIT_CDROM</dt>
162a0989 87 <dt>*
30652763 88SDL_INIT_EVERYTHING</dt>
162a0989 89 <dt>*
30652763 90SDL_INIT_NOPARACHUTE</dt>
162a0989 91 <dt>*
30652763 92SDL_INIT_JOYSTICK</dt>
162a0989 93 <dt>*
30652763 94SDL_INIT_TIMER</dt>
162a0989 95</dl>
96<p><code>SDL::Init</code> returns 0 on success, or -1 on error.</p>
97
98</div>
99<h2 id="init_subsystem_flags">init_subsystem(flags)</h2>
100<div id="init_subsystem_flags_CONTENT">
101<p>After SDL has been initialized with SDL::init you may initialize uninitialized subsystems with SDL::init_subsystem.
102The flags parameter is the same as that used in SDL::init. </p>
103<p>SDL::init_subsystem returns 0 on success, or -1 on error.</p>
104
105</div>
106<h2 id="quit_subsystem_flags">quit_subsystem(flags)</h2>
107<div id="quit_subsystem_flags_CONTENT">
108<p>SDL::quit_subsystem allows you to shut down a subsystem that has been previously initialized by SDL::init or SDL::init_subsystem.
109The flags tells SDL::quit_subSystem which subsystems to shut down, it uses the same values that are passed to SDL::init. </p>
110<p>SDL::quit_subsystem doesn't returns any value.</p>
111
112</div>
113<h2 id="quit">quit</h2>
114<div id="quit_CONTENT">
90d38009 115<p>Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources.</p>
116<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>
162a0989 117<p>SDL::quit doesn't returns any value.</p>
118
119</div>
120<h2 id="was_init_flags">was_init(flags)</h2>
121<div id="was_init_flags_CONTENT">
122<p>SDL::was_init allows you to see which SDL subsytems have been initialized.
123flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL::init for a list of subsystem flags).
124If 'flags' is 0 or SDL_INIT_EVERYTHING, it returns a mask of all initialized subsystems (this does not include SDL_INIT_EVENTTHREAD or SDL_INIT_NOPARACHUTE).</p>
125
126
127
128
129
130</div>
131<h2 id="get_error">get_error()</h2>
132<div id="get_error_CONTENT">
133<p>The last error message set by the SDL library can be retrieved using the subroutine
134<code>SDL::get_error</code>, which returns a scalar containing the text of the message if any.</p>
135
136</div>
096d8dc8 137<h2 id="set_error_real_error_values">set_error_real(error, @values) </h2>
138<div id="set_error_real_error_values_CONTENT">
162a0989 139<p>SDL::get_error sets the SDL error to a printf style formatted string.
140it doesn't returns any values.</p>
141
142</div>
143<h2 id="error_code_need_to_be_coded">error(code) * need to be coded</h2>
144<div id="error_code_need_to_be_coded_CONTENT">
145<p>Sets the SDL error message to one of several predefined strings specified by code. </p>
146<p>code can be :</p>
449a007b 147<dl>
148 <dt>SDL_errorcode</dt>
149 <dd>
150 <p>The corresponding error string</p>
151 </dd>
152 <dt>SDL_ENOMEM</dt>
153 <dd>
154 <p>Out of memory</p>
155 </dd>
156 <dt>SDL_EFREAD</dt>
157 <dd>
158 <p>Error reading from datastream</p>
159 </dd>
160 <dt>SDL_EFWRITE</dt>
161 <dd>
162 <p>Error writing to datastream</p>
163 </dd>
164 <dt>SDL_EFSEEK</dt>
165 <dd>
166 <p>Error seeking in datastream</p>
167 </dd>
168 <dt>SDL_UNSUPPORTED</dt>
169 <dd>
170 <p>Unknown SDL error</p>
171 </dd>
172 <dt>SDL_LASTERROR</dt>
173 <dd>
174 <p>Unknown SDL error</p>
175 </dd>
176 <dt>any other value</dt>
177 <dd>
178 <p>Unknown SDL error</p>
179 </dd>
180</dl>
449a007b 181<p>Note 1: SDL_LASTERROR marks the highest numbered predefined error.
182Note 2: SDL also defines SDL_OutOfMemory() and SDL_Unsupported() for internal use
183which are equivalent to SDL_Error(SDL_ENOMEM) and SDL_Error(SDL_UNSUPPORTED) respectively. </p>
162a0989 184<p>SDL::Error doesn't returns any value.</p>
185
186
187
188
189
190</div>
096d8dc8 191<h2 id="clear_error">clear_error() </h2>
192<div id="clear_error_CONTENT">
162a0989 193<p>SDL::clear_error deletes all information about the last internal SDL error. Useful if the error has been handled by the program.
194it doesn't returns any value.</p>
195
196</div>
197<h2 id="load_object">load_object()</h2>
198<div id="load_object_CONTENT">
199<p>Need to be coded.</p>
200
201</div>
202<h2 id="load_function">load_function()</h2>
203<div id="load_function_CONTENT">
204<p>Need to be coded.</p>
205
206</div>
207<h2 id="unload_object">unload_object()</h2>
208<div id="unload_object_CONTENT">
209<p>Need to be coded.</p>
210
211</div>
212<h2 id="VERSION">VERSION()</h2>
213<div id="VERSION_CONTENT">
214<p>Need to be coded. </p>
215
216</div>
217<h2 id="version">version()</h2>
218<div id="version_CONTENT">
219<p>Need to be coded.</p>
220
221</div>
222<h2 id="linked_version">linked_version</h2>
223<div id="linked_version_CONTENT">
224<p>Need to be coded.</p>
225
226</div>
227<h2 id="get_error-2">get_error()</h2>
228<div id="get_error_CONTENT-2">
229<p>The last error message set by the SDL library can be retrieved using the subroutine
230<code>SDL::get_error</code>, which returns a scalar containing the text of the message if any.</p>
231
232</div>
233<h2 id="delay_ms">delay(ms)</h2>
234<div id="delay_ms_CONTENT">
235<p>This subroutine allows an application to delay further operations for atleast a
236number of milliseconds provided as the argument. The actual delay may be longer
237than the specified depending on the underlying OS.</p>
238
239
240
241
242
ecabf8b7 243</div>
096d8dc8 244<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
245<div id="AUTHORS_CONTENT">
246<p>magnet, kthakore</p>
247
248
249
162a0989 250
162a0989 251
252</div>
253</div>