X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Joystick.html-inc;h=14dd677a981262c149a0532bf9bba91f4cb4230c;hb=a3de848879a5553418ed11fb193c4bf286ca7120;hp=9da305afe8c75518fbcab1776097caff800b783b;hpb=46beffd8f76fe150d946bf61c780e61de2affbdf;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Joystick.html-inc b/pages/SDL-Joystick.html-inc index 9da305a..14dd677 100644 --- a/pages/SDL-Joystick.html-inc +++ b/pages/SDL-Joystick.html-inc @@ -8,7 +8,7 @@
  • METHODS
  • +
  • AUTHORS +

  • @@ -73,7 +74,7 @@ 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)); } @@ -81,9 +82,9 @@ -

    open

    -
    -
     object SDL::Joystick::open( index );
    +

    new

    +
    +
     object SDL::Joystick->new( index );
     
     

    Opens a joystick for use within SDL. The index refers to the N'th joystick in the system. @@ -95,7 +96,7 @@ A joystick must be opened before it can be used.

    if(SDL::Joystick::num_joysticks() > 0) { # Open joystick - my $joystick = SDL::Joystick::open(0); + my $joystick = SDL::Joystick->new(0); if($joystick) { @@ -131,7 +132,7 @@ A joystick must be opened before it can be used.

     int SDL::Joystick::index( object );
     
     
    -

    Returns the index of a given SDL_Joystick structure. See SDL::Joystick::open

    +

    Returns the index of a given SDL_Joystick structure. See SDL::Joystick::new

    num_axes

    @@ -139,7 +140,7 @@ A joystick must be opened before it can be used.

     int SDL::Joystick::num_axes( object );
     
     
    -

    Return the number of axes available from a previously opened joystick. See SDL::Joystick::open

    +

    Return the number of axes available from a previously opened joystick. See SDL::Joystick::new

    num_balls

    @@ -147,7 +148,7 @@ A joystick must be opened before it can be used.

     int SDL::Joystick::num_balls( object );
     
     
    -

    Return the number of trackballs available from a previously opened joystick. See SDL::Joystick::open

    +

    Return the number of trackballs available from a previously opened joystick. See SDL::Joystick::new

    num_hats

    @@ -155,7 +156,7 @@ A joystick must be opened before it can be used.

     int SDL::Joystick::num_hats( object );
     
     
    -

    Gets the number of joystick hats from a previously opened joystick. See SDL::Joystick::open

    +

    Gets the number of joystick hats from a previously opened joystick. See SDL::Joystick::new

    num_buttons

    @@ -163,7 +164,7 @@ A joystick must be opened before it can be used.

     int SDL::Joystick::num_buttons( object );
     
     
    -

    Gets the number of joystick buttons from a previously opened joystick. See SDL::Joystick::open

    +

    Gets the number of joystick buttons from a previously opened joystick. See SDL::Joystick::new

    update

    @@ -183,7 +184,7 @@ The value returned by get_axis is a signed integer (-32768 to 32767 it may be necessary to impose certain tolerances on these values to account for jitter.

    Note: Some joysticks use axes 2 and 3 for extra buttons.

    Returns a 16-bit signed integer representing the current position of the axis.

    -
     my $joystick = SDL::Joystick::open(0);
    +
     my $joystick = SDL::Joystick->new(0);
     
      my $x_move   = SDL::Joystick::get_axis($joystick, 0);
      my $y_move   = SDL::Joystick::get_axis($joystick, 1);
    @@ -210,7 +211,7 @@ it may be necessary to impose certain tolerances on these values to account for
     		
  • SDL_HAT_LEFTDOWN
  • -
     my $joystick = SDL::Joystick::open(0);
    +
     my $joystick = SDL::Joystick->new(0);
     
      my $position = SDL::Joystick::get_hat($joystick, 0);
     
    @@ -226,7 +227,7 @@ it may be necessary to impose certain tolerances on these values to account for
     

    get_button returns the current state of the given button on the given joystick.

    Returns 1 if the button is pressed. Otherwise, 0.

    -
     my $joystick    = SDL::Joystick::open(0);
    +
     my $joystick    = SDL::Joystick->new(0);
     
      my $num_buttons = SDL::Joystick::num_buttons($joystick);
     
    @@ -250,7 +251,7 @@ it may be necessary to impose certain tolerances on these values to account for
     

    Returns 0 on success or -1 on failure

     my $delta_x  = 0;
      my $delta_y  = 0;
    - my $joystick = SDL::Joystick::open(0);
    + my $joystick = SDL::Joystick->new(0);
     
      SDL::Joystick::update();
     
    @@ -265,10 +266,15 @@ it may be necessary to impose certain tolerances on these values to account for
     
     void SDL::Joystick::close( object );
     
     
    -

    Closes a previously opened joystick. See SDL::Joystick::open

    +

    Closes a previously opened joystick. See SDL::Joystick::new

     SDL::Joystick::close($joystick) if SDL::Joystick::opened(0);
     
     
    +

    AUTHORS

    Top

    +
    +

    See AUTHORS in SDL.

    + +
    \ No newline at end of file