X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=blobdiff_plain;f=pages%2FSDL.html-inc;h=ee6419fef1e8245f42e0b75e022cda29bf20b99b;hp=73216f2f4d5c3fa9f4c7da2798158c48ecc02bef;hb=801213bdc2b379a428fdebad07e9d404cec99a06;hpb=411e0b6a19b323b88847fbffe2323afe98e9f8dc diff --git a/pages/SDL.html-inc b/pages/SDL.html-inc index 73216f2..ee6419f 100644 --- a/pages/SDL.html-inc +++ b/pages/SDL.html-inc @@ -8,21 +8,21 @@
  • DESCRIPTION
  • CONSTANTS
  • METHODS -
    @@ -79,44 +79,59 @@ For the object oriented programming interface please see the documentation provi
    -

    init(flags)

    -
    +

    init

    +
    +
     SDL::init( $flags );
    +
    +

    As with the C language API, SDL Perl initializes the SDL environment with the SDL::init subroutine. This routine takes a mode flag constructed through the bitwise OR product of the SDL_INIT_* constants. -The flags tell SDL::init which subsystems to initialize.

    +The $flags tell SDL::init which subsystems to initialize.

     SDL::init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
     
     

    SDL::init returns 0 on success, or -1 on error.

    -

    init_subsystem(flags)

    -
    -

    After SDL has been initialized with SDL::init you may initialize any uninitialized subsystems with SDL::init_subsystem. -The flags tell SDL::init_subsystem which subsystems to initialize, and are taken in the same way as SDL::init.

    +

    init_subsystem

    +
    +
     SDL::init_subsystem( $flags );
    +
    +
    +

    After SDL has been initialized with SDL::init you may initialize any uninitialized subsystems with SDL::init_subsystem. +The $flags tell SDL::init_subsystem which subsystems to initialize, and are taken in the same way as SDL::init.

    SDL::init_subsystem returns 0 on success, or -1 on error.

    -

    quit_subsystem(flags)

    -
    +

    quit_subsystem

    +
    +
     SDL::quit_subsystem( $flags );
    +
    +

    SDL::quit_subsystem allows you to shut down a subsystem that has been previously initialized by SDL::init or SDL::init_subsystem. -The flags tell SDL::quit_subsystem which subsystems to shut down, and are taken in the same way as SDL::init.

    +The $flags tell SDL::quit_subsystem which subsystems to shut down, and are taken in the same way as SDL::init.

    SDL::quit_subsystem doesn't return any values.

    -

    quit()

    +

    quit

    +
     SDL::quit;
    +
    +

    SDL::quit Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources.

    Note: This will be called automatically when Perl exits. You don't need to call this, except if you want to initialize SDL again after this.

    SDL::quit doesn't return any values.

    -

    was_init(flags)

    -
    +

    was_init

    +
    +
     my $flags = SDL::was_init( $flags );
    +
    +

    SDL::was_init allows you to see which SDL subsytems have been initialized. -The flags tell SDL::was_init which subsystems to check, and are taken in the same way as SDL::init.

    +The $flags tell SDL::was_init which subsystems to check, and are taken in the same way as SDL::init.

    SDL::was_init returns a mask of the initialized subsystems it checks. -If flags is 0 or SDL_INIT_EVERYTHING, a mask of all initialized subsystems will be returned (this does not include SDL_INIT_EVENTTHREAD or SDL_INIT_NOPARACHUTE).

    +If $flags is 0 or SDL_INIT_EVERYTHING, a mask of all initialized subsystems will be returned (this does not include SDL_INIT_EVENTTHREAD or SDL_INIT_NOPARACHUTE).

     use SDL ':all';
     
      my $mask = SDL::was_init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
    @@ -127,49 +142,67 @@ If flags is 0 or SDL_INIT_EVERYTHING, a m
     
    -

    get_error()

    +

    get_error

    +
     my $error = SDL::get_error;
    +
    +

    Returns a scalar value containing the last error message set by the SDL library (if any).

    -

    set_error_real(error, @values)

    -
    +

    set_error_real

    +
    +
     SDL::set_error_real( $printf_format, @values )
    +
    +

    SDL::set_error_real sets the SDL error to a printf style formatted string.

    SDL::set_error_real doesn't return any values.

    -

    clear_error()

    +

    clear_error

    +
     SDL::clear_error;
    +
    +

    SDL::clear_error deletes all information about the last SDL error. This is useful if the error has been handled by the program.

    SDL::clear_error doesn't return any values.

    -

    version()

    +

    version

    +
     my $version = SDL::version;
    +
    +

    Returns an SDL::Version object of the SDL library at compile-time.

     use SDL;
      use SDL::Version;
     
    - my $v = SDL::version();
    + my $v = SDL::version;
      printf("got version: %d.%d.%d\n", $v->major, $v->minor, $v->patch);
     
     
    -

    linked_version()

    +

    linked_version

    SDL::linked_version works in the same way as SDL::version, but returns an SDL::Version object of the SDL library at link-time.

    -

    get_ticks()

    +

    get_ticks

    +
     my $ticks = SDL::get_ticks;
    +
    +

    Returns the number of milliseconds since SDL library initialization. This value wraps around if the program runs for more than 49.7 days

    -

    delay(ms)

    -
    +

    delay

    +
    +
     SDL::delay( $ms );
    +
    +

    SDL::delay waits the specified number of milliseconds before returning. The actual delay may be longer than specified depending on the underlying OS.

    SDL::delay doesn't return anything.

    @@ -179,8 +212,8 @@ The actual delay may be longer than specified depending on the underlying OS.

    -

    AUTHORS

    Top

    -
    +

    AUTHOR

    Top

    +

    magnet, kthakore, Blaizer