X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL.html-inc;h=760a317734ef70535bcd1092974983b056dcd61d;hb=730002126336ce3793b5e2b77996f4ae8cb01243;hp=b74b8be147f53012759c03602ec6cc276a17a7d4;hpb=096d8dc83e9fce28b4ee221fcbe30eb9ead13da5;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL.html-inc b/pages/SDL.html-inc index b74b8be..760a317 100644 --- a/pages/SDL.html-inc +++ b/pages/SDL.html-inc @@ -2,306 +2,236 @@
SDL_perl - Simple DirectMedia Layer for Perl
+SDL - Simple DirectMedia Layer for Perl
Core
use SDL; +use SDL;
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.
+SDL_perl is a package of Perl modules that provide both functional and object oriented interfaces to the Simple DirectMedia Layer for Perl 5. +This package takes 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.
Nick: magnet +CONSTANTS
++-The constants are not exported by default. You can export them by doing:
+use SDL ':all';- -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 +or access them directly:
+SDL::SDL_INIT_AUDIO;- -Maintainance
---Nick: kthakore - Name: Kartik Thakore +or by choosing the export tags below:
+Export tag: ':init'
+SDL_INIT_AUDIO + SDL_INIT_VIDEO + SDL_INIT_CDROM + SDL_INIT_EVERYTHING + SDL_INIT_NOPARACHUTE + SDL_INIT_JOYSTICK + SDL_INIT_TIMERMacOSX Experimental Usage
--Please get libsdl packages from Fink
-perl Build.PL - perl Build test - perl Build bundle - perl Build install - -+METHODS
+-Running SDL Perl Scripts in MacOSX
--First set the PERL5LIB environment variable to the dependencies of your script
-%export PERL5LIB=$PERL5LIB:./lib +init
++-SDL::init( $flags );-Use the SDLPerl executable made in the bundle and call your scripts
-%SDLPerl.app/Contents/MacOS/SDLPerl yourScript.pl +As with the C language API, SDL Perl initializes the SDL environment with the
+SDL::init
subroutine. +This routine takes a mode flag constructed through the bitwise OR product of theSDL_INIT_*
constants. +The$flags
tellSDL::init
which subsystems to initialize.SDL::init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);+
SDL::init
returns0
on success, or-1
on error.Functions exported by SDL.pm
-+init_subsystem
++-SDL::init_subsystem( $flags ); -init(flags)
---As with the C language API, SDL_perl initializes the SDL environment through -the
-SDL::init
subroutine. This routine takes a mode flag constructed through -the bitwise OR product of the following constants:-
-- * -INIT_AUDIO
-- * -INIT_VIDEO
-- * -INIT_CDROM
-- * -INIT_EVERYTHING
-- * -INIT_NOPARACHUTE
-- * -INIT_JOYSTICK
-- * -INIT_TIMER
-+ +
SDL::Init
returns 0 on success, or -1 on error.After SDL has been initialized with
+SDL::init
you may initialize any uninitialized subsystems withSDL::init_subsystem
. +The$flags
tellSDL::init_subsystem
which subsystems to initialize, and are taken in the same way asSDL::init
.
SDL::init_subsystem
returns0
on success, or-1
on error.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.
+quit_subsystem
++-SDL::quit_subsystem( $flags ); -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.
+ ++
SDL::quit_subsystem
allows you to shut down a subsystem that has been previously initialized bySDL::init
orSDL::init_subsystem
. +The$flags
tellSDL::quit_subsystem
which subsystems to shut down, and are taken in the same way asSDL::init
.
SDL::quit_subsystem
doesn't return any values.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.
+SDL::quit; -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).
+ ++
SDL::quit
Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources.Note: This will be called automatically when Perl exits. You don't need to call this, except if you want to initialize SDL again after this.
++
SDL::quit
doesn't return any values.was_init
++-my $flags = SDL::was_init( $flags ); +++
SDL::was_init
allows you to see which SDL subsytems have been initialized. +The$flags
tellSDL::was_init
which subsystems to check, and are taken in the same way asSDL::init
.+
SDL::was_init
returns a mask of the initialized subsystems it checks. +If$flags
is0
orSDL_INIT_EVERYTHING
, a mask of all initialized subsystems will be returned (this does not includeSDL_INIT_EVENTTHREAD
orSDL_INIT_NOPARACHUTE
).use SDL ':all'; + my $mask = SDL::was_init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); + if($mask & SDL_INIT_AUDIO and $mask & SDL_INIT_JOYSTICK) { + # Both subsystems are initialized! + } +get_error()
+get_error
--The last error message set by the SDL library can be retrieved using the subroutine -
+SDL::get_error
, which returns a scalar containing the text of the message if any.my $error = SDL::get_error; + ++Returns a scalar value containing the last error message set by the SDL library (if any).
set_error_real(error, @values)
--SDL::get_error sets the SDL error to a printf style formatted string. -it doesn't returns any values.
+set_error_real
++-SDL::set_error_real( $printf_format, @values ) + +++
SDL::set_error_real
sets the SDL error to aprintf
style formatted string.
SDL::set_error_real
doesn't return any values.error(code) * need to be coded
--Sets the SDL error message to one of several predefined strings specified by code.
-code can be :
--
- - - - -- 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.
-SDL::Error doesn't returns any value.
+clear_error
+++SDL::clear_error; +++
SDL::clear_error
deletes all information about the last SDL error. +This is useful if the error has been handled by the program.+
SDL::clear_error
doesn't return any values.version
++-my $version = SDL::version; ++Returns an
+SDL::Version
object of the SDL library at compile-time.use SDL; + use SDL::Version; + my $v = SDL::version; + printf("got version: %d.%d.%d\n", $v->major, $v->minor, $v->patch); -clear_error()
---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.
+load_object()
--Need to be coded.
+linked_version
++-
SDL::linked_version
works in the same way asSDL::version
, but returns anSDL::Version
object of the SDL library at link-time.load_function()
--Need to be coded.
+get_ticks
++-my $ticks = SDL::get_ticks; -unload_object()
---Need to be coded.
+ +Returns the number of milliseconds since SDL library initialization. +This value wraps around if the program runs for more than 49.7 days
VERSION()
--Need to be coded.
+get_handle
++-my $win32_handle = SDL::get_handle; -version()
---Need to be coded.
+ +A video surface must be inited to get a handle.
linked_version
--Need to be coded.
+delay
++-SDL::delay( $ms ); -get_error()
---The last error message set by the SDL library can be retrieved using the subroutine -
+ +SDL::get_error
, which returns a scalar containing the text of the message if any.+
SDL::delay
waits the specified number of milliseconds before returning. +The actual delay may be longer than specified depending on the underlying OS.+
SDL::delay
doesn't return anything.# Delay for half a second + SDL::delay(500); + +delay(ms)
--\ No newline at end of fileThis 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.
+SDL Manual: Getting Started
++A new book has been started to provide a complete tutorial for SDL. See http://search.cpan.org/perldoc?.
@@ -310,11 +240,90 @@ than the specified depending on the underlying OS.AUTHORS
-+magnet, kthakore
+Project Founder
+++David J. Goehrig
+Current Maintainers
+++Kartik Thakore (kthakore)
+Tobias Leich (FROGGS)
+Core Developers and Contributors
+++The following people have dedicated blood sweat and tears to making SDL Perl possible.
+See the impact graph on our github repository.
+Andy Bakun <sdlperl@thwartedefforts.org>
+Benedikt Meurer <bmeurer@fwdn.de>
+Blaise Roth (Blaizer) <blaizer@cpan.org>
+Breno G. de Oliveira (garu)
+Brian Cassidy (bricas)
+chromatic <chromatic@wgz.org>
+Daniel Mantovani <daniel.oliveira.mantovani@gmail.com>
+Daniel Ruoso http://daniel.ruoso.com/
+David J. Goehrig <dgoehrig@cpan.org>
+Dustin Mays (dorkfish) <dork.fish.wat.@gmail.com>
+Fedora
+Gabor Szabo (szabgab) <szabgab@gmail.com>
+Guillaue Cottenceau (gc) <gc@mandrakesoft.com>
+Heikki Meht&195;nen (hmehta/hejki) <heikki@mehtanen.fi>
+James King
+James Wright <jwright@cpan.org>
+Jeffrey T. Palmer (jtpalmer) <jeffrey.t.palmer@gmail.com>
+Kartik Thakore (kthakore) <thakore.kartik@gmail.com>
+KatrinaTheLamia
+kmx <kmx@cpan.org>
+Luke
+Michael Lamertz <mike@perl-ronin.de>
+morgoth.666
+Peter BARABAS <z0d@artifact.hu>
+Russell Valentine <russ_allegro@yahoo.com>
+Ryan Hanlon
+Stephane Desneux <sdx@desneux.com>
+Tels <http://www.bloodgate.com>
+Thomas Tongue
+Tobias Leich (FROGGS)
+Tony C
+Yuval Kogman (nothingmuch)
+Wayne Keenan <wayne@metaverse.fsnet.co.uk>
+If you would like to contribute to SDL Perl, please post a message on the mailing list:
+sdl-devel@perl.org
+And request access to the github repository. Or drop us a line on #sdl over at irc.perl.org
+COPYRIGHT & LICENSE
+++Copyright 2002-2010 SDL Authors as listed above, all rights reserved.
+This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself.
+ +DISCLAIMER OF WARRANTY
++BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH +YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR, OR CORRECTION.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE +LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, +OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE +THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. +