87fbc70fd4282a9742312a0624e76d05aa772d69
[sdlgit/SDL-Site.git] / pages / SDL.html-inc
1 <div class="pod">
2 <!-- INDEX START -->
3 <h3 id="TOP">Index</h3>
4
5 <ul><li><a href="#NAME">NAME</a></li>
6 <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
7 <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
8 <li><a href="#The_SDL_Perl_2009_Development_Team">The SDL Perl 2009 Development Team</a>
9 <ul><li><a href="#Documentation">Documentation</a></li>
10 <li><a href="#Perl_Development">Perl Development</a></li>
11 <li><a href="#Maintainance">Maintainance </a></li>
12 </ul>
13 </li>
14 <li><a href="#MacOSX_Experimental_Usage">MacOSX Experimental Usage</a>
15 <ul><li><a href="#Running_SDL_Perl_Scripts_in_MacOSX">Running SDL Perl Scripts in MacOSX</a></li>
16 </ul>
17 </li>
18 <li><a href="#Functions_exported_by_SDL_pm">Functions exported by SDL.pm</a>
19 <ul><li><a href="#init_flags">init(flags) </a></li>
20 <li><a href="#init_subsystem_flags">init_subsystem(flags)</a></li>
21 <li><a href="#quit_subsystem_flags">quit_subsystem(flags)</a></li>
22 <li><a href="#quit">quit</a></li>
23 <li><a href="#was_init_flags">was_init(flags)</a></li>
24 <li><a href="#get_error">get_error()</a></li>
25 <li><a href="#set_error_error_need_to_be_coded">set_error(error)  *need to be coded</a></li>
26 <li><a href="#error_code_need_to_be_coded">error(code) * need to be coded</a></li>
27 <li><a href="#clear_error_need_to_be_coded">clear_error() * need to be coded</a></li>
28 <li><a href="#load_object">load_object()</a></li>
29 <li><a href="#load_function">load_function()</a></li>
30 <li><a href="#unload_object">unload_object()</a></li>
31 <li><a href="#VERSION">VERSION()</a></li>
32 <li><a href="#version">version()</a></li>
33 <li><a href="#linked_version">linked_version</a></li>
34 <li><a href="#get_error-2">get_error()</a></li>
35 <li><a href="#delay_ms">delay(ms)</a></li>
36 </ul>
37 </li>
38 <li><a href="#STUFF_TO_BE_DONE_for_the_documentati">STUFF TO BE DONE for the documentation</a>
39 </li>
40 </ul><hr />
41 <!-- INDEX END -->
42
43 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
44 <div id="NAME_CONTENT">
45 <p>SDL_perl - Simple DirectMedia Layer for Perl</p>
46
47 </div>
48 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
49 <div id="SYNOPSIS_CONTENT">
50 <pre>  use SDL;
51
52 </pre>
53
54 </div>
55 <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
56 <div id="DESCRIPTION_CONTENT">
57 <p>SDL_perl is a package of perl modules that provides both functional and object orient
58 interfaces to the Simple DirectMedia Layer for Perl 5.  This package does take some
59 liberties with the SDL API, and attempts to adhere to the spirit of both the SDL
60 and Perl.  This document describes the low-level functional SDL_perl API.  For the
61 object oriented programming interface please see the documentation provided on a
62 per class basis.</p>
63
64 </div>
65 <h1 id="The_SDL_Perl_2009_Development_Team">The SDL Perl 2009 Development Team</h1><p><a href="#TOP" class="toplink">Top</a></p>
66 <div id="The_SDL_Perl_2009_Development_Team_C">
67
68 </div>
69 <h2 id="Documentation">Documentation</h2>
70 <div id="Documentation_CONTENT">
71 <pre>   Nick: magnet
72
73 </pre>
74
75 </div>
76 <h2 id="Perl_Development">Perl Development</h2>
77 <div id="Perl_Development_CONTENT">
78 <pre>   Nick: Garu
79         Name: Breno G. de Oliveira
80
81         Nick: Dngor
82         Name: Rocco Caputo
83
84         Nick: nferraz
85         Name: Nelson Ferraz
86
87         Nick: acme
88         Name: Leon Brocard
89
90         Nick: FROGGS
91         Name: Tobias Leich
92
93 </pre>
94
95 </div>
96 <h2 id="Maintainance">Maintainance </h2>
97 <div id="Maintainance_CONTENT">
98 <pre>   Nick: kthakore
99         Name: Kartik Thakore
100
101 </pre>
102
103 </div>
104 <h1 id="MacOSX_Experimental_Usage">MacOSX Experimental Usage</h1><p><a href="#TOP" class="toplink">Top</a></p>
105 <div id="MacOSX_Experimental_Usage_CONTENT">
106 <p>Please get libsdl packages from Fink</p>
107 <pre>   perl Build.PL
108         perl Build test
109         perl Build bundle
110         perl Build install
111
112 </pre>
113
114 </div>
115 <h2 id="Running_SDL_Perl_Scripts_in_MacOSX">Running SDL Perl Scripts in MacOSX</h2>
116 <div id="Running_SDL_Perl_Scripts_in_MacOSX_C">
117 <p>First set the PERL5LIB environment variable to the dependencies of your script</p>
118 <pre>   %export PERL5LIB=$PERL5LIB:./lib
119
120 </pre>
121 <p>Use the SDLPerl executable made in the bundle and call your scripts</p>
122 <pre>   %SDLPerl.app/Contents/MacOS/SDLPerl yourScript.pl
123
124 </pre>
125
126 </div>
127 <h1 id="Functions_exported_by_SDL_pm">Functions exported by SDL.pm</h1><p><a href="#TOP" class="toplink">Top</a></p>
128 <div id="Functions_exported_by_SDL_pm_CONTENT">
129
130 </div>
131 <h2 id="init_flags">init(flags) </h2>
132 <div id="init_flags_CONTENT">
133 <p>As with the C language API, SDL_perl initializes the SDL environment through
134 the <code>SDL::init</code> subroutine.  This routine takes a mode flag constructed through
135 the bitwise OR product of the following constants:</p>
136 <dl>
137         <dt>*
138 INIT_AUDIO</dt>
139         <dt>*
140 INIT_VIDEO</dt>
141         <dt>*
142 INIT_CDROM</dt>
143         <dt>*
144 INIT_EVERYTHING</dt>
145         <dt>*
146 INIT_NOPARACHUTE</dt>
147         <dt>*
148 INIT_JOYSTICK</dt>
149         <dt>*
150 INIT_TIMER</dt>
151 </dl>
152 <p><code>SDL::Init</code> returns 0 on success, or -1 on error.</p>
153
154 </div>
155 <h2 id="init_subsystem_flags">init_subsystem(flags)</h2>
156 <div id="init_subsystem_flags_CONTENT">
157 <p>After SDL has been initialized with SDL::init you may initialize uninitialized subsystems with SDL::init_subsystem.
158 The flags parameter is the same as that used in SDL::init. </p>
159 <p>SDL::init_subsystem returns 0 on success, or -1 on error.</p>
160
161 </div>
162 <h2 id="quit_subsystem_flags">quit_subsystem(flags)</h2>
163 <div id="quit_subsystem_flags_CONTENT">
164 <p>SDL::quit_subsystem allows you to shut down a subsystem that has been previously initialized by SDL::init or SDL::init_subsystem.
165 The flags tells SDL::quit_subSystem which subsystems to shut down, it uses the same values that are passed to SDL::init. </p>
166 <p>SDL::quit_subsystem doesn't returns any value.</p>
167
168 </div>
169 <h2 id="quit">quit</h2>
170 <div id="quit_CONTENT">
171 <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>
172 <p>SDL::quit doesn't returns any value.</p>
173
174 </div>
175 <h2 id="was_init_flags">was_init(flags)</h2>
176 <div id="was_init_flags_CONTENT">
177 <p>SDL::was_init allows you to see which SDL subsytems have been initialized.
178 flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL::init for a list of subsystem flags). 
179 If '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>
180
181
182
183
184
185 </div>
186 <h2 id="get_error">get_error()</h2>
187 <div id="get_error_CONTENT">
188 <p>The last error message set by the SDL library can be retrieved using the subroutine
189 <code>SDL::get_error</code>, which returns a scalar containing the text of the message if any.</p>
190
191 </div>
192 <h2 id="set_error_error_need_to_be_coded">set_error(error)  *need to be coded</h2>
193 <div id="set_error_error_need_to_be_coded_CON">
194 <p>SDL::get_error sets the SDL error to a printf style formatted string. 
195 it doesn't returns any values.</p>
196
197 </div>
198 <h2 id="error_code_need_to_be_coded">error(code) * need to be coded</h2>
199 <div id="error_code_need_to_be_coded_CONTENT">
200 <p>Sets the SDL error message to one of several predefined strings specified by code. </p>
201 <p>code can be :</p>
202 <dl>
203         <dt>SDL_errorcode</dt>
204         <dd>
205                 <p>The corresponding error string</p>
206         </dd>
207         <dt>SDL_ENOMEM</dt>
208         <dd>
209                 <p>Out of memory</p>
210         </dd>
211         <dt>SDL_EFREAD</dt>
212         <dd>
213                 <p>Error reading from datastream</p>
214         </dd>
215         <dt>SDL_EFWRITE</dt>
216         <dd>
217                 <p>Error writing to datastream</p>
218         </dd>
219         <dt>SDL_EFSEEK</dt>
220         <dd>
221                 <p>Error seeking in datastream</p>
222         </dd>
223         <dt>SDL_UNSUPPORTED</dt>
224         <dd>
225                 <p>Unknown SDL error</p>
226         </dd>
227         <dt>SDL_LASTERROR</dt>
228         <dd>
229                 <p>Unknown SDL error</p>
230         </dd>
231         <dt>any other value</dt>
232         <dd>
233                 <p>Unknown SDL error</p>
234         </dd>
235 </dl>
236
237
238
239
240 <p>Note 1: SDL_LASTERROR marks the highest numbered predefined error.
241 Note 2: SDL also defines SDL_OutOfMemory() and SDL_Unsupported() for internal use
242 which are equivalent to SDL_Error(SDL_ENOMEM) and SDL_Error(SDL_UNSUPPORTED) respectively. </p>
243 <p>SDL::Error doesn't returns any value.</p>
244
245
246
247
248
249 </div>
250 <h2 id="clear_error_need_to_be_coded">clear_error() * need to be coded</h2>
251 <div id="clear_error_need_to_be_coded_CONTENT">
252 <p>SDL::clear_error deletes all information about the last internal SDL error. Useful if the error has been handled by the program.
253 it doesn't returns any value.</p>
254
255 </div>
256 <h2 id="load_object">load_object()</h2>
257 <div id="load_object_CONTENT">
258 <p>Need to be coded.</p>
259
260 </div>
261 <h2 id="load_function">load_function()</h2>
262 <div id="load_function_CONTENT">
263 <p>Need to be coded.</p>
264
265 </div>
266 <h2 id="unload_object">unload_object()</h2>
267 <div id="unload_object_CONTENT">
268 <p>Need to be coded.</p>
269
270 </div>
271 <h2 id="VERSION">VERSION()</h2>
272 <div id="VERSION_CONTENT">
273 <p>Need to be coded. </p>
274
275 </div>
276 <h2 id="version">version()</h2>
277 <div id="version_CONTENT">
278 <p>Need to be coded.</p>
279
280 </div>
281 <h2 id="linked_version">linked_version</h2>
282 <div id="linked_version_CONTENT">
283 <p>Need to be coded.</p>
284
285 </div>
286 <h2 id="get_error-2">get_error()</h2>
287 <div id="get_error_CONTENT-2">
288 <p>The last error message set by the SDL library can be retrieved using the subroutine
289 <code>SDL::get_error</code>, which returns a scalar containing the text of the message if any.</p>
290
291 </div>
292 <h2 id="delay_ms">delay(ms)</h2>
293 <div id="delay_ms_CONTENT">
294 <p>This subroutine allows an application to delay further operations for atleast a
295 number of milliseconds provided as the argument.  The actual delay may be longer
296 than the specified depending on the underlying OS.</p>
297
298
299
300
301
302 </div>
303 <h1 id="STUFF_TO_BE_DONE_for_the_documentati">STUFF TO BE DONE for the documentation</h1><p><a href="#TOP" class="toplink">Top</a></p>
304 <div id="STUFF_TO_BE_DONE_for_the_documentati-2">
305 <pre>
306
307
308         SDL:: to improve
309         SDL::Video add examples, need general improvement.
310         Event.pod need to be checked against Events.pod
311         SDL::Events need to be completed
312         SDL::Cdrom need some examples. 
313         SDL::MultiThread to be created( once implemented  ). 
314         SDL::Time to be completed.
315         SDL::RW to be created.
316         SDL::Mouse need to be created.
317         SDL::Joystick need to be created.
318         SDL::Audio need to be created.
319
320 </pre>
321
322 </div>
323 </div>