<li><a href="#METHODS">METHODS</a>
<ul><li><a href="#num_joysticks">num_joysticks</a></li>
<li><a href="#name">name</a></li>
-<li><a href="#open">open</a></li>
+<li><a href="#new">new</a></li>
<li><a href="#opened">opened</a></li>
<li><a href="#index">index</a></li>
<li><a href="#num_axes">num_axes</a></li>
<li><a href="#get_hat">get_hat</a></li>
<li><a href="#get_button">get_button</a></li>
<li><a href="#get_ball">get_ball</a></li>
-<li><a href="#close">close</a>
-</li>
+<li><a href="#close">close</a></li>
</ul>
</li>
+<li><a href="#AUTHORS">AUTHORS</a>
+</li>
</ul><hr />
<!-- INDEX END -->
printf("%d joysticks found\n", $num_joysticks);
- for($i = 0; i < $num_joysticks; $i++)
+ for($i = 0; $i < $num_joysticks; $i++)
{
printf("%s\n", SDL::Joystick::name($i));
}
</pre>
</div>
-<h2 id="open">open</h2>
-<div id="open_CONTENT">
-<pre> object SDL::Joystick::open( index );
+<h2 id="new">new</h2>
+<div id="new_CONTENT">
+<pre> object SDL::Joystick->new( index );
</pre>
<p>Opens a joystick for use within SDL. The <code>index</code> refers to the N'th joystick in the system.
if(SDL::Joystick::num_joysticks() > 0)
{
# Open joystick
- my $joystick = SDL::Joystick::open(0);
+ my $joystick = SDL::Joystick->new(0);
if($joystick)
{
<pre> int SDL::Joystick::index( object );
</pre>
-<p>Returns the <code>index</code> of a given <code>SDL_Joystick</code> structure. See <a href="#open">SDL::Joystick::open</a></p>
+<p>Returns the <code>index</code> of a given <code>SDL_Joystick</code> structure. See <a href="#new">SDL::Joystick::new</a></p>
</div>
<h2 id="num_axes">num_axes</h2>
<pre> int SDL::Joystick::num_axes( object );
</pre>
-<p>Return the number of axes available from a previously opened joystick. See <a href="#open">SDL::Joystick::open</a></p>
+<p>Return the number of axes available from a previously opened joystick. See <a href="#new">SDL::Joystick::new</a></p>
</div>
<h2 id="num_balls">num_balls</h2>
<pre> int SDL::Joystick::num_balls( object );
</pre>
-<p>Return the number of trackballs available from a previously opened joystick. See <a href="#open">SDL::Joystick::open</a></p>
+<p>Return the number of trackballs available from a previously opened joystick. See <a href="#new">SDL::Joystick::new</a></p>
</div>
<h2 id="num_hats">num_hats</h2>
<pre> int SDL::Joystick::num_hats( object );
</pre>
-<p>Gets the number of joystick hats from a previously opened joystick. See <a href="#open">SDL::Joystick::open</a></p>
+<p>Gets the number of joystick hats from a previously opened joystick. See <a href="#new">SDL::Joystick::new</a></p>
</div>
<h2 id="num_buttons">num_buttons</h2>
<pre> int SDL::Joystick::num_buttons( object );
</pre>
-<p>Gets the number of joystick buttons from a previously opened joystick. See <a href="/SDL-Joystick.html#open">SDL::Joystick::open</a></p>
+<p>Gets the number of joystick buttons from a previously opened joystick. See <a href="#new">SDL::Joystick::new</a></p>
</div>
<h2 id="update">update</h2>
it may be necessary to impose certain tolerances on these values to account for jitter.</p>
<p><strong>Note</strong>: Some joysticks use axes 2 and 3 for extra buttons. </p>
<p>Returns a 16-bit signed integer representing the current position of the axis.</p>
-<pre> my $joystick = SDL::Joystick::open(0);
+<pre> my $joystick = SDL::Joystick->new(0);
my $x_move = SDL::Joystick::get_axis($joystick, 0);
my $y_move = SDL::Joystick::get_axis($joystick, 1);
<li><code>SDL_HAT_LEFTDOWN</code></li>
</ul>
-<pre> my $joystick = SDL::Joystick::open(0);
+<pre> my $joystick = SDL::Joystick->new(0);
my $position = SDL::Joystick::get_hat($joystick, 0);
</pre>
<p><code>get_button</code> returns the current state of the given button on the given joystick.</p>
<p>Returns 1 if the button is pressed. Otherwise, 0. </p>
-<pre> my $joystick = SDL::Joystick::open(0);
+<pre> my $joystick = SDL::Joystick->new(0);
my $num_buttons = SDL::Joystick::num_buttons($joystick);
<p>Returns 0 on success or -1 on failure</p>
<pre> my $delta_x = 0;
my $delta_y = 0;
- my $joystick = SDL::Joystick::open(0);
+ my $joystick = SDL::Joystick->new(0);
SDL::Joystick::update();
<pre> void SDL::Joystick::close( object );
</pre>
-<p>Closes a previously opened joystick. See <a href="#open">SDL::Joystick::open</a></p>
+<p>Closes a previously opened joystick. See <a href="#new">SDL::Joystick::new</a></p>
<pre> SDL::Joystick::close($joystick) if SDL::Joystick::opened(0);
</pre>
</div>
+<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="AUTHORS_CONTENT">
+<p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a>.</p>
+
+</div>
</div>
\ No newline at end of file