1;
-__END__
-
-=head1 NAME
-
-SDL_perl - Simple DirectMedia Layer for Perl
-
-=head1 SYNOPSIS
-
- use SDL;
-
-=head1 DESCRIPTION
-
-SDL_perl is a package of perl modules that provides both functional and object orient
-interfaces to the Simple DirectMedia Layer for Perl 5. This package does take some
-liberties with the SDL API, and attempts to adhere to the spirit of both the SDL
-and Perl. This document describes the low-level functional SDL_perl API. For the
-object oriented programming interface please see the documentation provided on a
-per class basis.
-
-=head1 The SDL Perl 2009 Development Team
-
-=head2 Documentation
-
- Nick: magnet
-
-=head2 Perl Development
-
- Nick: Garu
- Name: Breno G. de Oliveira
-
- Nick: Dngor
- Name: Rocco Caputo
-
- Nick: nferraz
- Name: Nelson Ferraz
-
- Nick: acme
- Name: Leon Brocard
-
- Nick: FROGGS
- Name: Tobias Leich
-
-=head2 Maintainance
-
- Nick: kthakore
- Name: Kartik Thakore
-
-=head1 MacOSX Experimental Usage
-
-Please get libsdl packages from Fink
-
- perl Build.PL
- perl Build test
- perl Build bundle
- perl Build install
-
-=head2 Running SDL Perl Scripts in MacOSX
-
-First set the PERL5LIB environment variable to the dependencies of your script
-
- %export PERL5LIB=$PERL5LIB:./lib
-
-Use the SDLPerl executable made in the bundle and call your scripts
-
- %SDLPerl.app/Contents/MacOS/SDLPerl yourScript.pl
-
-=head1 Functions exported by SDL.pm
-
-=head2 init(flags)
-
-As with the C language API, SDL_perl initializes the SDL environment through
-the C<SDL::init> subroutine. This routine takes a mode flag constructed through
-the bitwise OR product of the following constants:
-
-=over 4
-
-=item *
-INIT_AUDIO
-
-=item *
-INIT_VIDEO
-
-=item *
-INIT_CDROM
-
-=item *
-INIT_EVERYTHING
-
-=item *
-INIT_NOPARACHUTE
-
-=item *
-INIT_JOYSTICK
-
-=item *
-INIT_TIMER
-
-=back
-
-C<SDL::Init> returns 0 on success, or -1 on error.
-
-=head2 init_subsystem(flags)
-
-After SDL has been initialized with SDL::init you may initialize uninitialized subsystems with SDL::init_subsystem.
-The flags parameter is the same as that used in SDL::init.
-
-SDL::init_subsystem returns 0 on success, or -1 on error.
-
-=head2 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 tells SDL::quit_subSystem which subsystems to shut down, it uses the same values that are passed to SDL::init.
-
-SDL::quit_subsystem doesn't returns any value.
-
-=head2 quit
-
-Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources. This should always be called before you exit.
-
-SDL::quit doesn't returns any value.
-
-=head2 was_init(flags)
-
-SDL::was_init allows you to see which SDL subsytems have been initialized.
-flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL::init for a list of subsystem flags).
-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).
-
-
-=head2 get_error()
-
-The last error message set by the SDL library can be retrieved using the subroutine
-C<SDL::get_error>, which returns a scalar containing the text of the message if any.
-
-=head2 set_error(error) *need to be coded
-
-SDL::get_error sets the SDL error to a printf style formatted string.
-it doesn't returns any values.
-
-=head2 error(code) * need to be coded
-
-Sets the SDL error message to one of several predefined strings specified by code.
-
-code can be :
-
-=over 4
-
- SDL_errorcode The corresponding error string
-
- SDL_ENOMEM Out of memory
- SDL_EFREAD Error reading from datastream
- SDL_EFWRITE Error writing to datastream
- SDL_EFSEEK Error seeking in datastream
- SDL_UNSUPPORTED Unknown SDL error
- SDL_LASTERROR Unknown SDL error
- any other value Unknown SDL error
-
-
- Note 1: SDL_LASTERROR marks the highest numbered predefined error.
- Note 2: SDL also defines SDL_OutOfMemory() and SDL_Unsupported() for internal use
- which are equivalent to SDL_Error(SDL_ENOMEM) and SDL_Error(SDL_UNSUPPORTED) respectively.
-
-=back
-
-SDL::Error doesn't returns any value.
-
-
-=head2 clear_error() * need to be coded
-
-SDL::clear_error deletes all information about the last internal SDL error. Useful if the error has been handled by the program.
-it doesn't returns any value.
-
-=head2 load_object()
-
-Need to be coded.
-
-=head2 load_function()
-
-Need to be coded.
-
-=head2 unload_object()
-
-Need to be coded.
-
-=head2 VERSION()
-
-Need to be coded.
-
-=head2 version()
-
-Need to be coded.
-
-=head2 linked_version
-
-Need to be coded.
-
-=head2 get_error()
-
-The last error message set by the SDL library can be retrieved using the subroutine
-C<SDL::get_error>, which returns a scalar containing the text of the message if any.
-
-=head2 delay(ms)
-
-This subroutine allows an application to delay further operations for atleast a
-number of milliseconds provided as the argument. The actual delay may be longer
-than the specified depending on the underlying OS.
-
-
-
1;
-__END__;
-
-=pod
-
-=head1 NAME
-
-SDL::App - a SDL perl extension
-
-=head1 SYNOPSIS
-
- use SDL;
- use SDL::Event;
- use SDL::App;
-
- my $app = new SDL::App (
- -title => 'Application Title',
- -width => 640,
- -height => 480,
- -depth => 32 );
-
-This is the manual way of doing things
-
- my $event = new SDL::Event; # create a new event
-
- $event->pump();
- $event->poll();
-
- while ($event->wait()) {
- my $type = $event->type(); # get event type
- print $type;
- exit if $type == SDL_QUIT;
- }
-An alternative to the manual Event processing is the L<SDL::App::loop> .
-
-=head1 DESCRIPTION
-
-L<SDL::App> controls the root window of the of your SDL based application.
-It extends the L<SDL::Surface> class, and provides an interface to the window
-manager oriented functions.
-
-=head1 METHODS
-
-=head2 new
-
-C<SDL::App::new> initializes the SDL, creates a new screen,
-and initializes some of the window manager properties.
-C<SDL::App::new> takes a series of named parameters:
-
-=over 4
-
-=item *
-
--title
-
-=item *
-
--icon_title
-
-=item *
-
--icon
-
-=item *
-
--width
-
-=item *
-
--height
-
-=item *
-
--depth
-
-=item *
-
--flags
-
-=item *
-
--resizeable
-
-=back
-
-=head2 title
-
-C<SDL::App::title> takes 0, 1, or 2 arguments. It returns the current
-application window title. If one parameter is passed, both the window
-title and icon title will be set to its value. If two parameters are
-passed the window title will be set to the first, and the icon title
-to the second.
-
-=head2 delay
-
-C<SDL::App::delay> takes 1 argument, and will sleep the application for
-that many ms.
-
-=head2 ticks
-
-C<SDL::App::ticks> returns the number of ms since the application began.
-
-=head2 error
-
-C<SDL::App::error> returns the last error message set by the SDL.
-
-=head2 resize
-
-C<SDL::App::resize> takes a new height and width of the application
-if the application was originally created with the -resizable option.
-
-=head2 fullscreen
-
-C<SDL::App::fullscreen> toggles the application in and out of fullscreen mode.
-
-=head2 iconify
-
-C<SDL::App::iconify> iconifies the applicaiton window.
-
-=head2 grab_input
-
-C<SDL::App::grab_input> can be used to change the input focus behavior of
-the application. It takes one argument, which should be one of the following:
-
-=over 4
-
-=item *
-SDL_GRAB_QUERY
-
-=item *
-SDL_GRAB_ON
-
-=item *
-SDL_GRAB_OFF
-
-=back
-
-=head2 loop
-
-C<SDL::App::loop> is a simple event loop method which takes a reference to a hash
-of event handler subroutines. The keys of the hash must be SDL event types such
-as SDL_QUIT(), SDL_KEYDOWN(), and the like. The event method recieves as its parameter
-the event object used in the loop.
-
- Example:
-
- my $app = new SDL::App -title => "test.app",
- -width => 800,
- -height => 600,
- -depth => 32;
-
- my %actions = (
- SDL_QUIT() => sub { exit(0); },
- SDL_KEYDOWN() => sub { print "Key Pressed" },
- );
-
- $app->loop(\%actions);
-
-=head2 sync
-
-C<SDL::App::sync> encapsulates the various methods of syncronizing the screen with the
-current video buffer. C<SDL::App::sync> will do a fullscreen update, using the double buffer
-or OpenGL buffer if applicable. This is prefered to calling flip on the application window.
-
-=head2 attribute ( attr, [value] )
-
-C<SDL::App::attribute> allows one to set and get GL attributes. By passing a value
-in addition to the attribute selector, the value will be set. C<SDL:::App::attribute>
-always returns the current value of the given attribute, or croaks on failure.
-
-=head1 AUTHOR
-
-David J. Goehrig
-Kartik Thakore
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Surface> L<SDL::Event> L<SDL::OpenGL>
-
-=cut
}
1;
-
-__END__;
-
-=pod
-
-
-
-=head1 NAME
-
-SDL::Cdrom - a SDL perl extension for managing CD-ROM drives
-
-=head1 SYNOPSIS
-
- use SDL::Cdrom;
- $cdrom = SDL::Cdrom->new(0);
- $cdrom->play();
-
-=head1 EXPORTS
-
-=over 4
-
-=item *
-
-C<cd_num_drives>.
-
-=back
-
-=head1 DESCRIPTION
-
-Create a new SDL::Cdrom object. The passed $id is the number of the drive,
-whereas 0 is the first drive etc.
-
- use SDL::Cdrom;
- my $drive => SDL::Cdrom->new($id);
-
-=head1 METHODS
-
-=head2 cd_num_drives()
-
-Returns the number of CD-ROM drives present.
-
-=head2 name()
-
-Returns the system dependent name of the CD-ROM device.
-
-=head2 status()
-
-Return the status of the drive.
-
-=head2 play()
-
-Play a track.
-
-=head2 pause()
-
-Pause the playing.
-
-=head2 resume()
-
-Resume the playing.
-
-=head2 stop()
-
-Stop the playing.
-
-=head2 eject()
-
-Eject the medium in the drive.
-
-=head2 id()
-
-Return the ID of the drive.
-
-=head2 num_tracks()
-
-Return the number of tracks on the medium.
-
-=head2 track()
-
-Returns the track description
-
-=head2 current()
-
-Return the current played track number.
-
-=head2 current_frame()
-
-Return the current frame.
-
-=head1 AUTHORS
-
-David J. Goehrig
-Documentation by Tels <http://bloodgate.com/>.
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Mixer> L<SDL::App>.
-
-=cut
1;
-__END__
-
-=pod
-
-=head1 NAME
-
-SDL::Color - Format independent color description
-
-=head1 SYNOPSIS
-
- my $black = SDL::Color->new( 0, 0, 0);
- my $color = SDL::Color->new(255, 0, 0);
- my $r = $color->r; # 255
- my $g = $color->g; # 0
- my $b = $color->b; # 0
- $color->g(255);
- $color->b(255);
- # $color is now white
-
-=head1 DESCRIPTION
-
-C<SDL_Color> describes a color in a format independent way.
-
-=head1 METHODS
-
-=head2 new ( $r, $g, $b )
-
-The constructor creates a new color with the specified red, green and
-blue values:
-
- my $color = SDL::Color->new(255, 0, 0);
-
-=head2 r
-
-If passed a value, this method sets the red component of the color;
-if not, it returns the red component of the color:
-
- my $r = $color->r; # 255
- $color->r(128);
-
-=head2 g
-
-If passed a value, this method sets the green component of the color;
-if not, it returns the green component of the color:
-
- my $g = $color->g; # 255
- $color->g(128);
-
-=head2 b
-
-If passed a value, this method sets the blue component of the color;
-if not, it returns the blue component of the color:
-
- my $b = $color->b; # 255
- $color->b(128);
-
-=head1 SEE ALSO
-
-L<SDL::Surface>
-
-=cut
}
1;
-
-__END__;
-
-=pod
-
-
-
-=head1 NAME
-
-SDL::Cursor - a SDL perl extension
-
-=head1 SYNOPSIS
-
- $cursor = SDL::Cursor->new(
- -data => new SDL::Surface "cursor.png",
- -mask => new SDL::Surface "mask.png",
- -x => 0, -y => 0 );
- $cusor->use;
-
-=head1 DESCRIPTION
-
-the SDL::Cursor module handles mouse cursors, and provide the developer to
-use custom made cursors. Note that the cursors can only be in black and
-white.
-
-=head1 METHODS
-
-=head2 new( -data => $surface_data, -mask => $surface_mask, x => $x, y => $y)
-
-Creates a new cursor. The <C>-data</C> and <C>-mask</C> parameters should be both black and white pictures. The height and width of these surfaces should be a multiple of 8. The <C>-x</C> and <C>-y</C> are the coordinates of the cursor 'hot spot'.
-
-=head2 warp($x, $y)
-
-Set the position of the cursor at the <C>$x</C>, <C>$y</C> coordinates in the application window.
-
-=head2 use()
-
-Set the cursor as the active cursor.
-
-=head2 get()
-
-When used statically <C>SDL::Cursor::get()</C>, it will return the instance of the current cursor in use. Called as a method, it will return itself.
-
-This method can be useful if you are dealing with several cursors.
-
-=head2 show($toggle)
-
-Set the visibility of the cursor. A false value will make the cursor
-invisible in the Application window. A true value will show it back.
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Surface>
-
-=cut
}
1;
-
-__END__;
-
-=pod
-
-=head1 NAME
-
-SDL::Event - a SDL perl extension
-
-=head1 SYNOPSIS
-
- use SDL::Event;
- my $event = new SDL::Event; # create a new event
- $event->pump(); # pump all events from SDL Event Queue
- $event->poll(); # Get the top one from the queue
- while ($event->wait()) {
- my $type = $event->type(); # get event type
- # ... handle event
- exit if $type == SDL_QUIT;
- }
-
-=head1 DESCRIPTION
-
-C<SDL::Event> offers an object-oriented approach to SDL events. By creating
-an instance of SDL::Event via new() you can wait for events, and then determine
-the type of the event and take an appropriate action.
-
-=head1 EXAMPLE
-
-Here is an example of a simple event handler loop routine.
-See also L<SDL::App::loop>.
-
- sub loop {
- my ($self,$href) = @_;
- my $event = new SDL::Event;
- while ( $event->wait() ) {
- # ... insert here your event handling like:
- if ( ref($$href{$event->type()}) eq "CODE" ) {
- &{$$href{$event->type()}}($event);
- $self->sync();
- }
- }
- }
-
-=head1 METHODS
-
-=head2 new()
-
-Create a new event object.It returns a SDL::Event.
-
-=head2 type()
-
-Returns the type of the event, see list of exported symbols for which are
-available.
-
-=head2 pump()
-
-SDL::Events::pump gathers all the pending input information from devices and places
-it on the event queue.
-Without calls to pump no events would ever be placed on the queue.
-Often the need for calls to pump is hidden from the user
-since C</SDL::Events::poll> and C<SDL::Events::wait_event implicitly call pump.
-However, if you are not polling or waiting for events (e.g. you are filtering them),
-then you must call pump force an event queue update.
-pump doesn't return any value and doesn't take any parameters.
-
-Note: You can only call this function in the thread that set the video mode.
-
-
-=head2 poll(event)
-
-Polls for currently pending events.
-If event is not undef, the next event is removed from the queue and returned as a C< SDL::Event>.
-As this function implicitly calls C<SDL::Events::pump>, you can only call this function in the thread that set the video mode.
-it take a SDL::Event as first parameter.
-
-=head2 wait(event)
-
-Waits indefinitely for the next available event, returning undef if there was an error while waiting for events,
-a L< SDL::Event> otherwise.
-If event is not NULL, the next event is removed.
-As this function implicitly calls L<SDL::Events::pump>, you can only call this function in the thread that set the video mode.
-WaitEvent take a SDL::Event as first parameter.
-
-=head2 set( type, state )
-
-Set the state for all events of the given event's type
-
-=head2 set_unicode( toggle )
-
-Toggle unicode on the event.
-
-=head2 set_key_repeat( delay, interval)
-
-Sets the delay and intervall of the key repeat rate (e.g. when a user
-holds down a key on the keyboard).
-
-=head2 active_gain(event)
-
-active_gain return the active gain from the SDL::Event given as first parameter.
-
-=head2 active_state(event)
-
-active_state return the active state from the SDL::Event given as first parameter.
-
-=head2 key_state(event)
-
-key_state return the active key state from the SDL::Event given as first parameter.
-
-
-=head2 key_sym(key)
-
-key_sym return the key pressed/released information from the SDL::Event given as first parameter.
-
-=head2 get_key_name(key)
-
-get_key_name get the name of an SDL virtual keysym.
-it returns the key name.
-
-=head2 key_mod(event)
-
-key_mod return the mod keys pressed information from the SDL::Event given as first parameter.
-
-=head2 key_unicode(event)
-
-key_unicode return the unicode translated keys pressed/released information from the SDL::Event given as first parameter.
-
-=head2 key_scancode(event) * to move in SDL::Game::Keyboard
-
-key_scancode return the hardware specific keyboard scan code from the SDL::Event given as first parameter.
-
-=head2 motion_state(event) * to move in SDL::Game::Mouse
-
-motion_state return the state of the mouse button from the SDL::Event given as first parameter.
-
-=head2 motion_x(event) * to move in SDL::Game::Mouse
-
-Returns the motion of the mouse in X direction as an absolute value.
-It take a SDL::Event as first parameter.
-
-=head2 motion_y(event) * to move in SDL::Game::Mouse
-
-Returns the motion of the mouse in Y direction as an absolute value.
-It take a SDL::Event as first parameter.
-
-=head2 motion_xrel(event) * to move in SDL::Game::Mouse
-
-Returns the motion of the mouse in X direction as a relative value.
-It take a SDL::Event as first parameter.
-
-=head2 motion_yrel(event) * to move in SDL::Game::Mouse
-
-Returns the motion of the mouse in Y direction as a relative value.
-It take a SDL::Event as first parameter.
-
-=head2 button_state(event) * to move in SDL::Game::Mouse
-
-Returns the state of the mouse buttons.
-It take a SDL::Event as first parameter.
-
-=head2 button_x(event) * to move in SDL::Game::Mouse
-
-Return the X position of the mouse at keypress.it take a SDL::Event as first parameter.
-
-=head2 button_y(event) * to move in SDL::Game::Mouse
-
-Return the Y position of the mouse at keypress.it take a SDL::Event as first parameter.
-
-=head2 button(event) * to move in SDL::Game::Mouse
-
-Return the mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT, SDL_BUTTON_WHEELUP, SDL_BUTTON_WHEELDOWN)
-
-=head1 AUTHOR
-
-David J. Goehrig
-Documentation by Tels <http://bloodgate.com/>
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::App>
-
-=cut
}
1;
-
-__END__;
-
-=pod
-
-
-=head1 NAME
-
-SDL::Font - a SDL perl extension
-
-=head1 SYNOPSIS
-
- $font = new Font "Font.png";
- $font->use();
-
-=head1 DESCRIPTION
-
-L<SDL::Font> provides an interface to loading and using SFont style
-fonts with L<SDL::Surface> objects.
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Surface>
-
-=cut
}
1;
-
-__END__;
-
-=pod
-
-=head1 NAME
-
-SDL::Palette - a perl extension
-
-=head1 DESCRIPTION
-
-L<SDL::Palette> provides an interface to the SDL_Palette structures,
-and can be used to set the color values of an existing palette's indexes.
-
-=head1 METHODS
-
-=head2 blue ( index, [value] )
-
-Fetches and sets the blue component of the color at index.
-
-=head2 green ( index, [value] )
-
-Fetches and sets the green component of the color at index.
-
-=head2 red ( index, [value] )
-
-Fetches and sets the red component of the color at index.
-
-=head2 color ( index, [ r, g, b ] )
-
-Fetches and sets the RGB, returns an SDL_Color *.
-
-=head2 size
-
-Returns the size of the palette.
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Color> L<SDL::Surface>
-
-=cut
}
1;
-
-__END__;
-
-=pod
-
-
-=head1 NAME
-
-SDL::MPEG - a SDL perl extension
-
-=head1 SYNOPSIS
-
- $info = new SDL::MPEG -from => $mpeg;
-
-=head1 DESCRIPTION
-
-C<SDL::MPEG> provides an interface to quering the status
-of a SMPEG stream.
-
-=head2 METHODS
-
-=over 4
-
-=item *
-
-C<SDL::MPEG::has_audio> returns true if it has audio track
-
-=item *
-
-C<SDL::MPEG::has_video> returns true if it has a video track
-
-=item *
-
-C<SDL::MPEG::width> returns the width of the video in pixels
-
-=item *
-
-C<SDL::MPEG::height> returns the height of the video in pixels
-
-=item *
-
-C<SDL::MPEG::size> returns the total size of the clip in bytes
-
-=item *
-
-C<SDL::MPEG::offset> returns the offset into the clip in bytes
-
-=item *
-
-C<SDL::MPEG::frame> returns the offset into the clip in fames
-
-=item *
-
-C<SDL::MPEG::fps> returns the play rate in frames per second
-
-=item *
-
-C<SDL::MPEG::time> returns the current play time in seconds
-
-=item *
-
-C<SDL::MPEG::length> returns the total play time in seconds
-
-=back
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-perl(1) SDL::Video(3)
-
-=cut
-
}
1;
-
-__END__;
-
-=pod
-
-=head1 NAME
-
-SDL::Mixer - a SDL perl extension
-
-=head1 SYNOPSIS
-
- $mixer = new SDL::Mixer -frequency => MIX_DEFAULT_FREQUENCY,
- -format => MIX_DEFAULT_FORMAT,
- -channels => MIX_DEFAULT_CHANNELS,
- -size => 4096;
-
-=head1 DESCRIPTION
-
-SDL::Mixer allows you access to the SDL mixer library, enablig sound and
-music volume setting, playing, pausing and resuming, as well as fading
-the sound and music in and out.
-
-=head1 METHODS
-
-=head2 new()
-
- $mixer = SDL::Mixer->new( -frequency => MIX_DEFAULT_FREQUENCY,
- -format => MIX_DEFAULT_FORMAT,
- -channels => MIX_DEFAULT_CHANNELS,
- -size => 4096);
-
-Creates a new SDL::Mixer object. C<$size> is the buffer size in bytes.
-
-=head2 query_spec()
-
- my $specs = SDL::Mixer::query_spec();
-
-Returns a hash reference, containing the following keys and their respective
-values:
-
- -status
- -frequency
- -channels
- -format
-
-=head2 reserve_channels
-
- $mixer->reserve_channels(4);
-
-Reserve so many channels.
-
-=head2 allocate_channels()
-
- $mixer->reserve_channels(2);
-
-Allocate so many channels.
-
-=head2 group_channel(channel,group)
-
-Group the channel number C<$channel> into group C<$group>.
-
-=head2 group_channels(from,to,group)
-
-Groups a range of channels
-
-=head2 group_available(group)
-
-Return true when the group is available.
-
-=head2 group_count(group)
-
-Returns the number of channels in the group
-
-=head2 group_oldest()
-
-
-=head2 group_newer()
-
-
-=head2 play_channel()
-
-
-=head2 play_music()
-
-Play C<$music> C<$loop> times.
-
-=head2 fade_in_channel(channel,chunk,loops,ms,ticks)
-
-Fades a channel in
-
-=head2 fade_in_music(music,loops,ms)
-
-Fades the music in over a number of ms, looping as it does
-
-=head2 channel_volume(channel,volume)
-
-Sets the volume for a single channel
-
-=head2 mucis_volume(volume)
-
-Set the volume for the music.
-
-=head2 halt_channel(channel)
-
-Stops a specific channel
-
-=head2 halt_group(group)
-
-Stops a group of channels
-
-=head2 halt_music()
-
-Stops the music
-
-=head2 channel_expire(channel,ticks)
-
-Ignores the channel after C<ticks> has expired
-
-=head2 fade_out_channel(channel,ms)
-
-Fade the channel number C<$channel> in C<$ms> ms out.
-
-=head2 fade_out_group(group,ms)
-
-Fade the channel group C<$group> in C<$ms> ms out.
-
-=head2 fade_out_music(ms)
-
-Fade the music in C<$ms> ms out.
-
-=head2 fading_music()
-
-Return true when the music is currently fading in or out.
-
-=head2 fading_channel()
-
-Return true when the channel number C<$channel> is currently fading in or out.
-
-=head2 pause( channel )
-
-Pause the channel C<$channel>.
-
-=head2 resume(channel)
-
-Resume the channel C<$channel>.
-
-=head2 paused()
-
-Return true when the channel is currently paused.
-
-=head2 pause_music()
-
-Pause the music play.
-
-=head2 resume_music()
-
-Resume the music play.
-
-=head2 rewind_music()
-
-Resets the music file to the beginning
-
-=head2 music_paused()
-
-Return true when the music is currently paused.
-
-=head2 playing()
-
-Return true when the channel is currently playing.
-
-=head2 playing_music ()
-
-Return true when the music is currently playing.
-
-=head1 set_panning($channel, $left, $right)
-
-Sets the volume for the left or right channels. To do true panning:
-
- $mixer->set_panning($channel, $left, 254 - $left);
-
-=head1 AUTHORS
-
-David J. Goehrig, basic doc added by Tels <http://bloodgate.com>.
-
-=head1 SEE ALSO
-
-L<perl>, L<SDL::Music> and L<SDL::Sound>.
-
-=cut
1;
-__END__;
-
-=pod
-
-=head1 NAME
-
-SDL::Music - a perl extension
-
-=head1 DESCRIPTION
-
-L<SDL::Music> is used to load music files for use with L<SDL::Mixer>.
-To load a music file one simply creates a new object passing the filename
-to the constructor:
-
- my $music = new SDL::Music 'my_song.ogg';
-
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Mixer>
-
-=cut
1;
-__END__;
-
-=pod
-
-
-
-=head1 NAME
-
-SDL::OpenGL - a perl extension
-
-=head1 DESCRIPTION
-
-L<SDL::OpenGL> is a perl module which when used by your application
-exports the gl* and glu* functions into your application's primary namespace.
-Most of the functions described in the OpenGL 1.3 specification are currently
-supported in this fashion. As the implementation of the OpenGL bindings that
-comes with SDL_perl is largely type agnositic, there is no need to decline
-the function names in the fashion that is done in the C API. For example,
-glVertex3d is simply glVertex, and perl just does the right thing with regards
-to types.
-
-=head1 CAVEATS
-
-The following methods work different in Perl than in C:
-
-=over 2
-
-=item glCallLists
-
- glCallLists(@array_of_numbers);
-
-Unlike the C function, which get's passed a count, a type and a list of
-numbers, the Perl equivalent only takes a list of numbers.
-
-Note that this is slow, since it needs to allocate memory and construct a
-list of numbers from the given scalars. For a faster version see
-L<glCallListsString>.
-
-=back
-
-The following methods exist in addition to the normal OpenGL specification:
-
-=over 2
-
-=item glCallListsString
-
- glCallListsString($string);
-
-Works like L<glCallLists()>, except that it needs only one parameter, a scalar
-holding a string. The string is interpreted as a set of bytes, and each of
-these will be passed to glCallLists as GL_BYTE. This is faster than
-glCallLists, so you might want to pack your data like this:
-
- my $lists = pack("C", @array_of_numbers);
-
-And later use it like this:
-
- glCallListsString($lists);
-
-=back
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::App>
-
-=cut
1;
-__END__
-
-=pod
-
-=head1 NAME
-
-SDL::Overlay - YUV Video overlay
-
-=head1 SYNOPSIS
-
-First import the following modules to get access to constants and functions needed for overlay.
-
- use SDL;
- use SDL::Video;
- use SDL::Overlay;
-
-Init the video susbsystem.
-
- SDL::Init(SDL_INIT_VIDEO);
-
-Create a display to use.
-
- my $display = SDL::SetVideoMore(640, 480, 32, SDL_SWSURFACE);
-
-Create and attach the display to a new overlay
- my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display);
-
-=head1 DESCRIPTION
-
-A C<SDL_Overlay> allows for video rendering on an C<SDL_Surface> which is a display.
-
-The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.
-
-=head1 METHODS
-
-=head2 new ( $width, $height, $YUV_flag, $display)
-
-The constructor creates a SDL::Overlay of the specified width, height and format (see C<YUV_Flags> list below of available formats), for the provided display.
-
-Note the 'display' argument needs to actually be the surface created by C<SDL::Video::SetVideoMode> otherwise this function will segfault.
-
- my $overlay = SDL::Overlay->new( $width, $height, $YUV_flag, $display );
-
-=head3 YUV_Flags
-
-More information on YUV formats can be found at L<http://www.fourcc.org/indexyuv.htm> .
-
-=over 4
-
-=item *
-SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */
-
-=item *
-SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */
-
-=item *
-SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */
-
-=item *
-SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */
-
-=item *
-SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */
-
-=back
-
1;
-__END__
-
-=pod
-
-=head1 NAME
-
-SDL::Palette - a perl extension
-
-=head1 DESCRIPTION
-
-L<SDL::Palette> provides an interface to the C<SDL_Palette> structures,
-and can be used to set the color values of an existing palette's indexes.
-
-=head1 METHODS
-
-=head2 ncolors ( )
-
-Fetches the number of colors in palette
-
-=head2 colors ( index )
-
-Fetches an array of colors in palette
-
-=head2 color_index ( index )
-
-Fetches the SDL_Color at the provide index in palette
-
-=head2 size
-
-Returns the size of the palette.
-
-
-=head1 SEE ALSO
-
-L<SDL::Color> L<SDL::Surface>
-
-=cut
bootstrap SDL::PixelFormat;
1;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-SDL::PixelFormat - Stores surface format information
-
-=head1 SYNOPSIS
-
- my $surface = SDL::Surface->new( ...
- $surface->format; #this returns the PixelFormat object attached to this surface
-
-PixelFormat is only created in a C<SDL::Surface>. This module only provides getters to the surface's pixelformat. Later on we will provide setting capability.
-
-
-=head1 DESCRIPTION
-
-An C<SDL::PixelFormat > stores surface format information
-
-=head1 METHODS
-
-=head2 palette
-
- $surface->format->palette;
-
-Returns the C<SDL_Palette> and L<SDL::Palette> of the format of the surface.
-
-=head2 BitsPerPixel
-
- $surface->format->BitsPerPixel;
-
-The number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32. (1 to 7 are not allowed when creating a surface or open a video mode
-
-=head2 BytesPerPixel
-
- $surface->format->BytesPerPixel;
-
-The number of bytes used to represent each pixel in a surface. Usually one to four.
-
-=head2 [RGBA]loss
-
- $surface->format->Rloss; #red loss
- $surface->format->Bloss; #blue loss
- $surface->format->Gloss; #green loss
- $surface->format->Aloss; #alpha loss
-
-Precision loss of each color component (2[RGBA]loss)
-
-=head2 [RGBA]shift
-
- $surface->format->Rshift; #red shift
- $surface->format->Bshift; #blue shift
- $surface->format->Gshift; #green shift
- $surface->format->Ashift; #alpha shift
-
-Binary left shift of each color component in the pixel value
-
-
-=head2 [RGBA]mask
-
- $surface->format->Rmask; #red mask
- $surface->format->Bmask; #blue mask
- $surface->format->Gmask; #green mask
- $surface->format->Amask; #alpha mask
-
-Binary left shift of each color component in the pixel value
-
-=head2 colorkey
-
- $surface->format->colorkey;
-
-Pixel value of transparent pixels.
-
-=head2 alpha
-
- $surface->format->alpha;
-
-Overall surface alpha value
-
-
-
-=head1 SEE ALSO
-
-L<SDL::Surface>
-
-=cut
bootstrap SDL::Rect;
1;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-SDL::Rect - Defines a rectangular area
-
-=head1 SYNOPSIS
-
- my $rect = SDL::Rect->new( 0, 0, 0, 0 );
- $rect->x(1);
- $rect->y(2);
- $rect->w(3);
- $rect->h(4);
- my $x = $rect->x; # 1
- my $y = $rect->y; # 2
- my $w = $rect->w; # 3
- my $h = $rect->h; # 4
-
-=head1 DESCRIPTION
-
-An C<SDL_Rect> defines a rectangular area of pixels.
-
-=head1 METHODS
-
-=head2 new ( $x, $y, $w, $h )
-
-The constructor creates a new rectangle with the specified x, y, w, h
-values:
-
- my $rect = SDL::Rect->new( 0, 0, 0, 0 );
-
-=head2 x
-
-If passed a value, this method sets the x component of the rectangle;
-if not, it returns the x component of the rectangle:
-
- my $x = $rect->x; # 255
- $rect->x(128);
-
-=head2 y
-
-If passed a value, this method sets the y component of the rectangle;
-if not, it returns the y component of the rectangle:
-
- my $y = $rect->y; # 255
- $rect->y(128);
-
-=head2 w
-
-If passed a value, this method sets the w component of the rectangle;
-if not, it returns the w component of the rectangle:
-
- my $w = $rect->w; # 255
- $rect->w(128);
-
-=head2 h
-
-If passed a value, this method sets the h component of the rectangle;
-if not, it returns the h component of the rectangle:
-
- my $h = $rect->h; # 255
- $rect->h(128);
-
-=head1 SEE ALSO
-
-L<SDL::Surface>
-
-=cut
bootstrap SDL::SFont;
1;
-
-__END__;
-
-=pod
-
-
-
-=head1 NAME
-
-SDL::SFont - a perl extension
-
-=head1 DESCRIPTION
-
-
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::App>
-
-=cut
}
1;
-
-__END__;
-
-=pod
-
-
-=head1 NAME
-
-SDL::SMPEG - a SDL perl extension
-
-=head1 SYNOPSIS
-
- $video = new SDL::SMPEG ( -name => 'pr0n.mpg' );
-
-=head1 DESCRIPTION
-
-C<SDL::SMPEG> adds support for MPEG video to your
-SDL Perl application. SMPEGs are objects bound to
-surfaces, whose playback is controled through the
-object's interface.
-
-=head2 METHODS
-
-
-=over 4
-
-=item *
-
-C<SDL::SMPEG::error()> returns any error messages associated with playback
-
-=item *
-
-C<SDL::SMPEG::audio(bool)> enables or disables audio playback, (on by default)
-
-=item *
-
-C<SDL::SMPEG::video(bool)> enables or disable video playback, (on by default)
-
-=item *
-
-C<SDL::SMPEG::loop(bool)> enables or disable playback looping (off by default)
-
-=item *
-
-C<SDL::SMPEG::volume(int)> set the volume as per the mixer volume
-
-=item *
-
-C<SDL::SMPEG:display(surface)> binds the clip to a display surface
-
-=item *
-
-C<SDL::SMPEG::scale([x,y]|[surface]|int)> scales the clip by either x,y
-factors, scales to the image dimensions, or a single scalar.
-
-=item *
-
-C<SDL::SMPEG::play()> plays the video clip, call C<SDL::SMPEG::display()> before playing
-
-=item *
-
-C<SDL::SMPEG::pause()> pauses video playback
-
-=item *
-
-C<SDL::SMPEG::stop()> stops video playback
-
-=item *
-
-C<SDL::SMPEG::rewind()> resets the clip to the beginning
-
-=item *
-
-C<SDL::SMPEG::seek(offset)> seeks to a particular byte offset
-
-=item *
-
-C<SDL::SMPEG::skip(time)> skips to a particular time
-
-=item *
-
-C<SDL::SMPEG::region(rect)> takes a SDL::Rect and defines the display area
-
-=item *
-
-C<SDL::SMPEG::frame(int)> renders a specific frame to the screen
-
-=item *
-
-C<SDL::SMPEG::info()> returns a new C<SDL::MPEG> object reflecting the current status
-
-=item *
-
-C<SDL::SMPEG::status()> returns either SMPEG_PLAYING or SMPEG_STOPPED or SMPEG_ERROR
-
-=back
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-perl(1) SDL::Surface(3) SDL::MPEG(3)
-
-=cut
-
}
1;
-
-__END__;
-
-=pod
-
-
-
-=head1 NAME
-
-SDL::Sound - a perl extension
-
-=head1 DESCRIPTION
-
-L<SDL::Sound> is a module for loading WAV files for sound effects.
-The file can be loaded by creating a new L<SDL::Sound> object by
-passing the filename to the constructor;
-
- my $sound = new SDL::Sound 'my_sfx.wav';
-
-=head1 METHODS
-
-=head2 volume ( value )
-
-Sets the volume of the sample.
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Mixer>
-
-=cut
bootstrap SDL::Surface;
1;
-
-__END__
-=head1
-There C<SDL_Surface>
if ( SDL::TTFInit() < 0);
1;
-
-__END__;
-
-=head1 NAME
-
-SDL::TTFont - a SDL perl extension
-
-=head1 SYNOPSIS
-
- $font = SDL::TTFont->new( -name => "Utopia.ttf", -size => 18 );
-
-=head1 DESCRIPTION
-
-L<< SDL::TTFont >> is a module for applying true type fonts to L<< SDL::Surface >>.
-
-=head1 METHODS
-
-=head2 new
-
-Instanciates a new font surface. It accepts the following parameters:
-
-=head3 -name
-
-=head3 -n
-
-The font filename (possibly with proper path) to be used. B<< This options is mandatory >>.
-
-=head3 -size
-
-=head3 -s
-
-The font size (height, in pixels) to be used. B<< This option is mandatory >>.
-
-=head3 -foreground
-
-=head3 -fg
-
-Foreground color for the font surface (i.e. the actual font color). It expects a
-SDL::Color value. If omitted, black is used as font color.
-
-=head3 -background
-
-=head3 -bg
-
-Background color for the font surface (i.e. the font background color). It expects
-a SDL::Color value. If omitted , white is used for the background.
-
-=head3 -mode
-
-=head3 -m
-
-Font mode. If omitted, SDL::TEXT_SHADED is used. Note that this class provides
-human friendly accessors for setting different modes, so you should probably use
-them instead. See below for further details.
-
-=head2 Text Modes
-
-The SDL::TTFont accepts three different types (shaded, solid, blended) for
-three different encodings (text, utf8, unicode).
-
- $font->text_shaded; # sets mode to SDL::TEXT_SHADED
- $font->text_solid; # sets mode to SDL::TEXT_SOLID
- $font->text_blended; # sets mode to SDL::TEXT_BLENDED
-
- $font->utf8_shaded; # sets mode to SDL::UTF8_SHADED
- $font->utf8_solid; # sets mode to SDL::UTF8_SOLID
- $font->utf8_blended; # sets mode to SDL::UTF8_BLENDED
-
- $font->unicode_shaded; # sets mode to SDL::UNICODE_SHADED
- $font->unicode_solid; # sets mode to SDL::UNICODE_SOLID
- $font->unicode_blended; # sets mode to SDL::UNICODE_BLENDED
-
-=head2 Text Style
-
-You may also smoothly change your font style by calling any of the following
-methods:
-
- $font->normal; # resets font styling, making text "normal"
- $font->bold; # sets bold style for font
- $font->italic; # sets italic style for font
- $font->underline; # sets underline style for font
-
-
-=head2 Ascent/Descent values
-
-Ascent is the number of pixels from the font baseline to the top of the font, while
-descent is the number of pixels from the font baseline to the bottom of the font.
-
- $font->ascent; # height in pixels of the font ascent
- $font->descent; # height in pixels of the font descent
-
-=head2 height
-
- my $height = $font->height;
-
-Returns the height, in pixels, of the actual rendered text. This is the
-average size for each glyph in the font.
-
-=head2 width(@text)
-
- my $width = $font->width("Choose your destiny");
-
-Returns the dimensions needed to render the text. This can be used to help
-determine the positioning needed for text before it is rendered. It can also
-be used for wordwrapping and other layout effects.
-
-Be aware that most fonts - notably, non-monospaced ("ms") ones - use kerning
-which adjusts the widths for specific letter pairs. For example, the width
-for "ae" will not always match the width for "a" + "e".
-
-=head2 print ($surface, $top, $left, @text)
-
-Directly draws text to an existing surface. Receives the target L<< SDL::Surface >>
-object and the relative top (y) and left (x) coordinates to put the text in.
-The last parameter may be a string or an array or strings with the text to be
-written.
-
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl>, L<SDL>, L<< SDL::Surface >>
$$self{-routine} = sub { &$func; $$self{-delay}};
}
$$self{-timer} = SDL::NewTimer($$self{-delay},$$self{-routine});
- croak "Could not create timer, ", SDL::GetError(), "\n"
+ croak "Could not create timer, ", SDL::geterror(), "\n"
unless ($self->{-timer});
bless $self,$class;
return $self;
}
1;
-
-__END__;
-
-=pod
-
-
-=head1 NAME
-
-SDL::Timer - a SDL perl extension to handle timers
-
-=head1 SYNOPSIS
-
- $timer = new SDL::Timer { print "tick"; 4000; } -delay => 4000;
-
-=head1 DESCRIPTION
-
-C<SDL::Timer> provides an abstract interface to the SDL::Timer
-callback code. SDL::Timer::new requires a subroutine and a delay
-at which is the initial interval between the creation of the
-timer until the first call to the subroutine. The subroutine
-must return a value which is the delay until the it is called again.
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL>
-
-=pod
}
1;
-
-__END__;
-
-=pod
-
-=head1 NAME
-
-SDL::Tool::Font - a perl extension
-
-=head1 DESCRIPTION
-
-L<SDL::Tool::Font> provides a unified interface for applying
-True Type and SFont fonts to various surfaces.
-
-=head1 METHODS
-
-=head2 print ( surface, x, y, text ... )
-
-C<SDL::Tool::Font::print> print the given text on the supplied surface
-with the upper left hand corner starting at the specified coordinates.
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Font> L<SDL::TTFont> L<SDL::Surface>
-
-=cut
1;
-
-__END__;
-
-=pod
-
-
-
-=head1 NAME
-
-SDL::Tool::Graphic
-
-=head1 DESCRIPTION
-
-L<SDL::Tool::Graphic> is a module for zooming and rotating L<SDL::Surface> objects.
-
-=head1 METHODS
-
-=head2 zoom ( surface, xzoom, yzoom, smooth )
-
-C<SDL::Tool::Graphic::zoom> scales a L<SDL::Surface> along the two axis independently.
-
-=head2 rotoZoom ( surface, angle, zoom, smooth )
-
-C<SDL::Tool::Graphic::rotoZoom> rotates and fixed axis zooms a L<SDL::Surface>.
-
-=head2 grayScale ( surface )
-
-C<SDL::Tool::Graphic::grayScale> rotates and fixed axis zooms a L<SDL::Surface>.
-
-=head2 invertColor ( surface )
-
-C<SDL::Tool::Graphic::invertColor> inverts the color of a <SDL::Surface>.
-
-
-=head1 AUTHOR
-
-Russell E. Valentine
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Surface>
-
-=cut
1;
-__END__
-
-=head1 NAME
-
-SDL::Tutorial - introduction to Perl SDL
-
-=head1 SYNOPSIS
-
- # to read this tutorial
- $ perldoc SDL::Tutorial
-
- # to create a bare-bones SDL app based on this tutorial
- $ perl -MSDL::Tutorial -e 1
-
-=head1 SDL BASICS
-
-SDL, the Simple DirectMedia Layer, is a cross-platform multimedia library.
-These are the Perl 5 bindings. You can find out more about SDL at
-L<http://www.libsdl.org/>.
-
-Creating an SDL application with Perl is easy. You have to know a few basics,
-though. Here's how to get up and running as quickly as possible.
-
-=head2 Surfaces
-
-All graphics in SDL live on a surface. You'll need at least one. That's what
-L<SDL::App> provides.
-
-Of course, before you can get a surface, you need to initialize your video
-mode. SDL gives you several options, including whether to run in a window or
-take over the full screen, the size of the window, the bit depth of your
-colors, and whether to use hardware acceleration. For now, we'll build
-something really simple.
-
-=head2 Initialization
-
-SDL::App makes it easy to initialize video and create a surface. Here's how to
-ask for a windowed surface with 640x480x16 resolution:
-
- use SDL::App;
-
- my $app = SDL::App->new(
- -width => 640,
- -height => 480,
- -depth => 16,
- );
-
-You can get more creative, especially if you use the C<-title> and C<-icon>
-attributes in a windowed application. Here's how to set the window title of
-the application to C<My SDL Program>:
-
- use SDL::App;
-
- my $app = SDL::App->new(
- -height => 640,
- -width => 480,
- -depth => 16,
- -title => 'My SDL Program',
- );
-
-Setting an icon is a little more involved -- you have to load an image onto a
-surface. That's a bit more complicated, but see the C<-name> parameter to
-C<SDL::Surface->new()> if you want to skip ahead.
-
-=head2 Working With The App
-
-Since C<$app> from the code above is just an SDL surface with some extra sugar,
-it behaves much like L<SDL::Surface>. In particular, the all-important C<blit>
-and C<update> methods work. You'll need to create L<SDL::Rect> objects
-representing sources of graphics to draw onto the C<$app>'s surface, C<blit>
-them there, then C<update> the C<$app>.
-
-B<Note:> "blitting" is copying a chunk of memory from one place to another.
-
-That, however, is another tutorial.
-
-=head1 SEE ALSO
-
-=over 4
-
-=item L<SDL::Tutorial::Drawing>
-
-basic drawing with rectangles
-
-=item L<SDL::Tutorial::Animation>
-
-basic rectangle animation
-
-=item L<SDL::Tutorial::Images>
-
-image loading and animation
-
-=back
-
-=head1 AUTHOR
-
-chromatic, E<lt>chromatic@wgz.orgE<gt>.
-
-Written for and maintained by the Perl SDL project, L<http://sdl.perl.org/>.
-
-=head1 COPYRIGHT
-
-Copyright (c) 2003 - 2004, chromatic. All rights reserved. This module is
-distributed under the same terms as Perl itself, in the hope that it is useful
-but certainly under no guarantee.
bootstrap SDL::Video;
1;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-SDL::Video - Bindings to the video category in SDL API
-
-=head1 SYNOPSIS
-
-This module is not an object. Please read the
-
-=head1 DESCRIPTION
-
-
-
-=head1 METHODS
-
-=head2 get_video_surface
-
-Returns a pointer to the current display surface
-
-=head2 get_video_info
-
-Returns a pointer to information about the video hardware
-
-=head2 video_driver_name
-
-Obtain the name of the video driver
-
-=head2 list_modes
-
-Returns a pointer to an array of available screen dimensions for the given format and video flags
-
-=head2 set_video_mode
-
-Checks to see if a particular video mode is supported.
-
-=head2 video_mode_ok
-
-Sets up a video mode with the specified width, height and bits-per-pixel.
-
-=head2 update_rect
-
-Makes sure the given area is updated on the given screen.
-
-=head2 update_rects
-
-Makes sure the given list of rectangles is updated on the given screen.
-
-=head2 flip
-
-Swaps screen buffers
-
-=head2 set_colors
-
-Sets a portion of the colormap for the given 8-bit surface.
-
-=head2 set_palette
-
-Sets the colors in the palette of an 8-bit surface.
-
-=head2 set_gamma
-
-Sets the color gamma function for the display
-
-=head2 get_gamma_ramp
-
-Gets the color gamma lookup tables for the display
-
-=head2 set_gmmma_ramp
-
-Sets the color gamma lookup tables for the display
-
-=head2 map_RGB
-
-Maps a RGB color value to a pixel format.
-
-=head2 map_RGBA
-
-Maps a RGBA color value to a pixel format.
-
-=head2 get_RGB
-
-Gets RGB values from a pixel in the specified pixel format.
-
-=head2 get_RGBA
-
-Gets RGBA values from a pixel in the specified pixel format.
-
-=head2 create_RGB_surface_from
-
-Creates an empty SDL::Surface from pixel data
-
-=head2 lock_surface
-
-Locks a surface for direct access.
-
-=head2 unlock_surface
-
-Unlocks a previously locked surface.
-
-=head2 convert_surface
-
-Converts a surface to the same format as another surface.
-
-=head2 display_format
-
-Converts a surface to the display format
-
-=head2 display_format_alpha
-
-Converts a surface to the display format
-
-=head2 load_BMP
-
-
-=head2 save_BMP
-
-
-=head2 set_color_key
-
-
-=head2 set_alpha
-
-
-=head2 set_clip_rect
-
-
-=head2 get_clip_rect
-
-
-=head2 blit_surface
-
-
-=head2 fill_rect
-
-
-=head2 GL_load_library
-
-
-=head2 GL_get_proc_address
-
-
-=head2 GL_get_attribute
-
-
-=head2 GL_set_attribute
-
-
-=head2 GL_swap_buffers
-
-
-=head2 GL_attr
-
-
-=head2 lock_YUV_overlay
-
-
-=head2 unlock_YUV_overlay
-
-
-=head2 display_YUV_overlay
-
-
-
-=head1 SEE ALSO
-
-=head2 Category Objects
-
-L<SDL::Surface>, L<SDL::Overlay>, L<SDL::Color>,
-L<SDL::Rect>, L<SDL::Palette>, L<SDL::PixelFormat>,
-L<SDL::VideoInfo>
-
-=cut
bootstrap SDL::VideoInfo;
1;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-SDL::VideoInfo - Video Target Information
-
-=head1 SYNOPSIS
-
- my $video_info = SDL::Video::get_video_info();
-
-VideoInfo is only accessible C<SDL::Video::get_video_info>. This module only provides getters to the struct C<SDL_VideoInfo>.
-
-
-=head1 DESCRIPTION
-
-This object is a read-only structure and is returned by C<SDL::Video::get_video_info>. It contains information on either the best available mode if called before C<SDL::Video::set_video_mode> or the current video mode if called after C<SDL::Video::set_video_mode>.
-
-=head1 METHODS
-
-
-=head2 hw_available
-
- $video_info->hw_available() # 1 if Hardware Accelerated Surfaces available
-
-Is it possible to create hardware surfaces ?
-
-=head2 wm_available
-
- $video_info->wm_available() # 1 if Window Manager available
-
-Is there a window manager available ?
-
-=head2 blit_hw
-
- $video_info->blit_hw()
-
-Are hardware to hardware blits accelerated ?
-
-=head2 blit_hw_CC
-
- $video_info->blit_hw_CC()
-
-Are hardware to hardware colorkey blits accelerated ?
-
-=head2 blit_hw_A
-
- $video_info->blit_hw_A()
-
-Are hardware to hardware alpha blits accelerated ?
-
-=head2 blit_sw
-
- $video_info->blit_sw()
-
-Are software to hardware blits accelerated ?
-
-=head2 blit_sw_CC
-
- $video_info->blit_sw_CC()
-
-
-Are software to hardware colorkey blits accelerated ?
-
-=head2 blit_sw_A
-
- $video_info->blit_sw_A()
-
-Are software to hardware alpha blits accelerated ?
-
-=head2 blit_fill
-
- $video_info->blit_fill()
-
-Are color fills accelerated ?
-
-=head2 video_mem
-
- my $video_mem = $video_info->video_mem();
-
-Total amount of video memory in Kilobytes, should be accessed only if hw_available == 1, otherwise it is equal to 0
-
-=head2 vfmt
-
- my $vd_pixel_format = $video_info->vfmt();
-
-
-C<SDL::PixelFormat> of the video device
-
-=head2 current_w, current_h
-
- $video_info->current_w();
- $video_info->current_h();
-
-Width and height of the current video mode, or of the desktop mode if C<SDL_GetVideoInfo> was called before C<SDL::Video::set_video_mode> (available since SDL 1.2.10)
-
-=head1 SEE ALSO
-
-L<SDL::Video>, L<SDL::PixelFormat>
-
-=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::App - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ use SDL;
+ use SDL::Event;
+ use SDL::App;
+
+ my $app = new SDL::App (
+ -title => 'Application Title',
+ -width => 640,
+ -height => 480,
+ -depth => 32 );
+
+This is the manual way of doing things
+
+ my $event = new SDL::Event; # create a new event
+
+ $event->pump();
+ $event->poll();
+
+ while ($event->wait()) {
+ my $type = $event->type(); # get event type
+ print $type;
+ exit if $type == SDL_QUIT;
+ }
+An alternative to the manual Event processing is the L<SDL::App::loop> .
+
+=head1 DESCRIPTION
+
+L<SDL::App> controls the root window of the of your SDL based application.
+It extends the L<SDL::Surface> class, and provides an interface to the window
+manager oriented functions.
+
+=head1 METHODS
+
+=head2 new
+
+C<SDL::App::new> initializes the SDL, creates a new screen,
+and initializes some of the window manager properties.
+C<SDL::App::new> takes a series of named parameters:
+
+=over 4
+
+=item *
+
+-title
+
+=item *
+
+-icon_title
+
+=item *
+
+-icon
+
+=item *
+
+-width
+
+=item *
+
+-height
+
+=item *
+
+-depth
+
+=item *
+
+-flags
+
+=item *
+
+-resizeable
+
+=back
+
+=head2 title
+
+C<SDL::App::title> takes 0, 1, or 2 arguments. It returns the current
+application window title. If one parameter is passed, both the window
+title and icon title will be set to its value. If two parameters are
+passed the window title will be set to the first, and the icon title
+to the second.
+
+=head2 delay
+
+C<SDL::App::delay> takes 1 argument, and will sleep the application for
+that many ms.
+
+=head2 ticks
+
+C<SDL::App::ticks> returns the number of ms since the application began.
+
+=head2 error
+
+C<SDL::App::error> returns the last error message set by the SDL.
+
+=head2 resize
+
+C<SDL::App::resize> takes a new height and width of the application
+if the application was originally created with the -resizable option.
+
+=head2 fullscreen
+
+C<SDL::App::fullscreen> toggles the application in and out of fullscreen mode.
+
+=head2 iconify
+
+C<SDL::App::iconify> iconifies the applicaiton window.
+
+=head2 grab_input
+
+C<SDL::App::grab_input> can be used to change the input focus behavior of
+the application. It takes one argument, which should be one of the following:
+
+=over 4
+
+=item *
+SDL_GRAB_QUERY
+
+=item *
+SDL_GRAB_ON
+
+=item *
+SDL_GRAB_OFF
+
+=back
+
+=head2 loop
+
+C<SDL::App::loop> is a simple event loop method which takes a reference to a hash
+of event handler subroutines. The keys of the hash must be SDL event types such
+as SDL_QUIT(), SDL_KEYDOWN(), and the like. The event method recieves as its parameter
+the event object used in the loop.
+
+ Example:
+
+ my $app = new SDL::App -title => "test.app",
+ -width => 800,
+ -height => 600,
+ -depth => 32;
+
+ my %actions = (
+ SDL_QUIT() => sub { exit(0); },
+ SDL_KEYDOWN() => sub { print "Key Pressed" },
+ );
+
+ $app->loop(\%actions);
+
+=head2 sync
+
+C<SDL::App::sync> encapsulates the various methods of syncronizing the screen with the
+current video buffer. C<SDL::App::sync> will do a fullscreen update, using the double buffer
+or OpenGL buffer if applicable. This is prefered to calling flip on the application window.
+
+=head2 attribute ( attr, [value] )
+
+C<SDL::App::attribute> allows one to set and get GL attributes. By passing a value
+in addition to the attribute selector, the value will be set. C<SDL:::App::attribute>
+always returns the current value of the given attribute, or croaks on failure.
+
+=head1 AUTHOR
+
+David J. Goehrig
+Kartik Thakore
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Surface> L<SDL::Event> L<SDL::OpenGL>
+
+=cut
--- /dev/null
+=pod
+
+
+
+=head1 NAME
+
+SDL::Cdrom - a SDL perl extension for managing CD-ROM drives
+
+=head1 SYNOPSIS
+
+ use SDL::Cdrom;
+ $cdrom = SDL::Cdrom->new(0);
+ $cdrom->play();
+
+=head1 EXPORTS
+
+=over 4
+
+=item *
+
+C<cd_num_drives>.
+
+=back
+
+=head1 DESCRIPTION
+
+Create a new SDL::Cdrom object. The passed $id is the number of the drive,
+whereas 0 is the first drive etc.
+
+ use SDL::Cdrom;
+ my $drive => SDL::Cdrom->new($id);
+
+=head1 METHODS
+
+=head2 cd_num_drives()
+
+Returns the number of CD-ROM drives present.
+
+=head2 name()
+
+Returns the system dependent name of the CD-ROM device.
+
+=head2 status()
+
+Return the status of the drive.
+
+=head2 play()
+
+Play a track.
+
+=head2 pause()
+
+Pause the playing.
+
+=head2 resume()
+
+Resume the playing.
+
+=head2 stop()
+
+Stop the playing.
+
+=head2 eject()
+
+Eject the medium in the drive.
+
+=head2 id()
+
+Return the ID of the drive.
+
+=head2 num_tracks()
+
+Return the number of tracks on the medium.
+
+=head2 track()
+
+Returns the track description
+
+=head2 current()
+
+Return the current played track number.
+
+=head2 current_frame()
+
+Return the current frame.
+
+=head1 AUTHORS
+
+David J. Goehrig
+Documentation by Tels <http://bloodgate.com/>.
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Mixer> L<SDL::App>.
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Color - Format independent color description
+
+=head1 SYNOPSIS
+
+ my $black = SDL::Color->new( 0, 0, 0);
+ my $color = SDL::Color->new(255, 0, 0);
+ my $r = $color->r; # 255
+ my $g = $color->g; # 0
+ my $b = $color->b; # 0
+ $color->g(255);
+ $color->b(255);
+ # $color is now white
+
+=head1 DESCRIPTION
+
+C<SDL_Color> describes a color in a format independent way.
+
+=head1 METHODS
+
+=head2 new ( $r, $g, $b )
+
+The constructor creates a new color with the specified red, green and
+blue values:
+
+ my $color = SDL::Color->new(255, 0, 0);
+
+=head2 r
+
+If passed a value, this method sets the red component of the color;
+if not, it returns the red component of the color:
+
+ my $r = $color->r; # 255
+ $color->r(128);
+
+=head2 g
+
+If passed a value, this method sets the green component of the color;
+if not, it returns the green component of the color:
+
+ my $g = $color->g; # 255
+ $color->g(128);
+
+=head2 b
+
+If passed a value, this method sets the blue component of the color;
+if not, it returns the blue component of the color:
+
+ my $b = $color->b; # 255
+ $color->b(128);
+
+=head1 SEE ALSO
+
+L<SDL::Surface>
+
+=cut
--- /dev/null
+=pod
+
+
+
+=head1 NAME
+
+SDL::Cursor - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $cursor = SDL::Cursor->new(
+ -data => new SDL::Surface "cursor.png",
+ -mask => new SDL::Surface "mask.png",
+ -x => 0, -y => 0 );
+ $cusor->use;
+
+=head1 DESCRIPTION
+
+the SDL::Cursor module handles mouse cursors, and provide the developer to
+use custom made cursors. Note that the cursors can only be in black and
+white.
+
+=head1 METHODS
+
+=head2 new( -data => $surface_data, -mask => $surface_mask, x => $x, y => $y)
+
+Creates a new cursor. The <C>-data</C> and <C>-mask</C> parameters should be both black and white pictures. The height and width of these surfaces should be a multiple of 8. The <C>-x</C> and <C>-y</C> are the coordinates of the cursor 'hot spot'.
+
+=head2 warp($x, $y)
+
+Set the position of the cursor at the <C>$x</C>, <C>$y</C> coordinates in the application window.
+
+=head2 use()
+
+Set the cursor as the active cursor.
+
+=head2 get()
+
+When used statically <C>SDL::Cursor::get()</C>, it will return the instance of the current cursor in use. Called as a method, it will return itself.
+
+This method can be useful if you are dealing with several cursors.
+
+=head2 show($toggle)
+
+Set the visibility of the cursor. A false value will make the cursor
+invisible in the Application window. A true value will show it back.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Surface>
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Event - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ use SDL::Event;
+ my $event = new SDL::Event; # create a new event
+ $event->pump(); # pump all events from SDL Event Queue
+ $event->poll(); # Get the top one from the queue
+ while ($event->wait()) {
+ my $type = $event->type(); # get event type
+ # ... handle event
+ exit if $type == SDL_QUIT;
+ }
+
+=head1 DESCRIPTION
+
+C<SDL::Event> offers an object-oriented approach to SDL events. By creating
+an instance of SDL::Event via new() you can wait for events, and then determine
+the type of the event and take an appropriate action.
+
+=head1 EXAMPLE
+
+Here is an example of a simple event handler loop routine.
+See also L<SDL::App::loop>.
+
+ sub loop {
+ my ($self,$href) = @_;
+ my $event = new SDL::Event;
+ while ( $event->wait() ) {
+ # ... insert here your event handling like:
+ if ( ref($$href{$event->type()}) eq "CODE" ) {
+ &{$$href{$event->type()}}($event);
+ $self->sync();
+ }
+ }
+ }
+
+=head1 METHODS
+
+=head2 new()
+
+Create a new event object.It returns a SDL::Event.
+
+=head2 type()
+
+Returns the type of the event, see list of exported symbols for which are
+available.
+
+=head2 pump()
+
+SDL::Events::pump gathers all the pending input information from devices and places
+it on the event queue.
+Without calls to pump no events would ever be placed on the queue.
+Often the need for calls to pump is hidden from the user
+since C</SDL::Events::poll> and C<SDL::Events::wait_event implicitly call pump.
+However, if you are not polling or waiting for events (e.g. you are filtering them),
+then you must call pump force an event queue update.
+pump doesn't return any value and doesn't take any parameters.
+
+Note: You can only call this function in the thread that set the video mode.
+
+
+=head2 poll(event)
+
+Polls for currently pending events.
+If event is not undef, the next event is removed from the queue and returned as a C< SDL::Event>.
+As this function implicitly calls C<SDL::Events::pump>, you can only call this function in the thread that set the video mode.
+it take a SDL::Event as first parameter.
+
+=head2 wait(event)
+
+Waits indefinitely for the next available event, returning undef if there was an error while waiting for events,
+a L< SDL::Event> otherwise.
+If event is not NULL, the next event is removed.
+As this function implicitly calls L<SDL::Events::pump>, you can only call this function in the thread that set the video mode.
+WaitEvent take a SDL::Event as first parameter.
+
+=head2 set( type, state )
+
+Set the state for all events of the given event's type
+
+=head2 set_unicode( toggle )
+
+Toggle unicode on the event.
+
+=head2 set_key_repeat( delay, interval)
+
+Sets the delay and intervall of the key repeat rate (e.g. when a user
+holds down a key on the keyboard).
+
+=head2 active_gain(event)
+
+active_gain return the active gain from the SDL::Event given as first parameter.
+
+=head2 active_state(event)
+
+active_state return the active state from the SDL::Event given as first parameter.
+
+=head2 key_state(event)
+
+key_state return the active key state from the SDL::Event given as first parameter.
+
+
+=head2 key_sym(key)
+
+key_sym return the key pressed/released information from the SDL::Event given as first parameter.
+
+=head2 get_key_name(key)
+
+get_key_name get the name of an SDL virtual keysym.
+it returns the key name.
+
+=head2 key_mod(event)
+
+key_mod return the mod keys pressed information from the SDL::Event given as first parameter.
+
+=head2 key_unicode(event)
+
+key_unicode return the unicode translated keys pressed/released information from the SDL::Event given as first parameter.
+
+=head2 key_scancode(event) * to move in SDL::Game::Keyboard
+
+key_scancode return the hardware specific keyboard scan code from the SDL::Event given as first parameter.
+
+=head2 motion_state(event) * to move in SDL::Game::Mouse
+
+motion_state return the state of the mouse button from the SDL::Event given as first parameter.
+
+=head2 motion_x(event) * to move in SDL::Game::Mouse
+
+Returns the motion of the mouse in X direction as an absolute value.
+It take a SDL::Event as first parameter.
+
+=head2 motion_y(event) * to move in SDL::Game::Mouse
+
+Returns the motion of the mouse in Y direction as an absolute value.
+It take a SDL::Event as first parameter.
+
+=head2 motion_xrel(event) * to move in SDL::Game::Mouse
+
+Returns the motion of the mouse in X direction as a relative value.
+It take a SDL::Event as first parameter.
+
+=head2 motion_yrel(event) * to move in SDL::Game::Mouse
+
+Returns the motion of the mouse in Y direction as a relative value.
+It take a SDL::Event as first parameter.
+
+=head2 button_state(event) * to move in SDL::Game::Mouse
+
+Returns the state of the mouse buttons.
+It take a SDL::Event as first parameter.
+
+=head2 button_x(event) * to move in SDL::Game::Mouse
+
+Return the X position of the mouse at keypress.it take a SDL::Event as first parameter.
+
+=head2 button_y(event) * to move in SDL::Game::Mouse
+
+Return the Y position of the mouse at keypress.it take a SDL::Event as first parameter.
+
+=head2 button(event) * to move in SDL::Game::Mouse
+
+Return the mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT, SDL_BUTTON_WHEELUP, SDL_BUTTON_WHEELDOWN)
+
+=head1 AUTHOR
+
+David J. Goehrig
+Documentation by Tels <http://bloodgate.com/>
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::App>
+
+=cut
--- /dev/null
+=pod
+
+
+=head1 NAME
+
+SDL::Font - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $font = new Font "Font.png";
+ $font->use();
+
+=head1 DESCRIPTION
+
+L<SDL::Font> provides an interface to loading and using SFont style
+fonts with L<SDL::Surface> objects.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Surface>
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Palette - a perl extension
+
+=head1 DESCRIPTION
+
+L<SDL::Palette> provides an interface to the SDL_Palette structures,
+and can be used to set the color values of an existing palette's indexes.
+
+=head1 METHODS
+
+=head2 blue ( index, [value] )
+
+Fetches and sets the blue component of the color at index.
+
+=head2 green ( index, [value] )
+
+Fetches and sets the green component of the color at index.
+
+=head2 red ( index, [value] )
+
+Fetches and sets the red component of the color at index.
+
+=head2 color ( index, [ r, g, b ] )
+
+Fetches and sets the RGB, returns an SDL_Color *.
+
+=head2 size
+
+Returns the size of the palette.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Color> L<SDL::Surface>
+
+=cut
--- /dev/null
+=pod
+
+
+=head1 NAME
+
+SDL::MPEG - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $info = new SDL::MPEG -from => $mpeg;
+
+=head1 DESCRIPTION
+
+C<SDL::MPEG> provides an interface to quering the status
+of a SMPEG stream.
+
+=head2 METHODS
+
+=over 4
+
+=item *
+
+C<SDL::MPEG::has_audio> returns true if it has audio track
+
+=item *
+
+C<SDL::MPEG::has_video> returns true if it has a video track
+
+=item *
+
+C<SDL::MPEG::width> returns the width of the video in pixels
+
+=item *
+
+C<SDL::MPEG::height> returns the height of the video in pixels
+
+=item *
+
+C<SDL::MPEG::size> returns the total size of the clip in bytes
+
+=item *
+
+C<SDL::MPEG::offset> returns the offset into the clip in bytes
+
+=item *
+
+C<SDL::MPEG::frame> returns the offset into the clip in fames
+
+=item *
+
+C<SDL::MPEG::fps> returns the play rate in frames per second
+
+=item *
+
+C<SDL::MPEG::time> returns the current play time in seconds
+
+=item *
+
+C<SDL::MPEG::length> returns the total play time in seconds
+
+=back
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+perl(1) SDL::Video(3)
+
+=cut
+
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Mixer - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $mixer = new SDL::Mixer -frequency => MIX_DEFAULT_FREQUENCY,
+ -format => MIX_DEFAULT_FORMAT,
+ -channels => MIX_DEFAULT_CHANNELS,
+ -size => 4096;
+
+=head1 DESCRIPTION
+
+SDL::Mixer allows you access to the SDL mixer library, enablig sound and
+music volume setting, playing, pausing and resuming, as well as fading
+the sound and music in and out.
+
+=head1 METHODS
+
+=head2 new()
+
+ $mixer = SDL::Mixer->new( -frequency => MIX_DEFAULT_FREQUENCY,
+ -format => MIX_DEFAULT_FORMAT,
+ -channels => MIX_DEFAULT_CHANNELS,
+ -size => 4096);
+
+Creates a new SDL::Mixer object. C<$size> is the buffer size in bytes.
+
+=head2 query_spec()
+
+ my $specs = SDL::Mixer::query_spec();
+
+Returns a hash reference, containing the following keys and their respective
+values:
+
+ -status
+ -frequency
+ -channels
+ -format
+
+=head2 reserve_channels
+
+ $mixer->reserve_channels(4);
+
+Reserve so many channels.
+
+=head2 allocate_channels()
+
+ $mixer->reserve_channels(2);
+
+Allocate so many channels.
+
+=head2 group_channel(channel,group)
+
+Group the channel number C<$channel> into group C<$group>.
+
+=head2 group_channels(from,to,group)
+
+Groups a range of channels
+
+=head2 group_available(group)
+
+Return true when the group is available.
+
+=head2 group_count(group)
+
+Returns the number of channels in the group
+
+=head2 group_oldest()
+
+
+=head2 group_newer()
+
+
+=head2 play_channel()
+
+
+=head2 play_music()
+
+Play C<$music> C<$loop> times.
+
+=head2 fade_in_channel(channel,chunk,loops,ms,ticks)
+
+Fades a channel in
+
+=head2 fade_in_music(music,loops,ms)
+
+Fades the music in over a number of ms, looping as it does
+
+=head2 channel_volume(channel,volume)
+
+Sets the volume for a single channel
+
+=head2 mucis_volume(volume)
+
+Set the volume for the music.
+
+=head2 halt_channel(channel)
+
+Stops a specific channel
+
+=head2 halt_group(group)
+
+Stops a group of channels
+
+=head2 halt_music()
+
+Stops the music
+
+=head2 channel_expire(channel,ticks)
+
+Ignores the channel after C<ticks> has expired
+
+=head2 fade_out_channel(channel,ms)
+
+Fade the channel number C<$channel> in C<$ms> ms out.
+
+=head2 fade_out_group(group,ms)
+
+Fade the channel group C<$group> in C<$ms> ms out.
+
+=head2 fade_out_music(ms)
+
+Fade the music in C<$ms> ms out.
+
+=head2 fading_music()
+
+Return true when the music is currently fading in or out.
+
+=head2 fading_channel()
+
+Return true when the channel number C<$channel> is currently fading in or out.
+
+=head2 pause( channel )
+
+Pause the channel C<$channel>.
+
+=head2 resume(channel)
+
+Resume the channel C<$channel>.
+
+=head2 paused()
+
+Return true when the channel is currently paused.
+
+=head2 pause_music()
+
+Pause the music play.
+
+=head2 resume_music()
+
+Resume the music play.
+
+=head2 rewind_music()
+
+Resets the music file to the beginning
+
+=head2 music_paused()
+
+Return true when the music is currently paused.
+
+=head2 playing()
+
+Return true when the channel is currently playing.
+
+=head2 playing_music ()
+
+Return true when the music is currently playing.
+
+=head1 set_panning($channel, $left, $right)
+
+Sets the volume for the left or right channels. To do true panning:
+
+ $mixer->set_panning($channel, $left, 254 - $left);
+
+=head1 AUTHORS
+
+David J. Goehrig, basic doc added by Tels <http://bloodgate.com>.
+
+=head1 SEE ALSO
+
+L<perl>, L<SDL::Music> and L<SDL::Sound>.
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Music - a perl extension
+
+=head1 DESCRIPTION
+
+L<SDL::Music> is used to load music files for use with L<SDL::Mixer>.
+To load a music file one simply creates a new object passing the filename
+to the constructor:
+
+ my $music = new SDL::Music 'my_song.ogg';
+
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Mixer>
+
+=cut
--- /dev/null
+=pod
+
+
+
+=head1 NAME
+
+SDL::OpenGL - a perl extension
+
+=head1 DESCRIPTION
+
+L<SDL::OpenGL> is a perl module which when used by your application
+exports the gl* and glu* functions into your application's primary namespace.
+Most of the functions described in the OpenGL 1.3 specification are currently
+supported in this fashion. As the implementation of the OpenGL bindings that
+comes with SDL_perl is largely type agnositic, there is no need to decline
+the function names in the fashion that is done in the C API. For example,
+glVertex3d is simply glVertex, and perl just does the right thing with regards
+to types.
+
+=head1 CAVEATS
+
+The following methods work different in Perl than in C:
+
+=over 2
+
+=item glCallLists
+
+ glCallLists(@array_of_numbers);
+
+Unlike the C function, which get's passed a count, a type and a list of
+numbers, the Perl equivalent only takes a list of numbers.
+
+Note that this is slow, since it needs to allocate memory and construct a
+list of numbers from the given scalars. For a faster version see
+L<glCallListsString>.
+
+=back
+
+The following methods exist in addition to the normal OpenGL specification:
+
+=over 2
+
+=item glCallListsString
+
+ glCallListsString($string);
+
+Works like L<glCallLists()>, except that it needs only one parameter, a scalar
+holding a string. The string is interpreted as a set of bytes, and each of
+these will be passed to glCallLists as GL_BYTE. This is faster than
+glCallLists, so you might want to pack your data like this:
+
+ my $lists = pack("C", @array_of_numbers);
+
+And later use it like this:
+
+ glCallListsString($lists);
+
+=back
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::App>
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Overlay - YUV Video overlay
+
+=head1 SYNOPSIS
+
+First import the following modules to get access to constants and functions needed for overlay.
+
+ use SDL;
+ use SDL::Video;
+ use SDL::Overlay;
+
+Init the video susbsystem.
+
+ SDL::Init(SDL_INIT_VIDEO);
+
+Create a display to use.
+
+ my $display = SDL::SetVideoMore(640, 480, 32, SDL_SWSURFACE);
+
+Create and attach the display to a new overlay
+ my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display);
+
+=head1 DESCRIPTION
+
+A C<SDL_Overlay> allows for video rendering on an C<SDL_Surface> which is a display.
+
+The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.
+
+=head1 METHODS
+
+=head2 new ( $width, $height, $YUV_flag, $display)
+
+The constructor creates a SDL::Overlay of the specified width, height and format (see C<YUV_Flags> list below of available formats), for the provided display.
+
+Note the 'display' argument needs to actually be the surface created by C<SDL::Video::SetVideoMode> otherwise this function will segfault.
+
+ my $overlay = SDL::Overlay->new( $width, $height, $YUV_flag, $display );
+
+=head3 YUV_Flags
+
+More information on YUV formats can be found at L<http://www.fourcc.org/indexyuv.htm> .
+
+=over 4
+
+=item *
+SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */
+
+=item *
+SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */
+
+=item *
+SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */
+
+=item *
+SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */
+
+=item *
+SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */
+
+=back
+
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Palette - a perl extension
+
+=head1 DESCRIPTION
+
+L<SDL::Palette> provides an interface to the C<SDL_Palette> structures,
+and can be used to set the color values of an existing palette's indexes.
+
+=head1 METHODS
+
+=head2 ncolors ( )
+
+Fetches the number of colors in palette
+
+=head2 colors ( index )
+
+Fetches an array of colors in palette
+
+=head2 color_index ( index )
+
+Fetches the SDL_Color at the provide index in palette
+
+=head2 size
+
+Returns the size of the palette.
+
+
+=head1 SEE ALSO
+
+L<SDL::Color> L<SDL::Surface>
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::PixelFormat - Stores surface format information
+
+=head1 SYNOPSIS
+
+ my $surface = SDL::Surface->new( ...
+ $surface->format; #this returns the PixelFormat object attached to this surface
+
+PixelFormat is only created in a C<SDL::Surface>. This module only provides getters to the surface's pixelformat. Later on we will provide setting capability.
+
+
+=head1 DESCRIPTION
+
+An C<SDL::PixelFormat > stores surface format information
+
+=head1 METHODS
+
+=head2 palette
+
+ $surface->format->palette;
+
+Returns the C<SDL_Palette> and L<SDL::Palette> of the format of the surface.
+
+=head2 BitsPerPixel
+
+ $surface->format->BitsPerPixel;
+
+The number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32. (1 to 7 are not allowed when creating a surface or open a video mode
+
+=head2 BytesPerPixel
+
+ $surface->format->BytesPerPixel;
+
+The number of bytes used to represent each pixel in a surface. Usually one to four.
+
+=head2 [RGBA]loss
+
+ $surface->format->Rloss; #red loss
+ $surface->format->Bloss; #blue loss
+ $surface->format->Gloss; #green loss
+ $surface->format->Aloss; #alpha loss
+
+Precision loss of each color component (2[RGBA]loss)
+
+=head2 [RGBA]shift
+
+ $surface->format->Rshift; #red shift
+ $surface->format->Bshift; #blue shift
+ $surface->format->Gshift; #green shift
+ $surface->format->Ashift; #alpha shift
+
+Binary left shift of each color component in the pixel value
+
+
+=head2 [RGBA]mask
+
+ $surface->format->Rmask; #red mask
+ $surface->format->Bmask; #blue mask
+ $surface->format->Gmask; #green mask
+ $surface->format->Amask; #alpha mask
+
+Binary left shift of each color component in the pixel value
+
+=head2 colorkey
+
+ $surface->format->colorkey;
+
+Pixel value of transparent pixels.
+
+=head2 alpha
+
+ $surface->format->alpha;
+
+Overall surface alpha value
+
+
+
+=head1 SEE ALSO
+
+L<SDL::Surface>
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Rect - Defines a rectangular area
+
+=head1 SYNOPSIS
+
+ my $rect = SDL::Rect->new( 0, 0, 0, 0 );
+ $rect->x(1);
+ $rect->y(2);
+ $rect->w(3);
+ $rect->h(4);
+ my $x = $rect->x; # 1
+ my $y = $rect->y; # 2
+ my $w = $rect->w; # 3
+ my $h = $rect->h; # 4
+
+=head1 DESCRIPTION
+
+An C<SDL_Rect> defines a rectangular area of pixels.
+
+=head1 METHODS
+
+=head2 new ( $x, $y, $w, $h )
+
+The constructor creates a new rectangle with the specified x, y, w, h
+values:
+
+ my $rect = SDL::Rect->new( 0, 0, 0, 0 );
+
+=head2 x
+
+If passed a value, this method sets the x component of the rectangle;
+if not, it returns the x component of the rectangle:
+
+ my $x = $rect->x; # 255
+ $rect->x(128);
+
+=head2 y
+
+If passed a value, this method sets the y component of the rectangle;
+if not, it returns the y component of the rectangle:
+
+ my $y = $rect->y; # 255
+ $rect->y(128);
+
+=head2 w
+
+If passed a value, this method sets the w component of the rectangle;
+if not, it returns the w component of the rectangle:
+
+ my $w = $rect->w; # 255
+ $rect->w(128);
+
+=head2 h
+
+If passed a value, this method sets the h component of the rectangle;
+if not, it returns the h component of the rectangle:
+
+ my $h = $rect->h; # 255
+ $rect->h(128);
+
+=head1 SEE ALSO
+
+L<SDL::Surface>
+
+=cut
--- /dev/null
+=head1 NAME
+
+SDL_perl - Simple DirectMedia Layer for Perl
+
+=head1 SYNOPSIS
+
+ use SDL;
+
+=head1 DESCRIPTION
+
+SDL_perl is a package of perl modules that provides both functional and object orient
+interfaces to the Simple DirectMedia Layer for Perl 5. This package does take some
+liberties with the SDL API, and attempts to adhere to the spirit of both the SDL
+and Perl. This document describes the low-level functional SDL_perl API. For the
+object oriented programming interface please see the documentation provided on a
+per class basis.
+
+=head1 The SDL Perl 2009 Development Team
+
+=head2 Documentation
+
+ Nick: magnet
+
+=head2 Perl Development
+
+ Nick: Garu
+ Name: Breno G. de Oliveira
+
+ Nick: Dngor
+ Name: Rocco Caputo
+
+ Nick: nferraz
+ Name: Nelson Ferraz
+
+ Nick: acme
+ Name: Leon Brocard
+
+ Nick: FROGGS
+ Name: Tobias Leich
+
+=head2 Maintainance
+
+ Nick: kthakore
+ Name: Kartik Thakore
+
+=head1 MacOSX Experimental Usage
+
+Please get libsdl packages from Fink
+
+ perl Build.PL
+ perl Build test
+ perl Build bundle
+ perl Build install
+
+=head2 Running SDL Perl Scripts in MacOSX
+
+First set the PERL5LIB environment variable to the dependencies of your script
+
+ %export PERL5LIB=$PERL5LIB:./lib
+
+Use the SDLPerl executable made in the bundle and call your scripts
+
+ %SDLPerl.app/Contents/MacOS/SDLPerl yourScript.pl
+
+=head1 Functions exported by SDL.pm
+
+=head2 init(flags)
+
+As with the C language API, SDL_perl initializes the SDL environment through
+the C<SDL::init> subroutine. This routine takes a mode flag constructed through
+the bitwise OR product of the following constants:
+
+=over 4
+
+=item *
+INIT_AUDIO
+
+=item *
+INIT_VIDEO
+
+=item *
+INIT_CDROM
+
+=item *
+INIT_EVERYTHING
+
+=item *
+INIT_NOPARACHUTE
+
+=item *
+INIT_JOYSTICK
+
+=item *
+INIT_TIMER
+
+=back
+
+C<SDL::Init> returns 0 on success, or -1 on error.
+
+=head2 init_subsystem(flags)
+
+After SDL has been initialized with SDL::init you may initialize uninitialized subsystems with SDL::init_subsystem.
+The flags parameter is the same as that used in SDL::init.
+
+SDL::init_subsystem returns 0 on success, or -1 on error.
+
+=head2 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 tells SDL::quit_subSystem which subsystems to shut down, it uses the same values that are passed to SDL::init.
+
+SDL::quit_subsystem doesn't returns any value.
+
+=head2 quit
+
+Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources. This should always be called before you exit.
+
+SDL::quit doesn't returns any value.
+
+=head2 was_init(flags)
+
+SDL::was_init allows you to see which SDL subsytems have been initialized.
+flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL::init for a list of subsystem flags).
+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).
+
+
+=head2 get_error()
+
+The last error message set by the SDL library can be retrieved using the subroutine
+C<SDL::get_error>, which returns a scalar containing the text of the message if any.
+
+=head2 set_error(error) *need to be coded
+
+SDL::get_error sets the SDL error to a printf style formatted string.
+it doesn't returns any values.
+
+=head2 error(code) * need to be coded
+
+Sets the SDL error message to one of several predefined strings specified by code.
+
+code can be :
+
+=over 4
+
+ SDL_errorcode The corresponding error string
+
+ SDL_ENOMEM Out of memory
+ SDL_EFREAD Error reading from datastream
+ SDL_EFWRITE Error writing to datastream
+ SDL_EFSEEK Error seeking in datastream
+ SDL_UNSUPPORTED Unknown SDL error
+ SDL_LASTERROR Unknown SDL error
+ any other value Unknown SDL error
+
+
+ Note 1: SDL_LASTERROR marks the highest numbered predefined error.
+ Note 2: SDL also defines SDL_OutOfMemory() and SDL_Unsupported() for internal use
+ which are equivalent to SDL_Error(SDL_ENOMEM) and SDL_Error(SDL_UNSUPPORTED) respectively.
+
+=back
+
+SDL::Error doesn't returns any value.
+
+
+=head2 clear_error() * need to be coded
+
+SDL::clear_error deletes all information about the last internal SDL error. Useful if the error has been handled by the program.
+it doesn't returns any value.
+
+=head2 load_object()
+
+Need to be coded.
+
+=head2 load_function()
+
+Need to be coded.
+
+=head2 unload_object()
+
+Need to be coded.
+
+=head2 VERSION()
+
+Need to be coded.
+
+=head2 version()
+
+Need to be coded.
+
+=head2 linked_version
+
+Need to be coded.
+
+=head2 get_error()
+
+The last error message set by the SDL library can be retrieved using the subroutine
+C<SDL::get_error>, which returns a scalar containing the text of the message if any.
+
+=head2 delay(ms)
+
+This subroutine allows an application to delay further operations for atleast a
+number of milliseconds provided as the argument. The actual delay may be longer
+than the specified depending on the underlying OS.
+
+
+
--- /dev/null
+=pod
+
+
+
+=head1 NAME
+
+SDL::SFont - a perl extension
+
+=head1 DESCRIPTION
+
+
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::App>
+
+=cut
--- /dev/null
+=pod
+
+
+=head1 NAME
+
+SDL::SMPEG - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $video = new SDL::SMPEG ( -name => 'pr0n.mpg' );
+
+=head1 DESCRIPTION
+
+C<SDL::SMPEG> adds support for MPEG video to your
+SDL Perl application. SMPEGs are objects bound to
+surfaces, whose playback is controled through the
+object's interface.
+
+=head2 METHODS
+
+
+=over 4
+
+=item *
+
+C<SDL::SMPEG::error()> returns any error messages associated with playback
+
+=item *
+
+C<SDL::SMPEG::audio(bool)> enables or disables audio playback, (on by default)
+
+=item *
+
+C<SDL::SMPEG::video(bool)> enables or disable video playback, (on by default)
+
+=item *
+
+C<SDL::SMPEG::loop(bool)> enables or disable playback looping (off by default)
+
+=item *
+
+C<SDL::SMPEG::volume(int)> set the volume as per the mixer volume
+
+=item *
+
+C<SDL::SMPEG:display(surface)> binds the clip to a display surface
+
+=item *
+
+C<SDL::SMPEG::scale([x,y]|[surface]|int)> scales the clip by either x,y
+factors, scales to the image dimensions, or a single scalar.
+
+=item *
+
+C<SDL::SMPEG::play()> plays the video clip, call C<SDL::SMPEG::display()> before playing
+
+=item *
+
+C<SDL::SMPEG::pause()> pauses video playback
+
+=item *
+
+C<SDL::SMPEG::stop()> stops video playback
+
+=item *
+
+C<SDL::SMPEG::rewind()> resets the clip to the beginning
+
+=item *
+
+C<SDL::SMPEG::seek(offset)> seeks to a particular byte offset
+
+=item *
+
+C<SDL::SMPEG::skip(time)> skips to a particular time
+
+=item *
+
+C<SDL::SMPEG::region(rect)> takes a SDL::Rect and defines the display area
+
+=item *
+
+C<SDL::SMPEG::frame(int)> renders a specific frame to the screen
+
+=item *
+
+C<SDL::SMPEG::info()> returns a new C<SDL::MPEG> object reflecting the current status
+
+=item *
+
+C<SDL::SMPEG::status()> returns either SMPEG_PLAYING or SMPEG_STOPPED or SMPEG_ERROR
+
+=back
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+perl(1) SDL::Surface(3) SDL::MPEG(3)
+
+=cut
+
--- /dev/null
+=pod
+
+
+
+=head1 NAME
+
+SDL::Sound - a perl extension
+
+=head1 DESCRIPTION
+
+L<SDL::Sound> is a module for loading WAV files for sound effects.
+The file can be loaded by creating a new L<SDL::Sound> object by
+passing the filename to the constructor;
+
+ my $sound = new SDL::Sound 'my_sfx.wav';
+
+=head1 METHODS
+
+=head2 volume ( value )
+
+Sets the volume of the sample.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Mixer>
+
+=cut
--- /dev/null
+=head1 NAME
+
+SDL::TTFont - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $font = SDL::TTFont->new( -name => "Utopia.ttf", -size => 18 );
+
+=head1 DESCRIPTION
+
+L<< SDL::TTFont >> is a module for applying true type fonts to L<< SDL::Surface >>.
+
+=head1 METHODS
+
+=head2 new
+
+Instanciates a new font surface. It accepts the following parameters:
+
+=head3 -name
+
+=head3 -n
+
+The font filename (possibly with proper path) to be used. B<< This options is mandatory >>.
+
+=head3 -size
+
+=head3 -s
+
+The font size (height, in pixels) to be used. B<< This option is mandatory >>.
+
+=head3 -foreground
+
+=head3 -fg
+
+Foreground color for the font surface (i.e. the actual font color). It expects a
+SDL::Color value. If omitted, black is used as font color.
+
+=head3 -background
+
+=head3 -bg
+
+Background color for the font surface (i.e. the font background color). It expects
+a SDL::Color value. If omitted , white is used for the background.
+
+=head3 -mode
+
+=head3 -m
+
+Font mode. If omitted, SDL::TEXT_SHADED is used. Note that this class provides
+human friendly accessors for setting different modes, so you should probably use
+them instead. See below for further details.
+
+=head2 Text Modes
+
+The SDL::TTFont accepts three different types (shaded, solid, blended) for
+three different encodings (text, utf8, unicode).
+
+ $font->text_shaded; # sets mode to SDL::TEXT_SHADED
+ $font->text_solid; # sets mode to SDL::TEXT_SOLID
+ $font->text_blended; # sets mode to SDL::TEXT_BLENDED
+
+ $font->utf8_shaded; # sets mode to SDL::UTF8_SHADED
+ $font->utf8_solid; # sets mode to SDL::UTF8_SOLID
+ $font->utf8_blended; # sets mode to SDL::UTF8_BLENDED
+
+ $font->unicode_shaded; # sets mode to SDL::UNICODE_SHADED
+ $font->unicode_solid; # sets mode to SDL::UNICODE_SOLID
+ $font->unicode_blended; # sets mode to SDL::UNICODE_BLENDED
+
+=head2 Text Style
+
+You may also smoothly change your font style by calling any of the following
+methods:
+
+ $font->normal; # resets font styling, making text "normal"
+ $font->bold; # sets bold style for font
+ $font->italic; # sets italic style for font
+ $font->underline; # sets underline style for font
+
+
+=head2 Ascent/Descent values
+
+Ascent is the number of pixels from the font baseline to the top of the font, while
+descent is the number of pixels from the font baseline to the bottom of the font.
+
+ $font->ascent; # height in pixels of the font ascent
+ $font->descent; # height in pixels of the font descent
+
+=head2 height
+
+ my $height = $font->height;
+
+Returns the height, in pixels, of the actual rendered text. This is the
+average size for each glyph in the font.
+
+=head2 width(@text)
+
+ my $width = $font->width("Choose your destiny");
+
+Returns the dimensions needed to render the text. This can be used to help
+determine the positioning needed for text before it is rendered. It can also
+be used for wordwrapping and other layout effects.
+
+Be aware that most fonts - notably, non-monospaced ("ms") ones - use kerning
+which adjusts the widths for specific letter pairs. For example, the width
+for "ae" will not always match the width for "a" + "e".
+
+=head2 print ($surface, $top, $left, @text)
+
+Directly draws text to an existing surface. Receives the target L<< SDL::Surface >>
+object and the relative top (y) and left (x) coordinates to put the text in.
+The last parameter may be a string or an array or strings with the text to be
+written.
+
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl>, L<SDL>, L<< SDL::Surface >>
--- /dev/null
+=pod
+
+
+=head1 NAME
+
+SDL::Timer - a SDL perl extension to handle timers
+
+=head1 SYNOPSIS
+
+ $timer = new SDL::Timer { print "tick"; 4000; } -delay => 4000;
+
+=head1 DESCRIPTION
+
+C<SDL::Timer> provides an abstract interface to the SDL::Timer
+callback code. SDL::Timer::new requires a subroutine and a delay
+at which is the initial interval between the creation of the
+timer until the first call to the subroutine. The subroutine
+must return a value which is the delay until the it is called again.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL>
+
+=pod
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Tool::Font - a perl extension
+
+=head1 DESCRIPTION
+
+L<SDL::Tool::Font> provides a unified interface for applying
+True Type and SFont fonts to various surfaces.
+
+=head1 METHODS
+
+=head2 print ( surface, x, y, text ... )
+
+C<SDL::Tool::Font::print> print the given text on the supplied surface
+with the upper left hand corner starting at the specified coordinates.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Font> L<SDL::TTFont> L<SDL::Surface>
+
+=cut
--- /dev/null
+=pod
+
+
+
+=head1 NAME
+
+SDL::Tool::Graphic
+
+=head1 DESCRIPTION
+
+L<SDL::Tool::Graphic> is a module for zooming and rotating L<SDL::Surface> objects.
+
+=head1 METHODS
+
+=head2 zoom ( surface, xzoom, yzoom, smooth )
+
+C<SDL::Tool::Graphic::zoom> scales a L<SDL::Surface> along the two axis independently.
+
+=head2 rotoZoom ( surface, angle, zoom, smooth )
+
+C<SDL::Tool::Graphic::rotoZoom> rotates and fixed axis zooms a L<SDL::Surface>.
+
+=head2 grayScale ( surface )
+
+C<SDL::Tool::Graphic::grayScale> rotates and fixed axis zooms a L<SDL::Surface>.
+
+=head2 invertColor ( surface )
+
+C<SDL::Tool::Graphic::invertColor> inverts the color of a <SDL::Surface>.
+
+
+=head1 AUTHOR
+
+Russell E. Valentine
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Surface>
+
+=cut
--- /dev/null
+=head1 NAME
+
+SDL::Tutorial - introduction to Perl SDL
+
+=head1 SYNOPSIS
+
+ # to read this tutorial
+ $ perldoc SDL::Tutorial
+
+ # to create a bare-bones SDL app based on this tutorial
+ $ perl -MSDL::Tutorial -e 1
+
+=head1 SDL BASICS
+
+SDL, the Simple DirectMedia Layer, is a cross-platform multimedia library.
+These are the Perl 5 bindings. You can find out more about SDL at
+L<http://www.libsdl.org/>.
+
+Creating an SDL application with Perl is easy. You have to know a few basics,
+though. Here's how to get up and running as quickly as possible.
+
+=head2 Surfaces
+
+All graphics in SDL live on a surface. You'll need at least one. That's what
+L<SDL::App> provides.
+
+Of course, before you can get a surface, you need to initialize your video
+mode. SDL gives you several options, including whether to run in a window or
+take over the full screen, the size of the window, the bit depth of your
+colors, and whether to use hardware acceleration. For now, we'll build
+something really simple.
+
+=head2 Initialization
+
+SDL::App makes it easy to initialize video and create a surface. Here's how to
+ask for a windowed surface with 640x480x16 resolution:
+
+ use SDL::App;
+
+ my $app = SDL::App->new(
+ -width => 640,
+ -height => 480,
+ -depth => 16,
+ );
+
+You can get more creative, especially if you use the C<-title> and C<-icon>
+attributes in a windowed application. Here's how to set the window title of
+the application to C<My SDL Program>:
+
+ use SDL::App;
+
+ my $app = SDL::App->new(
+ -height => 640,
+ -width => 480,
+ -depth => 16,
+ -title => 'My SDL Program',
+ );
+
+Setting an icon is a little more involved -- you have to load an image onto a
+surface. That's a bit more complicated, but see the C<-name> parameter to
+C<SDL::Surface->new()> if you want to skip ahead.
+
+=head2 Working With The App
+
+Since C<$app> from the code above is just an SDL surface with some extra sugar,
+it behaves much like L<SDL::Surface>. In particular, the all-important C<blit>
+and C<update> methods work. You'll need to create L<SDL::Rect> objects
+representing sources of graphics to draw onto the C<$app>'s surface, C<blit>
+them there, then C<update> the C<$app>.
+
+B<Note:> "blitting" is copying a chunk of memory from one place to another.
+
+That, however, is another tutorial.
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<SDL::Tutorial::Drawing>
+
+basic drawing with rectangles
+
+=item L<SDL::Tutorial::Animation>
+
+basic rectangle animation
+
+=item L<SDL::Tutorial::Images>
+
+image loading and animation
+
+=back
+
+=head1 AUTHOR
+
+chromatic, E<lt>chromatic@wgz.orgE<gt>.
+
+Written for and maintained by the Perl SDL project, L<http://sdl.perl.org/>.
+
+=head1 COPYRIGHT
+
+Copyright (c) 2003 - 2004, chromatic. All rights reserved. This module is
+distributed under the same terms as Perl itself, in the hope that it is useful
+but certainly under no guarantee.
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::Video - Bindings to the video category in SDL API
+
+=head1 SYNOPSIS
+
+This module is not an object. Please read the
+
+=head1 DESCRIPTION
+
+
+
+=head1 METHODS
+
+=head2 get_video_surface
+
+Returns a pointer to the current display surface
+
+=head2 get_video_info
+
+Returns a pointer to information about the video hardware
+
+=head2 video_driver_name
+
+Obtain the name of the video driver
+
+=head2 list_modes
+
+Returns a pointer to an array of available screen dimensions for the given format and video flags
+
+=head2 set_video_mode
+
+Checks to see if a particular video mode is supported.
+
+=head2 video_mode_ok
+
+Sets up a video mode with the specified width, height and bits-per-pixel.
+
+=head2 update_rect
+
+Makes sure the given area is updated on the given screen.
+
+=head2 update_rects
+
+Makes sure the given list of rectangles is updated on the given screen.
+
+=head2 flip
+
+Swaps screen buffers
+
+=head2 set_colors
+
+Sets a portion of the colormap for the given 8-bit surface.
+
+=head2 set_palette
+
+Sets the colors in the palette of an 8-bit surface.
+
+=head2 set_gamma
+
+Sets the color gamma function for the display
+
+=head2 get_gamma_ramp
+
+Gets the color gamma lookup tables for the display
+
+=head2 set_gmmma_ramp
+
+Sets the color gamma lookup tables for the display
+
+=head2 map_RGB
+
+Maps a RGB color value to a pixel format.
+
+=head2 map_RGBA
+
+Maps a RGBA color value to a pixel format.
+
+=head2 get_RGB
+
+Gets RGB values from a pixel in the specified pixel format.
+
+=head2 get_RGBA
+
+Gets RGBA values from a pixel in the specified pixel format.
+
+=head2 create_RGB_surface_from
+
+Creates an empty SDL::Surface from pixel data
+
+=head2 lock_surface
+
+Locks a surface for direct access.
+
+=head2 unlock_surface
+
+Unlocks a previously locked surface.
+
+=head2 convert_surface
+
+Converts a surface to the same format as another surface.
+
+=head2 display_format
+
+Converts a surface to the display format
+
+=head2 display_format_alpha
+
+Converts a surface to the display format
+
+=head2 load_BMP
+
+
+=head2 save_BMP
+
+
+=head2 set_color_key
+
+
+=head2 set_alpha
+
+
+=head2 set_clip_rect
+
+
+=head2 get_clip_rect
+
+
+=head2 blit_surface
+
+
+=head2 fill_rect
+
+
+=head2 GL_load_library
+
+
+=head2 GL_get_proc_address
+
+
+=head2 GL_get_attribute
+
+
+=head2 GL_set_attribute
+
+
+=head2 GL_swap_buffers
+
+
+=head2 GL_attr
+
+
+=head2 lock_YUV_overlay
+
+
+=head2 unlock_YUV_overlay
+
+
+=head2 display_YUV_overlay
+
+
+
+=head1 SEE ALSO
+
+=head2 Category Objects
+
+L<SDL::Surface>, L<SDL::Overlay>, L<SDL::Color>,
+L<SDL::Rect>, L<SDL::Palette>, L<SDL::PixelFormat>,
+L<SDL::VideoInfo>
+
+=cut
--- /dev/null
+=pod
+
+=head1 NAME
+
+SDL::VideoInfo - Video Target Information
+
+=head1 SYNOPSIS
+
+ my $video_info = SDL::Video::get_video_info();
+
+VideoInfo is only accessible C<SDL::Video::get_video_info>. This module only provides getters to the struct C<SDL_VideoInfo>.
+
+
+=head1 DESCRIPTION
+
+This object is a read-only structure and is returned by C<SDL::Video::get_video_info>. It contains information on either the best available mode if called before C<SDL::Video::set_video_mode> or the current video mode if called after C<SDL::Video::set_video_mode>.
+
+=head1 METHODS
+
+
+=head2 hw_available
+
+ $video_info->hw_available() # 1 if Hardware Accelerated Surfaces available
+
+Is it possible to create hardware surfaces ?
+
+=head2 wm_available
+
+ $video_info->wm_available() # 1 if Window Manager available
+
+Is there a window manager available ?
+
+=head2 blit_hw
+
+ $video_info->blit_hw()
+
+Are hardware to hardware blits accelerated ?
+
+=head2 blit_hw_CC
+
+ $video_info->blit_hw_CC()
+
+Are hardware to hardware colorkey blits accelerated ?
+
+=head2 blit_hw_A
+
+ $video_info->blit_hw_A()
+
+Are hardware to hardware alpha blits accelerated ?
+
+=head2 blit_sw
+
+ $video_info->blit_sw()
+
+Are software to hardware blits accelerated ?
+
+=head2 blit_sw_CC
+
+ $video_info->blit_sw_CC()
+
+
+Are software to hardware colorkey blits accelerated ?
+
+=head2 blit_sw_A
+
+ $video_info->blit_sw_A()
+
+Are software to hardware alpha blits accelerated ?
+
+=head2 blit_fill
+
+ $video_info->blit_fill()
+
+Are color fills accelerated ?
+
+=head2 video_mem
+
+ my $video_mem = $video_info->video_mem();
+
+Total amount of video memory in Kilobytes, should be accessed only if hw_available == 1, otherwise it is equal to 0
+
+=head2 vfmt
+
+ my $vd_pixel_format = $video_info->vfmt();
+
+
+C<SDL::PixelFormat> of the video device
+
+=head2 current_w, current_h
+
+ $video_info->current_w();
+ $video_info->current_h();
+
+Width and height of the current video mode, or of the desktop mode if C<SDL_GetVideoInfo> was called before C<SDL::Video::set_video_mode> (available since SDL 1.2.10)
+
+=head1 SEE ALSO
+
+L<SDL::Video>, L<SDL::PixelFormat>
+
+=cut