3 <h3 id="TOP">Index</h3>
5 <ul><li><a href="#NAME">NAME</a>
6 <ul><li><a href="#CATEGORY">CATEGORY</a></li>
9 <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
10 <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
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>
18 <li><a href="#set_error_real_error_values">set_error_real(error, @values)</a></li>
19 <li><a href="#clear_error">clear_error()</a></li>
20 <li><a href="#version">version()</a></li>
21 <li><a href="#linked_version">linked_version</a></li>
22 <li><a href="#get_error-2">get_error()</a></li>
23 <li><a href="#delay_ms">delay(ms)</a></li>
26 <li><a href="#AUTHORS">AUTHORS</a>
31 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
32 <div id="NAME_CONTENT">
33 <p>SDL - Simple DirectMedia Layer for Perl</p>
36 <h2 id="CATEGORY">CATEGORY</h2>
37 <div id="CATEGORY_CONTENT">
41 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
42 <div id="SYNOPSIS_CONTENT">
48 <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
49 <div id="DESCRIPTION_CONTENT">
50 <p>SDL_perl is a package of perl modules that provides both functional and object orient
51 interfaces to the Simple DirectMedia Layer for Perl 5. This package does take some
52 liberties with the SDL API, and attempts to adhere to the spirit of both the SDL
53 and Perl. This document describes the low-level functional SDL_perl API. For the
54 object oriented programming interface please see the documentation provided on a
58 <h1 id="Functions_exported_by_SDL_pm">Functions exported by SDL.pm</h1><p><a href="#TOP" class="toplink">Top</a></p>
59 <div id="Functions_exported_by_SDL_pm_CONTENT">
62 <h2 id="init_flags">init(flags) </h2>
63 <div id="init_flags_CONTENT">
64 <p>As with the C language API, SDL_perl initializes the SDL environment through
65 the <code>SDL::init</code> subroutine. This routine takes a mode flag constructed through
66 the bitwise OR product of the SDL_INIT_* constants.</p>
67 <p>The constants are not exported by default. You can export them into your namespace by doing:</p>
71 <p>or access them directly:</p>
72 <pre> SDL::SDL_INIT_AUDIO;
75 <p>or by choosing the export tags below:</p>
76 <p>Export tag: ':init'</p>
85 SDL_INIT_EVERYTHING</dt>
87 SDL_INIT_NOPARACHUTE</dt>
89 SDL_INIT_JOYSTICK</dt>
93 <p><code>SDL::Init</code> returns 0 on success, or -1 on error.</p>
96 <h2 id="init_subsystem_flags">init_subsystem(flags)</h2>
97 <div id="init_subsystem_flags_CONTENT">
98 <p>After SDL has been initialized with SDL::init you may initialize uninitialized subsystems with SDL::init_subsystem.
99 The flags parameter is the same as that used in SDL::init. </p>
100 <p>SDL::init_subsystem returns 0 on success, or -1 on error.</p>
103 <h2 id="quit_subsystem_flags">quit_subsystem(flags)</h2>
104 <div id="quit_subsystem_flags_CONTENT">
105 <p>SDL::quit_subsystem allows you to shut down a subsystem that has been previously initialized by SDL::init or SDL::init_subsystem.
106 The flags tells SDL::quit_subSystem which subsystems to shut down, it uses the same values that are passed to SDL::init. </p>
107 <p>SDL::quit_subsystem doesn't returns any value.</p>
110 <h2 id="quit">quit</h2>
111 <div id="quit_CONTENT">
112 <p>Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources.</p>
113 <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>
114 <p>SDL::quit doesn't returns any value.</p>
117 <h2 id="was_init_flags">was_init(flags)</h2>
118 <div id="was_init_flags_CONTENT">
119 <p>SDL::was_init allows you to see which SDL subsytems have been initialized.
120 flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL::init for a list of subsystem flags).
121 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>
124 <h2 id="get_error">get_error()</h2>
125 <div id="get_error_CONTENT">
126 <p>The last error message set by the SDL library can be retrieved using the subroutine
127 <code>SDL::get_error</code>, which returns a scalar containing the text of the message if any.</p>
130 <h2 id="set_error_real_error_values">set_error_real(error, @values)</h2>
131 <div id="set_error_real_error_values_CONTENT">
132 <p>SDL::set_error_real sets the SDL error to a printf style formatted string.
133 it doesn't returns any values.</p>
136 <h2 id="clear_error">clear_error()</h2>
137 <div id="clear_error_CONTENT">
138 <p>SDL::clear_error deletes all information about the last SDL error. Useful if the error has been handled by the program.
139 it doesn't returns any value.</p>
142 <h2 id="version">version()</h2>
143 <div id="version_CONTENT">
144 <pre> my $version = SDL::version();
147 <p>Returns an SDL::Version object of the of the SDL library at compile time.</p>
152 my $v = SDL::version();
153 printf("got version: %d.%d.%d\n", $v->major, $v->minor, $v->patch);
161 <h2 id="linked_version">linked_version</h2>
162 <div id="linked_version_CONTENT">
163 <pre> my $linked_version = SDL::linked_version();
166 <p>Returns an SDL::Version object of the currently loaded SDL library.</p>
171 my $v = SDL::linked_version();
172 printf("got version: %d.%d.%d\n", $v->major, $v->minor, $v->patch);
177 <h2 id="get_error-2">get_error()</h2>
178 <div id="get_error_CONTENT-2">
179 <p>The last error message set by the SDL library can be retrieved using the subroutine
180 <code>SDL::get_error</code>, which returns a scalar containing the text of the message if any.</p>
183 <h2 id="delay_ms">delay(ms)</h2>
184 <div id="delay_ms_CONTENT">
185 <pre> SDL::delay(1000);
188 <p>This subroutine allows an application to delay further operations for atleast a
189 number of milliseconds provided as the argument. The actual delay may be longer
190 than the specified depending on the underlying OS.</p>
193 <h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
194 <div id="AUTHORS_CONTENT">