--- /dev/null
+BUGS and Outstanding Issues
+
+
+Using SDL::TTFont::width function with UTF-8 encoded strings returns
+the width of the characters that make up the UTF-8 format and not what
+they represent. The function for this appears to exist in SDL.xs:
+
+AV* TTFSizeUTF8 ( font, text )
+
+However, this function crashes immediately when called with a valid
+font and [utf-8 encoded] string.
+
--- /dev/null
+#! perl -w
+#
+# Copyright (C) 2003 chromatic
+# Copyright (C) 2004 David J. Goehrig
+#
+
+use strict;
+
+use lib 'make/lib';
+
+use SDL::Build;
+use YAML;
+
+my $sdl_compile_flags = `sdl-config --cflags`;
+my $sdl_link_flags = `sdl-config --libs`;
+
+if ($? >> 8)
+{
+ die "SDL doesn't appear to be installed.\n" .
+ "Please check that sdl-config is in your path and try again.\n";
+}
+
+chomp( $sdl_compile_flags );
+chomp( $sdl_link_flags );
+
+# subsystem to build
+# file
+# location of source file => location of build file to get name right
+# libraries
+# name of shared library (soname)
+# preprocessor definition
+# name of header file
+my %subsystems =
+(
+ SDL => {
+ file => {
+ from => 'src/SDL.xs',
+ to => 'src/SDL_perl.xs',
+ },
+ libraries => [qw( SDL SDL_image SDL_mixer SDL_net SDL_ttf SDL_gfx
+ png jpeg smpeg )],
+ },
+ OpenGL => {
+ file => {
+ from => 'src/OpenGL.xs',
+ to => 'src/SDL/OpenGL.xs',
+ },
+ libraries => [qw( SDL GL GLU )],
+ },
+ SFont => {
+ file => {
+ from => 'src/SFont.xs',
+ to => 'src/SDL/SFont.xs',
+ },
+ libraries => [qw( SDL SDL_image )],
+ },
+);
+
+my %libraries = (
+ SDL => {
+ define => 'HAVE_SDL',
+ header => 'SDL.h',
+ },
+ SDL_image => {
+ define => 'HAVE_SDL_IMAGE',
+ header => 'SDL_image.h'
+ },
+ SDL_mixer => {
+ define => 'HAVE_SDL_MIXER',
+ header => 'SDL_mixer.h'
+ },
+ SDL_net => {
+ define => 'HAVE_SDL_NET',
+ header => 'SDL_net.h'
+ },
+ SDL_ttf => {
+ define => 'HAVE_SDL_TTF',
+ header => 'SDL_ttf.h'
+ },
+ SDL_gfx => {
+ define => 'HAVE_SDL_GFX',
+ header => 'SDL_gfxPrimitives.h'
+ },
+ png => {
+ define => 'HAVE_PNG',
+ header => 'png.h',
+ },
+ jpeg => {
+ define => 'HAVE_JPEG',
+ header => 'jpeglib.h',
+ },
+ smpeg => {
+ define => 'HAVE_SMPEG',
+ header => 'smpeg.h',
+ },
+ GL => {
+ define => 'HAVE_GL',
+ header => 'gl.h'
+ },
+ GLU => {
+ define => 'HAVE_GLU',
+ header => 'glu.h'
+ },
+);
+
+# need the platform-specific module to find include paths correctly
+# see build/lib/SDL/Build/*pm
+my $arch = SDL::Build->get_arch( $^O );
+
+# see which subsystems can be built -- do we have headers for them?
+my $build_systems = $arch->find_subsystems( \%subsystems, \%libraries );
+
+# now write SDL::Config
+$arch->write_sdl_config( $build_systems );
+
+# and fetch all of the information needed to compile
+my $defines = $arch->build_defines( \%libraries, $build_systems );
+my $includes = $arch->build_includes( \%libraries, $build_systems );
+my $links = $arch->build_links( \%libraries, $build_systems );
+
+# mangle the compilable files into a format Module::Build can understand
+my %xs = map { $subsystems{$_}{file}{from} => $subsystems{$_}{file}{to} }
+ keys %subsystems;
+
+my $build = SDL::Build->new(
+ dist_name => 'SDL_Perl',
+ license => 'lgpl',
+ dist_version_from => 'lib/SDL.pm',
+ build_requires =>
+ {
+ 'Test::Simple' => '0.47',
+ 'Module::Build' => '0.22',
+ },
+ build_recommends =>
+ {
+ 'Pod::ToDemo' => '0.20',
+ },
+ xs_files => \%xs,
+ dist_author => 'David J. Goehrig <DGOEHRIG@cpan.org>',
+);
+
+# and here's where the real (and ugly) magic works... see SDL::Build
+$build->set_flags(
+ \%subsystems,
+ $build_systems,
+ $defines,
+ $includes,
+ $links,
+ $sdl_compile_flags,
+ $sdl_link_flags,
+);
+
+# now we're ready to go!
+$build->create_build_script();
--- /dev/null
+Revision history for Perl extension SDL_perl.
+
+
+* Oct 4 2004 David J. Goehrig <dgoehrig@cpan.org>
+ - Patched Cygwin.pm
+ - Fixed SDL::Rect documentation
+ - Fixed Freebsd build module package designation
+ - Fixed compile and link argument splitting in make/lib/Build.pm
+ - Added Module::Build to MEAT.yml
+
+* Sep 23 2004 David J. Goehrig <dgoehrig@cpan.org>
+ - added SDL::Config tests for SDL_gfx support to test/testgfxroto.pl
+ test/testgfxprim.pl and SDL::Tool::Graphic.pm
+ - removed exists test form SDL::Config::has()
+ - added SDL::PushEvent
+ - added SDL::SetEventType
+ - renamed SDL::OpenGL::glReadPixel(s)
+ - added error message for SDL::OpenGL::glLightModel
+ - cleaned up some formatting issues in OpenGL.xs
+ - fixed bug in SDL::Cdrom (referencing a scalar as a hashref)
+ - added some more documentation to SDL::Color
+ - added SDL::Event::push (Andy Bakun)
+ - fixed documentation and usage of SDL::Event::set
+ - added SDL::Event::type([type]) setting parameter
+ - updated Pod::ToDemo recommends in Build.PL
+ - added chromatic's OpenGL version checks
+ - added GL_ALL_CLIENT_ATTRIB_BITS (in addition to GL_CLIENT_ATTRIB_BITS)
+ - added chromatic's SDL::Build::Cygwin.pm and SDL::Build::Win32.pm
+ - applied chromatic's patches to SDL::Tutorial, etc. for updated Pod::ToDemo
+
+
+* Sep 21 2004 David J. Goehrig <dgoehrig@cpan.org>
+ - added thread check to SDL::Constants.pm (prevent unsafe SelfLoader)
+ - applied Andy Bakun <sdlperl@thwartedefforts.org>'s patches
+ to SDL::CreateRGBSurfaceFrom, SDL::SurfaceCopy, and
+ SDL::FreeSurface
+ - applied GLint* to typemap patch
+ - applied glRenderMode patch
+ - applied gluPickMatrix patch
+ - fixed SDL::Surface::blit typo bug
+ - applied glGet patch by Luke (enumerating them all!)
+ - fixed typo bug in make/lib/SDL/Build/Darwin.pm
+
+
+* Feb 23 2004 David J. Goehrig <dgoehrig@cpan.org>
+ - fixed OpenGL exporting & bootstrapping
+ - added ifdefs in OpenGL for NURBS and GLUTesslator
+ - updated the test scripts to use SDL::Config
+ - added OpenGL test
+ - modified SDL::Config->has to use grep instead
+ - fixed SDL::Cdrom::status
+ - added tests for SDL::Video and SDL::MPEG
+ - fixed gluPerspective in test1.pl & test2.pl
+ - moved SDL::OpenGL::Cube code into test2.pl
+ - released SDL_Perl-2.1.0
+
+* Feb 7 2004 David J. Goehrig <dgoehrig@cpan.org>
+ - added more SMPEG support
+ - added SDL::Video.pm and SDL::MPEG
+
+* Feb 6 2004 David J. Goehrig <dgoehrig@cpan.org>
+ - removed old build stuff
+ - added SDL::GetAppState
+ - added SDL::GetMouseState and SDL::GetRelativeMouseState
+ - added SDL Perl logo files
+ - Finalized 2.0.5 release
+
+* Feb 6 2004 chromatic
+ - added SDL::Tutorial
+ - added SDL::Tutorial::Animation
+ - added SDL::Tutorial::Drawing
+ - added SDL::Tutorial::Images
+
+* Feb 5 2004 David J. Goehrig <dgoehrig@cpan.org>
+ - port chromatic's Module::Build changes to 2.0.4
+ - moved SDL_TEXTWIDTH to SDL.pm (where EXPORTS BELONG in SDL.pm)
+ - applied chromatic's test directory change to testfonttool.pl
+ - fixed near/far in OpenGL.xs
+ - fixed checkkeys.pl to work with new event structure
+ - fixed testjoystick.pl to use new constants
+ - fixed USE_THREADS issue in build system
+ - fixed typo-bugs in SDL::Tool::Graphic.pm
+ - Updated MANIFEST
+ - fixed SFont support added SDL::SFont.pm
+ - removed SDL::Mixer and SDL::Event constants checks, no export
+
+* Dec 21 2003 chromatic
+ - added glDeleteLists
+ - added glReadPixels
+ - added glReadPixel
+
+* Sept 2 2003 David J. Goehrig <dave@sdlperl.org>
+ - fixed SDL::Music and SDL::Sound usage in SDL::Mixer
+
+* Aug 28 2003 Stephane Desneux <sdx@desneux.com>
+ - added SDL_VIDEOEXPOSE constant in SDL::Constants
+
+* Aug 26 2003 Stephane Desneux <sdx@desneux.com>
+ - modified Makefile.linux to remove debug unless $ENV{DEBUG} is defined
+ - added scripts/GL/gl.h header (OpenGL 1.4 header from Linux NVidia driver)
+ - modified gl_const.pl to generate SDL::OpenGL::Constants.pm using scripts/GL/gl.h
+ OpenGL constants now uses Exporter and SelfLoader
+ - modified sdl_const.pl to generate SDL::Constants
+ SDL constants now uses Exporter and SelfLoader
+ - modified SDL.pm to export constants from SDL::Constants
+ - modified SDL/OpenGL.pm to export constants from SDL::OpenGL::Constants
+ - changed all function names in OpenGL.xs (xxx replaced by glxxx or gluxxx)
+ changed export in SDL/OpenGL.pm accordingly
+ - removed warning in SDL::Surface::new()
+
+* Aug 21 2003 David J. Goehrig <dave@sdlperl.org>
+ - applied Thomas Tongue's MacOS X support patches
+
+* Aug 20 2003 David J. Goehrig <dave@sdlperl.org>
+ - fixed SDL::Event bug
+
+* Aug 17 2003 David J. Goehrig <dave@sdlperl.org>
+ - applied Tels' call list patches
+ - fixed some general boneheadedness with use strict
+ - got tests really working
+ - applied Russell's SDL::Tool::Graphic::grayScale patch
+ - added glLightModel
+
+* Aug 16 2003 David J. Goehrig <dave@sdlperl.org>
+ - applied morgoth.666's patch for glGetdv & others
+ - released 2.0 last week :)
+
+* May 23 2003 David J. Goehrig <dave@sdlperl.org>
+ - applied Ryan Hanlon's patch for SDL::TTFont::width
+
+* May 22 2003 David J. Goehrig <dave@sdlperl.org>
+ - fixed typemap
+ - changed SDL::Cdrom to use scalar refs
+ - changed SDL::Console to use scalar refs
+ - changed SDL::Event to use scalar refs
+ - changed SDL::Cursor to use scalar refs
+ - changed SDL::Font to use scalar refs
+ - changed SDL::Music to use scalar refs
+ - changed SDL::Palette to use scalar refs
+ - changed SDL::Sound to use scalar refs
+
+* May 20 2003 David J. Goehrig <dave@sdlperl.org>
+ - added more OpenGL constants
+ - added OpenGL name & Feedback functions
+ - ported documentation from the website to distro
+
+* Mar 13 2003 David J. Goehrig <dave@sdlperl.org>
+ - cleaned up OpenGL constants exportation
+ - fixed glColor alpha
+ - fixed all tests & the causes of failure
+ - fixed TTFont.pm color bug
+ - fixed SDL::Tool::Graphic
+
+* Mar 11 2003 David J. Goehrig <dave@sdlperl.org>
+ - changed USE_THREAD support because perl5.8 usually builds with it
+ - added SDL::Constants & SDL::OpenGL::Constants
+ - removed constant functions from XS code (going easier on the linker)
+ - changed version to SDL_perl-2.0-beta1 Way Too much is Broken release
+ - Moved Opt/* to regular & fixing as found broken
+ - 27% of tests now fail!
+
+* Feb 25 2003 David J. Goehrig <dave@sdlperl.org>
+ - resized the testmenu.pl script
+
+* Jan 6 2003 Wayne Keenan <tripixuk@yahoo.co.uk>
+ - fixed testjoystick.pl
+
+* Jan 4 2003 David J. Goehrig <dave@sdlperl.org>
+ - Added test suite, Thanks Tels
+ - Added SDL::SurfaceCopy finally
+ - Added SDL::Surface::new -surface && -copy constructors
+ - Changed SDL::Tool::Graphic::* to return a new SDL::Surface object
+ - Added SDL::Event::resize_w && SDL::Event::resize_h
+
+* Jan 3 2003 David J. Goehrig <dave@sdlperl.org>
+ - SDL_perl-1.20.0 release
+ - fixed default pitch value in SDL::Surface
+ - fixed test/OpenGL/tutorials/*, removed nasty -flags options
+
+* Jan 2 2003 David J. Goehrig <dave@sdlperl.org>
+ - Changed SDL::SurfacePixel to work as documented returns SDL_Color*
+ - Changed SDL::Surface::pixel to return SDL::Color object
+ - Changed SDL::SetColorKey to take SDL_Color*
+ - Changed SDL::Surface::set_color_key to take SDL_Color*,SDL::Color, && (x,y)
+ - Added test/testcolor.pl
+ - Fixed SDL::Opt::Surface::pixel to return SDL::Opt::Color objects
+ - Fixed test/testsprite.pl (must call display_format before set_color_key)
+ - removed use strict from test/testmenu.pl
+ - Added SDL::INIT_TIMER
+
+* Jan 1 2003 David J. Goehrig <dave@sdlperl.org>
+ - Added a lot of documentation stubs
+ - Added SDL_PREALLOC support
+ - Added SDL_VIDEORESIZE event type
+ - Moved SDL_* SDL_Surface flags EXPORT to SDL::Surface
+ - Added SDL::App::resize & -resizeable tag
+ - Updated README
+ - Added SDL::Opt::Surface, SDL::Opt::Rect, SDL::Opt::Color
+
+* Dec 30 2002 David J. Goehrig <dave@sdlperl.org>
+ - Cleaned SDL::App a little more
+ - Patch release SDL_perl-1.19.2
+
+* Dec 29 2002 Tels <http://www.bloodgate.com>
+ - Patched SDL::Font includes
+ - Optimized SDL::Rect
+
+* Dec 28 2002 Tels <http://www.bloodgate.com>
+ - Removed miscelaneous typos
+ - Rewrote utility function SDL::in
+
+* Dec 25 2002 Tels <http://www.bloodgate.com>
+ - Patched SDL::Timer documentation
+ - Patched SDL::Event documentation
+ - Patched SDL::Cdrom documentation
+ - Patched mail address in Readme
+
+* Dec 20 2002 Michael Lamertz <mike@perl-ronin.de>
+ - Fixed wrong spelling of XS call to SDL::App::grab_input function
+
+* Oct 14 2002 David J. Goehrig <dave@sdlperl.org>
+ - Altered usage message printing behavior for Guillaume
+ - Added Guillaume Cottenceau's <gc@mandrakesoft.com>
+ 64 bit support patch.
+ - Patch release SDL_perl-1.19.1
+
+* Oct 13 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added ConvertRGB and ConvertRGBA functions, useful
+ for creating OpenGL textures from arbitrary images.
+ - Updated documentation for SDL::Cursor
+
+* Oct 11 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added library disable configure options for linux
+ - Released SDL_perl-1.19.0
+
+* Sept 28 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed some prototypes (OpenGL happier on Debian)
+
+* Sept 5 2002 David J. Goehrig <dave@sdlperl.org>
+ - Optimizaiton in SDL::App::loop,
+ now syncs app only if action called
+ - Added test/testmenu.pl (precursor to a menu class)
+
+* Sept 4 2002 Russell Valentine <russ_allegro@yahoo.com>
+ - Added SDL::GraphicTool and testgraphictool.pl
+
+* Aug 31 2002 David J. Goehrig <dave@sdlperl.org>
+ - Removed redundant variable in SDL::Mixer::fade_in_music
+ Thanks to Peter BARABAS <z0d@artifact.hu> for finding it
+
+* Aug 30 2002 David J. Goehrig <dave@sdlperl.org>
+ - Altered examples to use 16 bit color
+ - Fixed OpenGL/tutorial gluPerspective bugs
+
+* Jun 14 2002 David J. Goehrig <dave@sdlperl.org>
+ - Finished color table and convolution support
+ - Added more GLUtesselator support
+
+* Jun 10 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added configure script, gnuish build environemnt
+
+* Jun 8 2002 David J. Goehrig <dave@sdlperl.org>
+ - Applied Wayne Keenan's win32 build patches
+
+* Jun 5 2002 David J. Goehrig <dave@sdlperl.org>
+ - Simply defines GL_ALL_CLIENT_ATTRIB_BITS 0xffffffff
+ - SDL::TTFont added font metric query methods
+
+* Jun 4 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed GL_ALL_CLIENT_BITS Mesa bug again...
+ It appears to have disappeared after 1.17.2,
+ Thanks Seemant Kulleen & Chris Moeller for
+ pointing it out.
+
+* May 28 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added tutorials 7 & 8 to test/OpenGL/tutorial
+
+* May 27 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed SDL::OpenGL::TexCoordPointer
+
+* May 26 2002 David J. Goehrig <dave@sdlperl.org>
+ - SDL_perl-1.18
+
+* May 25 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed include paths under linux
+ - Added SDL::Shell.pm and test/testshell.pl
+
+* May 24 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed more OpenGL GLU tesselator code
+ - Added HAVE_SDL_MIXER around callbacks
+
+* May 23 2002 Benedikt Meurer <bmeurer@fwdn.de>
+ - Added FreeBSD support
+
+* May 21 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed typo in SDL::App:iconify
+
+* May 3 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added still more OpenGL support (errors and textures)
+ - Ported old OpenGL tutorials 2-6
+ - Fixed more bugs, improved SDL::SurfacePixels
+ - Added support for glu* and GLU_* exportation
+ - Added OpenGLU Nurbs support
+ - Added Nurbs example test/OpenGL/test5.pl
+ - Added more OpenGL projection and color code
+
+* May 1 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed -Wall (added prototypes, fixed typos, etc)
+ - Improved Makefile, added GLU version detection
+ - Added OpenGL 1.2 dependent feature detection
+ - Added one and two dimension evaluators for OpenGL
+ - Added OpenGL test3.pl and test4.pl
+
+* Apr 30 2002 Wayne Keenan <wayne@metaverse.fsnet.co.uk>
+ - updated Makefile.win32
+
+* Apr 29 2002 Guillaume Cottenceau <gc@mandrakesoft.com>
+ - updated Makefile.linux
+
+* Apr 27 2002 David J. Goehrig <dave@sdlperl.org>
+ - SDL_perl-1.17 release made
+ - updated MANIFEST, etc.
+
+* Apr 26 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added more OpenGL support
+
+* Apr 23 2002 David J. Goehrig <dave@sdlperl.org>
+ - fixed SFont and SDL_Console support
+ - Added SDL::FontTool
+ - Added test/testfonttool.pl
+
+* Apr 19 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added proper SDL_mixer callback support
+ - Broke out linux makefile
+ - Begun OpenGL support
+ - fixed test/testgfxprim.pl screen update bug
+ - fixed test/testgfxroto.pl alpha blits
+ - Added test/logo.png
+
+* Apr 16 2002 Wayne Keenan <wayne@metaverse.fsnet.co.uk>
+ - Added SDL_Console support
+ - Added test/testconsole.pl
+ - Added SDL_gfx support
+ - Added test/testgfxroto.pl and test/testgfxprim.pl
+ - Updated Makefile
+
+* Apr 11 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed SDL::ColorB typo
+ - Altered SDL::FillRect and SDL::Pixel to use SDL_Color* sources
+ - Documented SDL::Surface, SDL::Color
+ - Added automagic Surface, Color, and Rect support throughout OO layer
+ - Fixed testsprite.pl, graywin.pl to use above classes
+ - Brokeout Win32 Makefile.PL
+ - Fixed SMPEG a little bit
+
+* Apr 11 2002 Wayne Keenan <wayne@metaverse.fsnet.co.uk>
+ - Added SMPEG support
+ - Added test/testsprite.pl
+
+* Apr 10 2002 Wayne Keenan <wayne@metaverse.fsnet.co.uk>
+ - Added Win32 threading support in callbacks
+ - Added SDL_GetKeyState
+
+* Apr 8 2002 Wayne Keenan <wayne@metaverse.fsnet.co.uk>
+ - Added joystick hat constants
+ - Added joystick hat constants to test/testjoystick.pl
+
+* Apr 5 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed SDL_perl.spec according to most of Guillaume's suggestions
+ - Expanded the build_rpms script to upload to sdlperl.org
+ - Added SDL::Timer.pm for timer objects
+ - Added test/testtimer.pl
+
+* Apr 4 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added SDL_perl.spec for RPM/SRPM builds
+ - Fixed typo in SDL_perl.xs
+
+* Apr 4 2002 Wayne Keenan <wayne@metaverse.fsnet.co.uk>
+ - Fixed Makefile.PL for Win32 builds
+
+* Apr 4 2002 Russell Valentine <russ_allegro@yahoo.com>
+ - Added test/testjoystick.pl
+
+* Apr 3 2002 David J. Goehrig <dave@sdlperl.org>
+ - Fixed SDL::TTFont support
+ - Fixed SDL::Color support
+ - Applied Wayne's changes for Win32 support
+ - Moved XS code to SDL_perl.xs
+ - Created SDL_perl.pm
+ - Altered SDL.pm to use SDL_perl.pm
+
+* Apr 1 2002 David J. Goehrig <dave@sdlperl.org>
+ - Added SDL::Color
+ - Added SDL::TTFont
+ - Added SDL::App::loop
+ - More Documentation
+
+* Mar 31 2002 David J. Goehrig <dave@sdlperl.org>
+ - Upgraded SFont to version 1.5 <http://www.linux-games.com/sfont>
+ - Removed old examples and began porting SDL test programs to perl
+ - Updated key state modifier code
+ - Added audio processing callbacks and driver interrogation
+
+* Mar 14 2002 David J. Goehrig <dave@sdlperl.org>
+
+ - Added YUV Overlay support
+ - Added more WM support (toggle fullscreen,grab input,iconify window)
+ - Added Resize Event support
+ - Added Joystick Events support
+ - Added audio status query support
+ - Removed TrackListing
+
+* Mar 9 2002 David J. Goehrig <dave@sdlperl.org>
+
+ - Generated sdlpl compatability layer ( known to be buggy )
+ - Bug fixes in OO modules, frozen-bubble now runs under 1.14
+ - Added patches directory to contain fixes for other people's programs
+ - Added some Set/GetClipRect support
+ - More Documentation
+ - Began SDL_ttf support
+ - Began SDL_net support
+
+* Feb 28 2002 David J. Goehrig <dave@sdlperl.org>
+
+ - Fixed-up OO modules to use new API
+ - Added AddTimer and RemoveTimer Support
+ - Added Joystick Support
+ - Added full Init/Quit support for subsystems
+ - Began Documentation Rewrite
+ - Began 1.12 compatability layer
+
+* Feb 26 2002 David J. Goehrig <dave@sdlperl.org>
+
+ - Altered API / Simplified namespace
+ - Removed SDL_Image, SDL_Mixer, and OpenGL dependencies
+ - Added extension autodetection to config process
+
+* Jan 28 2002 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ - Fixed a deallocation bug in Sound.pm
+
+* Jan 22 2002 Guillaume Cottenceau <gc@mandrakesoft.com>
+
+ - Fixed a deallocation bug in Music.pm
+
+* Dec 18 2000 David J. Goehrig
+
+ - Removed clipping fuctions
+ - Updated Readme
+ - Moved more to sourceforge
+
+* Aug 5 2000 Wayne Keenan
+
+ - Open GL support
+ - OpenGL Glut like Application framework
+ - more video flags
+ - creating Surface from pre-allocated memory
+ - BMP screen dump
+ - added state dumpers as an debugging aid
+ - bug fixes
+
+* May 26 2000 David J. Goehrig
+
+ - Added SFont support.
+
+* May 22 2000 David J. Goehrig
+
+ - Finished the first release
+
--- /dev/null
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+\f
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+\f
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+\f
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+\f
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. 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 LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
--- /dev/null
+BUGS
+Build.PL
+CHANGELOG
+COPYING
+lib/SDL/App.pm
+lib/SDL/Cdrom.pm
+lib/SDL/Color.pm
+lib/SDL/Constants.pm
+lib/SDL/Cursor.pm
+lib/SDL/Event.pm
+lib/SDL/Font.pm
+lib/SDL/Mixer.pm
+lib/SDL/MPEG.pm
+lib/SDL/Music.pm
+lib/SDL/OpenGL/Constants.pm
+lib/SDL/OpenGL.pm
+lib/SDL/Palette.pm
+lib/SDL_perl.pm
+lib/SDL.pm
+lib/SDL/Rect.pm
+lib/SDL/SFont.pm
+lib/SDL/Sound.pm
+lib/SDL/Surface.pm
+lib/SDL/Timer.pm
+lib/SDL/Tool/Font.pm
+lib/SDL/Tool/Graphic.pm
+lib/SDL/TTFont.pm
+lib/SDL/Tutorial/Animation.pm
+lib/SDL/Tutorial/Drawing.pm
+lib/SDL/Tutorial/Images.pm
+lib/SDL/Tutorial.pm
+lib/SDL/Video.pm
+logo/sdl_perl_logo_large.png
+logo/sdl_perl_logo_small.png
+make/lib/SDL/Build/Cygwin.pm
+make/lib/SDL/Build/Darwin.pm
+make/lib/SDL/Build/Freebsd.pm
+make/lib/SDL/Build/Linux.pm
+make/lib/SDL/Build/MSWin32.pm
+make/lib/SDL/Build/Netbsd.pm
+make/lib/SDL/Build.pm
+MANIFEST
+META.yml
+README
+src/defines.h
+src/OpenGL.xs
+src/SDL.xs
+src/SFont.h
+src/SFont.xs
+t/apppm.t
+t/cdrompm.t
+t/colorpm.t
+t/cursorpm.t
+t/eventpm.t
+t/fontpm.t
+t/mixerpm.t
+t/mpegpm.t
+t/musicpm.t
+t/opengl.t
+t/palettepm.t
+t/rectpm.t
+t/sdlpm.t
+t/soundpm.t
+t/surfacepm.t
+t/timerpm.t
+t/toolfontpm.t
+t/toolgraphicpm.t
+t/ttfontpm.t
+t/videopm.t
+test/checkkeys.pl
+test/data/24P_Arial_NeonYellow.png
+test/data/24P_Copperplate_Blue.png
+test/data/aircut3.ttf
+test/data/electrohar.ttf
+test/data/highlight.png
+test/data/icon.bmp
+test/data/LargeFont.bmp
+test/data/logo.png
+test/data/menu.png
+test/data/sample.wav
+test/graywin.pl
+test/loopwave.pl
+test/OpenGL/README
+test/OpenGL/test1.pl
+test/OpenGL/test2.pl
+test/OpenGL/test3.pl
+test/OpenGL/test4.pl
+test/OpenGL/test5.pl
+test/OpenGL/tutorial/Data/crate.png
+test/OpenGL/tutorial/Data/cube.bmp
+test/OpenGL/tutorial/Data/glass.bmp
+test/OpenGL/tutorial/Data/NeHe.png
+test/OpenGL/tutorial/Data/Star.bmp
+test/OpenGL/tutorial/Data/tim.jpg
+test/OpenGL/tutorial/Data/world.txt
+test/OpenGL/tutorial/lesson02.pl
+test/OpenGL/tutorial/lesson03.pl
+test/OpenGL/tutorial/lesson04.pl
+test/OpenGL/tutorial/lesson05.pl
+test/OpenGL/tutorial/lesson06.pl
+test/OpenGL/tutorial/lesson07.pl
+test/OpenGL/tutorial/lesson08.pl
+test/README
+test/testcolor.pl
+test/testfonttool.pl
+test/testgfxprim.pl
+test/testgfxroto.pl
+test/testgraphictool.pl
+test/testjoystick.pl
+test/testmenu.pl
+test/testsprite.pl
+test/testtimer.pl
+TODO
+typemap
--- /dev/null
+---
+name: SDL_Perl
+version: 2.1.3
+author:
+ - David J. Goehrig <DGOEHRIG@cpan.org>
+abstract: Simple DirectMedia Layer for Perl
+license: lgpl
+build_requires:
+ Module::Build: 0.22
+ Test::Simple: 0.47
+provides:
+ SDL:
+ file: lib/SDL.pm
+ version: 2.1.3
+ SDL::App:
+ file: lib/SDL/App.pm
+ SDL::Cdrom:
+ file: lib/SDL/Cdrom.pm
+ SDL::Color:
+ file: lib/SDL/Color.pm
+ SDL::Constants:
+ file: lib/SDL/Constants.pm
+ SDL::Cursor:
+ file: lib/SDL/Cursor.pm
+ SDL::Event:
+ file: lib/SDL/Event.pm
+ SDL::Font:
+ file: lib/SDL/Font.pm
+ SDL::MPEG:
+ file: lib/SDL/MPEG.pm
+ SDL::Mixer:
+ file: lib/SDL/Mixer.pm
+ SDL::Music:
+ file: lib/SDL/Music.pm
+ SDL::OpenGL:
+ file: lib/SDL/OpenGL.pm
+ SDL::OpenGL::Constants:
+ file: lib/SDL/OpenGL/Constants.pm
+ SDL::Palette:
+ file: lib/SDL/Palette.pm
+ SDL::Rect:
+ file: lib/SDL/Rect.pm
+ SDL::SFont:
+ file: lib/SDL/SFont.pm
+ SDL::Sound:
+ file: lib/SDL/Sound.pm
+ SDL::Surface:
+ file: lib/SDL/Surface.pm
+ SDL::TTFont:
+ file: lib/SDL/TTFont.pm
+ SDL::Timer:
+ file: lib/SDL/Timer.pm
+ SDL::Tool::Font:
+ file: lib/SDL/Tool/Font.pm
+ SDL::Tool::Graphic:
+ file: lib/SDL/Tool/Graphic.pm
+ SDL::Tutorial:
+ file: lib/SDL/Tutorial.pm
+ SDL::Tutorial::Animation:
+ file: lib/SDL/Tutorial/Animation.pm
+ SDL::Tutorial::Drawing:
+ file: lib/SDL/Tutorial/Drawing.pm
+ SDL::Tutorial::Images:
+ file: lib/SDL/Tutorial/Images.pm
+ SDL::Video:
+ file: lib/SDL/Video.pm
+ SDL_perl:
+ file: lib/SDL_perl.pm
+ Walker:
+ file: lib/SDL/Tutorial/Images.pm
+ main:
+ file: lib/SDL/Tutorial/Images.pm
+generated_by: Module::Build version 0.2611
--- /dev/null
+README for SDL_Perl-2.1.2
+
+What's New in 2.1.2:
+
+SDL_Perl-2.1.2 is a bug patch release that fixed a number of memory
+leaks in blitting code, handles glGet queries, and some Build fixes.
+For full details check the CHANGELOG file.
+
+Prerequisites:
+
+SDL Perl recommends installing the following libraries available
+from http://www.libsdl.org/ prior to installing:
+
+ SDL-1.2.6
+ smpeg-0.4.4
+ SDL_image-1.2.2
+ SDL_gfx-2.0.3
+ SDL_mixer-1.2.5
+ SDL_net-1.2.4
+ SDL_ttf-2.0.5
+
+Additionally the following Perl modules should be installed:
+
+ Module-Build-0.22
+ Test-Simple-0.47
+
+Installation:
+
+ perl Build.PL
+ ./Build
+ ./Build test
+ ./Build install
+
+The build process will use the new Module::Build facility
+to autodetect and build SDL Perl for your platform. If
+the build fails please forward bugs to sdl-devel@perl.org.
+
+Documentation:
+
+Each module now includes its own documentation, and
+is accessible through perldoc. Additional tutorials,
+code, and tips can be found at the website:
+
+ http://sdl.perl.org
+
+Online documentation and tutorials are available through
+perldoc module.
+
+Contributing:
+
+Anyone wishing to contribute modules, sprite engines, documentation,
+and anything else that others might find useful, please join
+the mailing list:
+
+ sdl-devel@perl.org
+
+This is a mailing list for those interested in SDLperl development,
+both as an applications developer, and as a core contributor.
+
+I am always more than happy to take patches, bug reports, and
+helpful suggestions. It is feedback, both good and poor, that
+keeps projects like this going.
+
+Enjoy,
+
+David J. Goehrig <dgoehrig@cpan.org>
+23 September 2004
+
--- /dev/null
+TODO for SDL_perl
+
+ o Add SDL_EventFilter support
+
+
--- /dev/null
+#
+# Copyright (C) 2004 David J. Goehrig
+#
+
+package SDL;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
+
+require Exporter;
+require DynaLoader;
+
+use SDL_perl;
+use SDL::Constants;
+
+BEGIN {
+ @ISA = qw(Exporter DynaLoader);
+ @EXPORT = qw( in verify &NULL );
+ # reexport all SDL constants
+ for (@SDL::Constants::EXPORT) {
+ push @EXPORT,$_;
+ }
+};
+
+
+$VERSION = '2.1.3';
+
+print "$VERSION" if (defined($ARGV[0]) && ($ARGV[0] eq '--SDLperl'));
+
+$SDL::DEBUG=1;
+
+sub NULL {
+ return 0;
+}
+
+sub in {
+ my ($k,@t) = @_;
+ (scalar grep { defined $_ && $_ eq $k } @t) <=> 0;
+}
+
+sub verify (\%@) {
+ my ($options,@valid_options) = @_;
+ for (keys %$options) {
+ die "Invalid option $_\n" unless in ($_, @valid_options);
+ }
+}
+
+
+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.
+
+=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 functions:
+
+=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 GetError()
+
+The last error message set by the SDL library can be retrieved using the subroutine
+C<SDL::GetError>, 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.
+
+=head2 GetTicks()
+
+An application may retrieve the number of milliseconds expired since the initilization
+of the application through this subroutine. This value resets rougly ever 49 days.
+
+=head2 AddTimer(interval,callback,param)
+
+C<AddTimer> will register a SDL_NewTimerCallback function to be executed after
+C<interval> milliseconds, with parameter C<param>. SDL_NewTimerCallback objects
+can be constructed with the C<NewTimer> subroutine. C<SDL::PerlTimerCallback>
+will return a valid callback for executing a perl subroutine or closure.
+This subroutine returns a SDL_TimerID for the newly registered callback, or NULL
+on error.
+
+=head2 NewTimer(interval,subroutine)
+
+The C<NewTimer> takes an interval in milliseconds and a reference to a subroutine
+to call at that interval. The subroutine will be invoked in a void context
+and accepts no parameters. The callback used is that returned by C<SDL::PerlTimerCallback>.
+C<NewTimer> returns the SDL_TimerID for the new timer or NULL on error.
+
+=head2 RemoveTimer(id)
+
+This subroutine taks a SDL_TimerID and removes it from the list of active callbacks.
+RemoveTimer returns false on failure.
+
+=head2 SetTimer
+
+This subroutine is depreciated, please use C<NewTimer> or C<AddTimer> instead.
+
+=head2 CDNumDrives()
+
+C<SDL::CDNumDrives> returns the number of available CD-ROM drives in the system.
+
+=head2 CDName(drive)
+
+The subroutine C<SDL::CDName> returns the system specific human readable device name
+for the given CD-ROM drive.
+
+=head2 CDOpen(drive)
+
+This subroutine opens a CD-ROM drive for access, returning NULL if the drive is busy
+or otherwise unavailable. On success this subroutine returns a handle to the CD-ROM
+drive.
+
+=head2 CDTrackListing(cd)
+
+C<SDL::CDTrackListing> returns a human readable description of a CD-ROM. For each
+track one line will be produced with the following format:
+
+ Track index: %d, id %d, %2d.%2d
+
+This is provided to ease the creation of human readable descriptions and debugging.
+
+=head2 CDTrackId(track)
+
+C<CDTrackId> returns the id field of the given SDL_CDtrack structure.
+
+=head2 CDTrackType(track)
+
+C<CDTrackType> returns the type field of the given SDL_CDtrack structure.
+
+=head2 CDTrackLength(track)
+
+C<CDTrackLength> returns the length field of the given SDL_CDtrack structure.
+
+=head2 CDTrackOffset(track)
+
+C<CDTrackOffset> returns the offset field of the given SDL_CDtrack structure.
+
+=head2 CDStatus(cd)
+
+The function C<CDStatus> returns the current status of the given SDL_CDrom.
+C<CDStatus>'s return values are:
+
+=over 4
+
+=item *
+CD_TRAYEMPTY
+
+=item *
+CD_PLAYING
+
+=item *
+CD_STOPPED
+
+=item *
+CD_PAUSED
+
+=item *
+CD_ERROR
+
+=back
+
+=head2 CDPlayTracks(cd,track,tracks,frame,frames)
+
+To start playing from an arbitrary portion of a CD, one can provide
+C<SDL::CDPlayTracks> with a CD, a starting track, the number of tracks,
+a starting frame, and the number of frames to be played.
+
+=head2 CDPlay(cd,track,length)
+
+C<SDL::CDPlay> plays the next C<length> tracks starting from C<track>
+
+=head2 CDPause(cd)
+
+This function will pause CD playback until resume is called.
+
+=head2 CDResume(cd)
+
+This function will resume CD playback if paused.
+
+=head2 CDStop(cd)
+
+C<SDL::CDStop> will stop CD playback if playing.
+
+=head2 CDEject(cd)
+
+This function will eject the CD
+
+=head2 CDClose(cd)
+
+This function will release an opened CD.
+
+=head2 CDNumTracks
+
+=head2 CDCurTrack
+
+=head2 CDCurFrame
+
+=head2 CDTrack
+
+=head2 PumpEvents
+
+=head2 NewEvent
+
+=head2 FreeEvent
+
+=head2 PollEvent
+
+=head2 WaitEvent
+
+=head2 EventState
+
+=head2 IGNORE
+
+=head2 ENABLE
+
+=head2 QUERY
+
+=head2 ACTIVEEVENT
+
+=head2 KEYDOWN
+
+=head2 KEYUP
+
+=head2 MOUSEMOTION
+
+=head2 MOUSEBUTTONDOWN
+
+=head2 MOUSEBUTTONUP
+
+=head2 QUIT
+
+=head2 SYSWMEVENT
+
+=head2 EventType
+
+=head2 ActiveEventGain
+
+=head2 ActiveEventState
+
+=head2 APPMOUSEFOCUS
+
+=head2 APPINPUTFOCUS
+
+=head2 APPACTIVE
+
+=head2 KeyEventState
+
+=head2 SDLK_BACKSPACE
+
+=head2 SDLK_TAB
+
+=head2 SDLK_CLEAR
+
+=head2 SDLK_RETURN
+
+=head2 SDLK_PAUSE
+
+=head2 SDLK_ESCAPE
+
+=head2 SDLK_SPACE
+
+=head2 SDLK_EXCLAIM
+
+=head2 SDLK_QUOTEDBL
+
+=head2 SDLK_HASH
+
+=head2 SDLK_DOLLAR
+
+=head2 SDLK_AMPERSAND
+
+=head2 SDLK_QUOTE
+
+=head2 SDLK_LEFTPAREN
+
+=head2 SDLK_RIGHTPAREN
+
+=head2 SDLK_ASTERISK
+
+=head2 SDLK_PLUS
+
+=head2 SDLK_COMMA
+
+=head2 SDLK_MINUS
+
+=head2 SDLK_PERIOD
+
+=head2 SDLK_SLASH
+
+=head2 SDLK_0
+
+=head2 SDLK_1
+
+=head2 SDLK_2
+
+=head2 SDLK_3
+
+=head2 SDLK_4
+
+=head2 SDLK_5
+
+=head2 SDLK_6
+
+=head2 SDLK_7
+
+=head2 SDLK_8
+
+=head2 SDLK_9
+
+=head2 SDLK_COLON
+
+=head2 SDLK_SEMICOLON
+
+=head2 SDLK_LESS
+
+=head2 SDLK_EQUALS
+
+=head2 SDLK_GREATER
+
+=head2 SDLK_QUESTION
+
+=head2 SDLK_AT
+
+=head2 SDLK_LEFTBRACKET
+
+=head2 SDLK_BACKSLASH
+
+=head2 SDLK_RIGHTBRACKET
+
+=head2 SDLK_CARET
+
+=head2 SDLK_UNDERSCORE
+
+=head2 SDLK_BACKQUOTE
+
+=head2 SDLK_a
+
+=head2 SDLK_b
+
+=head2 SDLK_c
+
+=head2 SDLK_d
+
+=head2 SDLK_e
+
+=head2 SDLK_f
+
+=head2 SDLK_g
+
+=head2 SDLK_h
+
+=head2 SDLK_i
+
+=head2 SDLK_j
+
+=head2 SDLK_k
+
+=head2 SDLK_l
+
+=head2 SDLK_m
+
+=head2 SDLK_n
+
+=head2 SDLK_o
+
+=head2 SDLK_p
+
+=head2 SDLK_q
+
+=head2 SDLK_r
+
+=head2 SDLK_s
+
+=head2 SDLK_t
+
+=head2 SDLK_u
+
+=head2 SDLK_v
+
+=head2 SDLK_w
+
+=head2 SDLK_x
+
+=head2 SDLK_y
+
+=head2 SDLK_z
+
+=head2 SDLK_DELETE
+
+=head2 SDLK_KP0
+
+=head2 SDLK_KP1
+
+=head2 SDLK_KP2
+
+=head2 SDLK_KP3
+
+=head2 SDLK_KP4
+
+=head2 SDLK_KP5
+
+=head2 SDLK_KP6
+
+=head2 SDLK_KP7
+
+=head2 SDLK_KP8
+
+=head2 SDLK_KP9
+
+=head2 SDLK_KP_PERIOD
+
+=head2 SDLK_KP_DIVIDE
+
+=head2 SDLK_KP_MULTIPLY
+
+=head2 SDLK_KP_MINUS
+
+=head2 SDLK_KP_PLUS
+
+=head2 SDLK_KP_ENTER
+
+=head2 SDLK_KP_EQUALS
+
+=head2 SDLK_UP
+
+=head2 SDLK_DOWN
+
+=head2 SDLK_RIGHT
+
+=head2 SDLK_LEFT
+
+=head2 SDLK_INSERT
+
+=head2 SDLK_HOME
+
+=head2 SDLK_END
+
+=head2 SDLK_PAGEUP
+
+=head2 SDLK_PAGEDOWN
+
+=head2 SDLK_F1
+
+=head2 SDLK_F2
+
+=head2 SDLK_F3
+
+=head2 SDLK_F4
+
+=head2 SDLK_F5
+
+=head2 SDLK_F6
+
+=head2 SDLK_F7
+
+=head2 SDLK_F8
+
+=head2 SDLK_F9
+
+=head2 SDLK_F10
+
+=head2 SDLK_F11
+
+=head2 SDLK_F12
+
+=head2 SDLK_F13
+
+=head2 SDLK_F14
+
+=head2 SDLK_F15
+
+=head2 SDLK_NUMLOCK
+
+=head2 SDLK_CAPSLOCK
+
+=head2 SDLK_SCROLLOCK
+
+=head2 SDLK_RSHIFT
+
+=head2 SDLK_LSHIFT
+
+=head2 SDLK_RCTRL
+
+=head2 SDLK_LCTRL
+
+=head2 SDLK_RALT
+
+=head2 SDLK_LALT
+
+=head2 SDLK_RMETA
+
+=head2 SDLK_LMETA
+
+=head2 SDLK_LSUPER
+
+=head2 SDLK_RSUPER
+
+=head2 SDLK_MODE
+
+=head2 SDLK_HELP
+
+=head2 SDLK_PRINT
+
+=head2 SDLK_SYSREQ
+
+=head2 SDLK_BREAK
+
+=head2 SDLK_MENU
+
+=head2 SDLK_POWER
+
+=head2 SDLK_EURO
+
+=head2 KMOD_NONE
+
+=head2 KMOD_NUM
+
+=head2 KMOD_CAPS
+
+=head2 KMOD_LCTRL
+
+=head2 KMOD_RCTRL
+
+=head2 KMOD_RSHIFT
+
+=head2 KMOD_LSHIFT
+
+=head2 KMOD_RALT
+
+=head2 KMOD_LALT
+
+=head2 KMOD_CTRL
+
+=head2 KMOD_SHIFT
+
+=head2 KMOD_ALT
+
+=head2 KeyEventSym
+
+=head2 KeyEventMod
+
+=head2 KeyEventUnicode
+
+=head2 KeyEventScanCode
+
+=head2 MouseMotionState
+
+=head2 MouseMotionX
+
+=head2 MouseMotionY
+
+=head2 MouseMotionXrel
+
+=head2 MouseMotionYrel
+
+=head2 MouseButtonState
+
+=head2 MouseButton
+
+=head2 MouseButtonX
+
+=head2 MouseButtonY
+
+=head2 SysWMEventMsg
+
+=head2 EnableUnicode
+
+=head2 EnableKeyRepeat
+
+=head2 GetKeyName
+
+=head2 PRESSED
+
+=head2 RELEASED
+
+=head2 CreateRGBSurface
+
+=head2 CreateRGBSurfaceFrom
+
+=head2 IMG_Load
+
+=head2 FreeSurface
+
+=head2 SurfacePalette
+
+=head2 SurfaceBitsPerPixel
+
+=head2 SurfaceBytesPerPixel
+
+=head2 SurfaceRshift
+
+=head2 SurfaceGshift
+
+=head2 SurfaceBshift
+
+=head2 SurfaceAshift
+
+=head2 SurfaceRmask
+
+=head2 SurfaceGmask
+
+=head2 SurfaceBmask
+
+=head2 SurfaceAmask
+
+=head2 SurfaceColorKey
+
+=head2 SurfaceAlpha
+
+=head2 SurfaceW
+
+=head2 SurfaceH
+
+=head2 SurfacePitch
+
+=head2 SurfacePixels
+
+=head2 SurfacePixel
+
+=head2 MUSTLOCK
+
+=head2 SurfaceLock
+
+=head2 SurfaceUnlock
+
+=head2 GetVideoSurface
+
+=head2 VideoInfo
+
+=head2 NewRect
+
+=head2 FreeRect
+
+=head2 RectX
+
+=head2 RectY
+
+=head2 RectW
+
+=head2 RectH
+
+=head2 NewColor
+
+=head2 ColorR
+
+=head2 ColorG
+
+=head2 CologB
+
+=head2 FreeColor
+
+=head2 NewPalette
+
+=head2 PaletteNColors
+
+=head2 PaletteColors
+
+=head2 SWSURFACE
+
+=head2 HWSURFACE
+
+=head2 ANYFORMAT
+
+=head2 HWPALETTE
+
+=head2 DOUBLEBUF
+
+=head2 FULLSCREEN
+
+=head2 ASYNCBLIT
+
+=head2 OPENGL
+
+=head2 HWACCEL
+
+=head2 VideoModeOK
+
+=head2 SetVideoMode
+
+=head2 UpdateRects
+
+=head2 Flip
+
+=head2 SetColors
+
+=head2 MapRGB (surface,r,g,b)
+
+C<SDL::MapRGB> translates the composite red (r), green (g), blue (b)
+colors according to the given surface to a interger color value. This
+integer can be used in functions like C<SDL::FillRect>, and is not
+the same as the format independent Color object returned by C<SDL::NewColor>.
+
+=head2 MapRGBA (surface,r,g,b,a)
+
+C<SDL::MapRGBA> works as C<SDL::MapRGB> but takes an additional alpha (a)
+component for semi-transperant colors.
+
+=head2 GetRGB
+
+=head2 GetRGBA
+
+=head2 SaveBMP
+
+=head2 SetColorKey
+
+=head2 SRCCOLORKEY
+
+=head2 RLEACCEL
+
+=head2 SRCALPHA
+
+=head2 SetAlpha
+
+=head2 DisplayFormat
+
+=head2 BlitSurface
+
+=head2 FillRect(surface,rect,color)
+
+C<SDL::FillRect> draws a solid rectangle of color on the given surface.
+If the rectangle is NULL, the entire surface will be painted.
+
+=head2 WMSetCaption
+
+=head2 WMGetCaption
+
+=head2 WMSetIcon
+
+=head2 WarpMouse
+
+=head2 NewCursor
+
+=head2 FreeCursor
+
+=head2 SetCursor
+
+=head2 GetCursor
+
+=head2 ShowCursor
+
+=head2 NewAudioSpec
+
+=head2 FreeAudioSpec
+
+=head2 AUDIO_U8
+
+=head2 AUDIO_S8
+
+=head2 AUDIO_U16
+
+=head2 AUDIO_S16
+
+=head2 AUDIO_U16MSB
+
+=head2 AUDIO_S16MSB
+
+=head2 NewAudioCVT
+
+=head2 FreeAudioCVT
+
+=head2 ConvertAudioData
+
+=head2 OpenAudio
+
+=head2 PauseAudio
+
+=head2 UnlockAudio
+
+=head2 CloseAudio
+
+=head2 FreeWAV
+
+=head2 LoadWAV
+
+=head2 MixAudio
+
+=head2 MIX_MAX_VOLUME
+
+=head2 MIX_DEFAULT_FREQUENCY
+
+=head2 MIX_DEFAULT_FORMAT
+
+=head2 MIX_DEFAULT_CHANNELS
+
+=head2 MIX_NO_FADING
+
+=head2 MIX_FADING_OUT
+
+=head2 MIX_FADING_IN
+
+=head2 MixOpenAudio
+
+=head2 MixAllocateChannels
+
+=head2 MixQuerySpec
+
+=head2 MixLoadWAV
+
+=head2 MixLoadMusic
+
+=head2 MixQuickLoadWAV
+
+=head2 MixFreeChunk
+
+=head2 MixFreeMusic
+
+=head2 MixSetPostMixCallback
+
+=head2 MixSetMusicHook
+
+=head2 MixSetMusicFinishedHook
+
+=head2 MixGetMusicHookData
+
+=head2 MixReverseChannels
+
+=head2 MixGroupChannel
+
+=head2 MixGroupChannels
+
+=head2 MixGroupAvailable
+
+=head2 MixGroupCount
+
+=head2 MixGroupOldest
+
+=head2 MixGroupNewer
+
+=head2 MixPlayChannel
+
+=head2 MixPlayChannelTimed
+
+=head2 MixPlayMusic
+
+=head2 MixFadeInChannel
+
+=head2 MixFadeInChannelTimed
+
+=head2 MixFadeInMusic
+
+=head2 MixVolume
+
+=head2 MixVolumeChunk
+
+=head2 MixVolumeMusic
+
+=head2 MixHaltChannel
+
+=head2 MixHaltGroup
+
+=head2 MixHaltMusic
+
+=head2 MixExpireChannel
+
+=head2 MixFadeOutChannel
+
+=head2 MixFadeOutGroup
+
+=head2 MixFadeOutMusic
+
+=head2 MixFadingMusic
+
+=head2 MixFadingChannel
+
+=head2 MixPause
+
+=head2 MixResume
+
+=head2 MixPaused
+
+=head2 MixPauseMusic
+
+=head2 MixResumeMusic
+
+=head2 MixRewindMusic
+
+=head2 MixPausedMusic
+
+=head2 MixPlaying
+
+=head2 MixPlayingMusic
+
+=head2 MixCloseAudio
+
+=head2 NewFont
+
+=head2 UseFont
+
+=head2 PutString
+
+=head2 TextWidth
+
+=head2 GL_RED_SIZE
+
+=head2 GL_GREEN_SIZE
+
+=head2 GL_BLUE_SIZE
+
+=head2 GL_ALPHA_SIZE
+
+=head2 GL_ACCUM_RED_SIZE
+
+=head2 GL_ACCUM_GREEN_SIZE
+
+=head2 GL_ACCUM_BLUE_SIZE
+
+=head2 GL_ACCUM_ALPHA_SIZE
+
+=head2 GL_BUFFER_SIZE
+
+=head2 GL_DEPTH_SIZE
+
+=head2 GL_STENCIL_SIZE
+
+=head2 GL_DOUBLEBUFFER
+
+=head2 GL_SetAttribute
+
+=head2 GL_GetAttribute
+
+=head2 GL_SwapBuffers
+
+=head2 BigEndian
+
+=head2 NumJoysticks
+
+=head2 JoystickName
+
+=head2 JoystickOpen
+
+=head2 JoystickOpened
+
+=head2 JoystickIndex
+
+=head2 JoystickNumAxes
+
+=head2 JoystickNumBalls
+
+=head2 JoystickNumHats
+
+=head2 JoystickNumButtons
+
+=head2 JoystickUpdate
+
+=head2 JoystickGetAxis
+
+=head2 JoystickGetHat
+
+=head2 JoystickGetButton
+
+=head2 JoystickGetBall
+
+=head2 JoystickClose
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 CONTRIBUTORS
+
+David J. Goehrig, Wayne Keenan, Guillaume Cottenceau
+
+=head1 SEE ALSO
+
+ perl(1) SDL::App(3) SDL::Surface(3) SDL::Event(3) SDL::Rect(3)
+ SDL::Palette(3) SDL::Mixer(3) SDL::Cdrom(3)
+
+=cut
+
--- /dev/null
+# App.pm
+#
+# The application object, sort of like a surface
+#
+# Copyright (C) 2000,2002,2003,2004 David J. Goehrig
+
+package SDL::App;
+
+use strict;
+use SDL;
+use SDL::Event;
+use SDL::Surface;
+use SDL::Rect;
+
+our @ISA = qw(SDL::Surface);
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my %options = @_;
+
+ verify (%options, qw/ -opengl -gl -fullscreen -full -resizeable
+ -title -t -icon_title -it -icon -i
+ -width -w -height -h -depth -d -flags -f
+ -red_size -r -blue_size -b -green_size -g -alpha_size -a
+ -red_accum_size -ras -blue_accum_size -bas
+ -green_accum_sizee -gas -alpha_accum_size -aas
+ -double_buffer -db -buffer_size -bs -stencil_size -st
+ -asyncblit
+ / ) if ($SDL::DEBUG);
+
+ SDL::Init(SDL_INIT_EVERYTHING());
+
+ my $t = $options{-title} || $options{-t} || $0;
+ my $it = $options{-icon_title} || $options{-it} || $t;
+ my $ic = $options{-icon} || $options{-i} || "";
+ my $w = $options{-width} || $options{-w} || 800;
+ my $h = $options{-height} || $options{-h} || 600;
+ my $d = $options{-depth} || $options{-d} || 16;
+ my $f = $options{-flags} || $options{-f} || SDL::SDL_ANYFORMAT();
+ my $r = $options{-red_size} || $options{-r} || 5;
+ my $g = $options{-green_size} || $options{-g} || 5;
+ my $b = $options{-blue_size} || $options{-b} || 5;
+ my $a = $options{-alpha_size} || $options{-a} || 0;
+ my $ras = $options{-red_accum_size} || $options{-ras} || 0;
+ my $gas = $options{-green_accum_size} || $options{-gas} || 0;
+ my $bas = $options{-blue_accum_size} || $options{-bas} || 0;
+ my $aas = $options{-alpha_accum_size} || $options{-aas} || 0;
+ my $db = $options{-double_buffer} || $options{-db} || 0;
+
+ my $bs = $options{-buffer_size} || $options{-bs} || 0;
+ my $st = $options{-stencil_size} || $options{-st} || 0;
+ my $async = $options{-asyncblit} || 0;
+
+ $f |= SDL::SDL_OPENGL() if ($options{-gl} || $options{-opengl});
+ $f |= SDL::SDL_FULLSCREEN() if ($options{-fullscreen} || $options{-full});
+ $f |= SDL::SDL_RESIZABLE() if ($options{-resizeable});
+ $f |= SDL::SDL_DOUBLEBUF() if ($db);
+ $f |= SDL::SDL_ASYNCBLIT() if ($async);
+
+ if ($f & SDL_OPENGL()) {
+ $SDL::App::USING_OPENGL = 1;
+ SDL::GLSetAttribute(SDL_GL_RED_SIZE(),$r) if ($r);
+ SDL::GLSetAttribute(SDL_GL_GREEN_SIZE(),$g) if ($g);
+ SDL::GLSetAttribute(SDL_GL_BLUE_SIZE(),$b) if ($b);
+ SDL::GLSetAttribute(SDL_GL_ALPHA_SIZE(),$a) if ($a);
+
+ SDL::GLSetAttribute(SDL_GL_RED_ACCUM_SIZE(),$ras) if ($ras);
+ SDL::GLSetAttribute(SDL_GL_GREEN_ACCUM_SIZE(),$gas) if ($gas);
+ SDL::GLSetAttribute(SDL_GL_BLUE_ACCUM_SIZE(),$bas) if ($bas);
+ SDL::GLSetAttribute(SDL_GL_ALPHA_ACCUM_SIZE(),$aas) if ($aas);
+
+ SDL::GLSetAttribute(SDL_GL_DOUBLEBUFFER(),$db) if ($db);
+ SDL::GLSetAttribute(SDL_GL_BUFFER_SIZE(),$bs) if ($bs);
+ SDL::GLSetAttribute(SDL_GL_DEPTH_SIZE(),$d);
+ } else {
+ $SDL::App::USING_OPENGL = 0;
+ }
+
+ my $self = \SDL::SetVideoMode($w,$h,$d,$f)
+ or die SDL::GetError();
+
+ if ($ic and -e $ic) {
+ my $icon = new SDL::Surface -name => $ic;
+ SDL::WMSetIcon($$icon);
+ }
+
+ SDL::WMSetCaption($t,$it);
+
+ bless $self,$class;
+ return $self;
+}
+
+sub resize ($$$) {
+ my ($self,$w,$h) = @_;
+ my $flags = SDL::SurfaceFlags($$self);
+ if ( $flags & SDL::SDL_RESIZABLE()) {
+ my $bpp = SDL::SurfaceBitsPerPixel($$self);
+ $self = \SDL::SetVideoMode($w,$h,$bpp,$flags);
+ }
+}
+
+sub title ($;$) {
+ my $self = shift;
+ my ($title,$icon);
+ if (@_) {
+ $title = shift;
+ $icon = shift || $title;
+ SDL::WMSetCaption($title,$icon);
+ }
+ return SDL::WMGetCaption();
+}
+
+sub delay ($$) {
+ my $self = shift;
+ my $delay = shift;
+ SDL::Delay($delay);
+}
+
+sub ticks {
+ return SDL::GetTicks();
+}
+
+sub error {
+ return SDL::GetError();
+}
+
+sub warp ($$$) {
+ my $self = shift;
+ SDL::WarpMouse(@_);
+}
+
+sub fullscreen ($) {
+ my $self = shift;
+ SDL::WMToggleFullScreen($$self);
+}
+
+sub iconify ($) {
+ my $self = shift;
+ SDL::WMIconifyWindow();
+}
+
+sub grab_input ($$) {
+ my ($self,$mode) = @_;
+ SDL::WMGrabInput($mode);
+}
+
+sub loop ($$) {
+ my ($self,$href) = @_;
+ my $event = new SDL::Event;
+ while ( $event->wait() ) {
+ if ( ref($$href{$event->type()}) eq "CODE" ) {
+ &{$$href{$event->type()}}($event);
+ $self->sync();
+ }
+ }
+}
+
+sub sync ($) {
+ my $self = shift;
+ if ($SDL::App::USING_OPENGL) {
+ SDL::GLSwapBuffers()
+ } else {
+ $self->flip();
+ }
+}
+
+sub attribute ($$;$) {
+ my ($self,$mode,$value) = @_;
+ return undef unless ($SDL::App::USING_OPENGL);
+ if (defined $value) {
+ SDL::GLSetAttribute($mode,$value);
+ }
+ my $returns = SDL::GLGetAttribute($mode);
+ die "SDL::App::attribute failed to get GL attribute" if ($$returns[0] < 0);
+ $$returns[1];
+}
+
+1;
+
+__END__;
+
+=pod
+
+=head1 NAME
+
+SDL::App - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ my $app = new SDL::App (
+ -title => 'Application Title',
+ -width => 640,
+ -height => 480,
+ -depth => 32 );
+
+=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 dies on failure.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Surface> L<SDL::Event> L<SDL::OpenGL>
+
+=cut
--- /dev/null
+# Cdrom.pm
+#
+# a SDL cdrom manipluation module
+#
+# Copyright (C) 2000,2002 David J. Goehrig
+#
+
+package SDL::Cdrom;
+use strict;
+
+BEGIN {
+ use Exporter();
+ use vars qw(@ISA @EXPORT);
+ @ISA = qw(Exporter);
+ @EXPORT = qw/ &CD_NUM_DRIVES /;
+}
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self;
+ my $number = shift;
+ $self = \SDL::CDOpen($number);
+ die SDL::GetError() if ( SDL::CD_ERROR() eq SDL::CDStatus($$self));
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ SDL::CDClose($$self);
+}
+
+sub CD_NUM_DRIVES {
+ return SDL::CDNumDrives();
+}
+
+sub name ($) {
+ my $self = shift;
+ return SDL::CDName($$self);
+}
+
+sub status ($) {
+ my $self = shift;
+ return SDL::CDstatus($$self);
+}
+
+sub play ($$$;$$) {
+ my ($self,$start,$length,$fs,$fl) = @_;
+ return SDL::CDPlayTracks($$self,$start,$length,$fs,$fl);
+}
+
+sub pause ($) {
+ my $self = shift;
+ return SDL::CDPause($$self);
+}
+
+sub resume ($) {
+ my $self = shift;
+ return SDL::CDResume($$self);
+}
+
+sub stop ($) {
+ my $self = shift;
+ return SDL::CDStop($$self);
+}
+
+sub eject ($) {
+ my $self = shift;
+ return SDL::CDEject($$self);
+}
+
+sub id ($) {
+ my $self = shift;
+ return SDL::CDId($$self);
+}
+
+sub num_tracks ($) {
+ my $self = shift;
+ return SDL::CDNumTracks($$self);
+}
+
+my $buildtrack = sub {
+ my $ptr = shift;
+ my %track = ();
+ $track{-id} = SDL::CDTrackId($ptr);
+ $track{-type} = SDL::CDTrackType($ptr);
+ $track{-length} = SDL::CDTrackLength($ptr);
+ $track{-offset} = SDL::CDTrackOffset($ptr);
+ return \%track;
+};
+
+sub track {
+ my $self = shift;
+ my $number = shift;
+ return &$buildtrack(SDL::CDTrack($$self,$number));
+}
+
+sub current {
+ my $self = shift;
+ return $self->track(SDL::CDCurTrack($$self));
+}
+
+sub current_frame {
+ my $self = shift;
+ return SDL::CDCurFrame($$self);
+}
+
+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
--- /dev/null
+# Color.pm
+#
+# A package for manipulating SDL_Color *
+#
+# Copyright (C) 2002,2003,2004 David J. Goehrig
+
+package SDL::Color;
+
+use strict;
+use SDL;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self;
+
+ my (%options) = @_;
+
+ verify (%options, qw/ -color -surface -pixel -r -g -b /) if $SDL::DEBUG;
+
+ if ($options{-color}) {
+ $self = \$options{-color};
+ } elsif ($options{-pixel} && $options{-surface}) {
+ die "SDL::Color::new requires an SDL::Surface"
+ unless !$SDL::DEBUG || $options{-surface}->isa("SDL::Surface");
+ $self = \SDL::NewColor(SDL::GetRGB(${$options{-surface}}, $options{-pixel}));
+ } else {
+ my @color;
+ push @color, $options{-red} || $options{-r} || 0;
+ push @color, $options{-green} || $options{-g} || 0;
+ push @color, $options{-blue} || $options{-b} || 0;
+ $self = \SDL::NewColor(@color);
+ }
+ die "Could not create color, ", SDL::GetError(), "\n"
+ unless ($$self);
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ SDL::FreeColor(${$_[0]});
+}
+
+sub r {
+ my $self = shift;
+ SDL::ColorR($$self,@_);
+}
+
+sub g {
+ my $self = shift;
+ SDL::ColorG($$self,@_);
+}
+
+sub b {
+ my $self = shift;
+ SDL::ColorB($$self,@_);
+}
+
+sub pixel {
+ die "SDL::Color::pixel requires an SDL::Surface"
+ unless !$SDL::DEBUG || $_[1]->isa("SDL::Surface");
+ SDL::MapRGB(${$_[1]},$_[0]->r(),$_[0]->g(),$_[0]->b());
+}
+
+$SDL::Color::black = new SDL::Color -r => 0, -g => 0, -b => 0;
+$SDL::Color::white = new SDL::Color -r => 255, -g => 255, -b => 255;
+$SDL::Color::red = new SDL::Color -r => 255, -g => 0, -b => 0;
+$SDL::Color::blue = new SDL::Color -r => 0, -g => 0, -b => 255;
+$SDL::Color::green = new SDL::Color -r => 0, -g => 255, -b => 0;
+$SDL::Color::purple = new SDL::Color -r => 255, -g => 0, -b => 255;
+$SDL::Color::yellow = new SDL::Color -r => 255, -g => 255, -b => 0;
+
+1;
+
+__END__;
+
+=pod
+
+=head1 NAME
+
+SDL::Color - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $color = new SDL::Color ( -r => 0xde, -g => 0xad, -b =>c0 );
+ $color = new SDL::Color -surface => $app, -pixel => $app->pixel($x,$y);
+ $color = new SDL::Color -color => SDL::NewColor(0xff,0xaa,0xdd);
+
+=head1 DESCRIPTION
+
+C<SDL::Color> is a wrapper for display format independent color
+representations, with the same interface as L<SDL::Color>.
+
+=head2 new ( -color => )
+
+C<SDL::Color::new> with a C<-color> option will construct a new object
+referencing the passed SDL_Color*.
+
+=head2 new (-r => , -g => , -b => )
+
+C<SDL::Color::new> with C<-r,-g,-b> options will construct both a SDL_Color
+structure, and the associated object with the specified vales.
+
+=head2 new (-pixel =>, -surface =>)
+
+C<SDL::Color::new> with C<-pixel,-surface> options will generate a SDL_Color*
+with the r,g,b values associated with the integer value passed by C<-pixel>
+for the given C<-surface>'s format.
+
+=head2 r ( [ red ] ), g( [ green ] ), b( [ blue ] )
+
+C<SDL::Color::r, SDL::Color::g, SDL::Color::b> are accessor methods for
+the red, green, and blue components respectively. The color value can be set
+by passing a byte value (0-255) to each function.
+
+=head2 pixel ( surface )
+
+C<SDL::Color::pixel> takes a C<SDL::Surface> object and r,g,b values, and
+returns the integer representation of the closest color for the given surface.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Surface>
+
+=cut
--- /dev/null
+# SDL::Constants
+#
+# This is an automatically generated file, don't bother editing
+#
+# Copyright (C) 2003,2004 David J. Goehrig <dgoehrig@cpan.org>
+#
+
+package SDL::Constants;
+
+require Exporter;
+
+BEGIN {
+#supposedly this crap isn't thread safe
+#SelfLoader screws up and we can't be certain to read all DATA
+#if this isn't loaded prior to creating new threads.
+
+ if (! $threads::threads) {
+
+ use SelfLoader;
+ #$SelfLoader::DEBUG=1;
+ }
+};
+
+use vars qw(
+ @EXPORT
+ @ISA
+);
+
+@ISA=qw(Exporter);
+@EXPORT=qw(
+ AUDIO_S16
+ AUDIO_S16MSB
+ AUDIO_S8
+ AUDIO_U16
+ AUDIO_U16MSB
+ AUDIO_U8
+ CD_ERROR
+ CD_PAUSED
+ CD_PLAYING
+ CD_STOPPED
+ CD_TRAYEMPTY
+ INADDR_ANY
+ INADDR_NONE
+ KMOD_ALT
+ KMOD_CAPS
+ KMOD_CTRL
+ KMOD_LALT
+ KMOD_LCTRL
+ KMOD_LSHIFT
+ KMOD_NONE
+ KMOD_NUM
+ KMOD_RALT
+ KMOD_RCTRL
+ KMOD_RSHIFT
+ KMOD_SHIFT
+ MIX_DEFAULT_CHANNELS
+ MIX_DEFAULT_FORMAT
+ MIX_DEFAULT_FREQUENCY
+ MIX_FADING_IN
+ MIX_FADING_OUT
+ MIX_MAX_VOLUME
+ MIX_NO_FADING
+ SDLK_0
+ SDLK_1
+ SDLK_2
+ SDLK_3
+ SDLK_4
+ SDLK_5
+ SDLK_6
+ SDLK_7
+ SDLK_8
+ SDLK_9
+ SDLK_AMPERSAND
+ SDLK_ASTERISK
+ SDLK_AT
+ SDLK_BACKQUOTE
+ SDLK_BACKSLASH
+ SDLK_BACKSPACE
+ SDLK_BREAK
+ SDLK_CAPSLOCK
+ SDLK_CARET
+ SDLK_CLEAR
+ SDLK_COLON
+ SDLK_COMMA
+ SDLK_DELETE
+ SDLK_DOLLAR
+ SDLK_DOWN
+ SDLK_END
+ SDLK_EQUALS
+ SDLK_ESCAPE
+ SDLK_EURO
+ SDLK_EXCLAIM
+ SDLK_F1
+ SDLK_F10
+ SDLK_F11
+ SDLK_F12
+ SDLK_F13
+ SDLK_F14
+ SDLK_F15
+ SDLK_F2
+ SDLK_F3
+ SDLK_F4
+ SDLK_F5
+ SDLK_F6
+ SDLK_F7
+ SDLK_F8
+ SDLK_F9
+ SDLK_GREATER
+ SDLK_HASH
+ SDLK_HELP
+ SDLK_HOME
+ SDLK_INSERT
+ SDLK_KP0
+ SDLK_KP1
+ SDLK_KP2
+ SDLK_KP3
+ SDLK_KP4
+ SDLK_KP5
+ SDLK_KP6
+ SDLK_KP7
+ SDLK_KP8
+ SDLK_KP9
+ SDLK_KP_DIVIDE
+ SDLK_KP_ENTER
+ SDLK_KP_EQUALS
+ SDLK_KP_MINUS
+ SDLK_KP_MULTIPLY
+ SDLK_KP_PERIOD
+ SDLK_KP_PLUS
+ SDLK_LALT
+ SDLK_LCTRL
+ SDLK_LEFT
+ SDLK_LEFTBRACKET
+ SDLK_LEFTPAREN
+ SDLK_LESS
+ SDLK_LMETA
+ SDLK_LSHIFT
+ SDLK_LSUPER
+ SDLK_MENU
+ SDLK_MINUS
+ SDLK_MODE
+ SDLK_NUMLOCK
+ SDLK_PAGEDOWN
+ SDLK_PAGEUP
+ SDLK_PAUSE
+ SDLK_PERIOD
+ SDLK_PLUS
+ SDLK_POWER
+ SDLK_PRINT
+ SDLK_QUESTION
+ SDLK_QUOTE
+ SDLK_QUOTEDBL
+ SDLK_RALT
+ SDLK_RCTRL
+ SDLK_RETURN
+ SDLK_RIGHT
+ SDLK_RIGHTBRACKET
+ SDLK_RIGHTPAREN
+ SDLK_RMETA
+ SDLK_RSHIFT
+ SDLK_RSUPER
+ SDLK_SCROLLOCK
+ SDLK_SEMICOLON
+ SDLK_SLASH
+ SDLK_SPACE
+ SDLK_SYSREQ
+ SDLK_TAB
+ SDLK_UNDERSCORE
+ SDLK_UP
+ SDLK_a
+ SDLK_b
+ SDLK_c
+ SDLK_d
+ SDLK_e
+ SDLK_f
+ SDLK_g
+ SDLK_h
+ SDLK_i
+ SDLK_j
+ SDLK_k
+ SDLK_l
+ SDLK_m
+ SDLK_n
+ SDLK_o
+ SDLK_p
+ SDLK_q
+ SDLK_r
+ SDLK_s
+ SDLK_t
+ SDLK_u
+ SDLK_v
+ SDLK_w
+ SDLK_x
+ SDLK_y
+ SDLK_z
+ SDL_ACTIVEEVENT
+ SDL_ANYFORMAT
+ SDL_APPACTIVE
+ SDL_APPINPUTFOCUS
+ SDL_APPMOUSEFOCUS
+ SDL_ASYNCBLIT
+ SDL_AUDIO_PAUSED
+ SDL_AUDIO_PLAYING
+ SDL_AUDIO_STOPPED
+ SDL_BUTTON_LEFT
+ SDL_BUTTON_MIDDLE
+ SDL_BUTTON_RIGHT
+ SDL_BUTTON_WHEELUP
+ SDL_BUTTON_WHEELDOWN
+ SDL_DOUBLEBUF
+ SDL_ENABLE
+ SDL_FULLSCREEN
+ SDL_GL_ACCUM_ALPHA_SIZE
+ SDL_GL_ACCUM_BLUE_SIZE
+ SDL_GL_ACCUM_GREEN_SIZE
+ SDL_GL_ACCUM_RED_SIZE
+ SDL_GL_ALPHA_SIZE
+ SDL_GL_BLUE_SIZE
+ SDL_GL_BUFFER_SIZE
+ SDL_GL_DEPTH_SIZE
+ SDL_GL_DOUBLEBUFFER
+ SDL_GL_GREEN_SIZE
+ SDL_GL_RED_SIZE
+ SDL_GL_STENCIL_SIZE
+ SDL_GRAB_OFF
+ SDL_GRAB_ON
+ SDL_GRAB_QUERY
+ SDL_HAT_CENTERED
+ SDL_HAT_DOWN
+ SDL_HAT_LEFT
+ SDL_HAT_LEFTDOWN
+ SDL_HAT_LEFTUP
+ SDL_HAT_RIGHT
+ SDL_HAT_RIGHTDOWN
+ SDL_HAT_RIGHTUP
+ SDL_HAT_UP
+ SDL_HWACCEL
+ SDL_HWPALETTE
+ SDL_HWSURFACE
+ SDL_IGNORE
+ SDL_INIT_AUDIO
+ SDL_INIT_CDROM
+ SDL_INIT_EVERYTHING
+ SDL_INIT_JOYSTICK
+ SDL_INIT_NOPARACHUTE
+ SDL_INIT_TIMER
+ SDL_INIT_VIDEO
+ SDL_IYUV_OVERLAY
+ SDL_JOYAXISMOTION
+ SDL_JOYBALLMOTION
+ SDL_JOYBUTTONDOWN
+ SDL_JOYBUTTONUP
+ SDL_JOYHATMOTION
+ SDL_KEYDOWN
+ SDL_KEYUP
+ SDL_MIX_MAXVOLUME
+ SDL_MOUSEBUTTONDOWN
+ SDL_MOUSEBUTTONUP
+ SDL_MOUSEMOTION
+ SDL_OPENGL
+ SDL_OPENGLBLIT
+ SDL_PREALLOC
+ SDL_PRESSED
+ SDL_QUERY
+ SDL_QUIT
+ SDL_RELEASED
+ SDL_RESIZABLE
+ SDL_RLEACCEL
+ SDL_RLEACCELOK
+ SDL_SRCALPHA
+ SDL_SRCCOLORKEY
+ SDL_SWSURFACE
+ SDL_SYSWMEVENT
+ SDL_UYVY_OVERLAY
+ SDL_VIDEOEXPOSE
+ SDL_VIDEORESIZE
+ SDL_YUY2_OVERLAY
+ SDL_YV12_OVERLAY
+ SDL_YVYU_OVERLAY
+ SMPEG_ERROR
+ SMPEG_PLAYING
+ SMPEG_STOPPED
+ TEXT_BLENDED
+ TEXT_SHADED
+ TEXT_SOLID
+ TTF_STYLE_BOLD
+ TTF_STYLE_ITALIC
+ TTF_STYLE_NORMAL
+ TTF_STYLE_UNDERLINE
+ UNICODE_BLENDED
+ UNICODE_SHADED
+ UNICODE_SOLID
+ UTF8_BLENDED
+ UTF8_SHADED
+ UTF8_SOLID
+);
+
+
+__DATA__
+sub AUDIO_S16 {32784}
+sub AUDIO_S16MSB {36880}
+sub AUDIO_S8 {32776}
+sub AUDIO_U16 {16}
+sub AUDIO_U16MSB {4112}
+sub AUDIO_U8 {8}
+sub CD_ERROR {-1}
+sub CD_PAUSED {3}
+sub CD_PLAYING {2}
+sub CD_STOPPED {1}
+sub CD_TRAYEMPTY {0}
+sub INADDR_ANY {0}
+sub INADDR_NONE {-1}
+sub KMOD_ALT {768}
+sub KMOD_CAPS {8192}
+sub KMOD_CTRL {192}
+sub KMOD_LALT {256}
+sub KMOD_LCTRL {64}
+sub KMOD_LSHIFT {1}
+sub KMOD_NONE {0}
+sub KMOD_NUM {4096}
+sub KMOD_RALT {512}
+sub KMOD_RCTRL {128}
+sub KMOD_RSHIFT {2}
+sub KMOD_SHIFT {3}
+sub MIX_DEFAULT_CHANNELS {2}
+sub MIX_DEFAULT_FORMAT {32784}
+sub MIX_DEFAULT_FREQUENCY {22050}
+sub MIX_FADING_IN {2}
+sub MIX_FADING_OUT {1}
+sub MIX_MAX_VOLUME {128}
+sub MIX_NO_FADING {0}
+sub SDLK_0 {48}
+sub SDLK_1 {49}
+sub SDLK_2 {50}
+sub SDLK_3 {51}
+sub SDLK_4 {52}
+sub SDLK_5 {53}
+sub SDLK_6 {54}
+sub SDLK_7 {55}
+sub SDLK_8 {56}
+sub SDLK_9 {57}
+sub SDLK_AMPERSAND {38}
+sub SDLK_ASTERISK {42}
+sub SDLK_AT {64}
+sub SDLK_BACKQUOTE {96}
+sub SDLK_BACKSLASH {92}
+sub SDLK_BACKSPACE {8}
+sub SDLK_BREAK {318}
+sub SDLK_CAPSLOCK {301}
+sub SDLK_CARET {94}
+sub SDLK_CLEAR {12}
+sub SDLK_COLON {58}
+sub SDLK_COMMA {44}
+sub SDLK_DELETE {127}
+sub SDLK_DOLLAR {36}
+sub SDLK_DOWN {274}
+sub SDLK_END {279}
+sub SDLK_EQUALS {61}
+sub SDLK_ESCAPE {27}
+sub SDLK_EURO {321}
+sub SDLK_EXCLAIM {33}
+sub SDLK_F1 {282}
+sub SDLK_F10 {291}
+sub SDLK_F11 {292}
+sub SDLK_F12 {293}
+sub SDLK_F13 {294}
+sub SDLK_F14 {295}
+sub SDLK_F15 {296}
+sub SDLK_F2 {283}
+sub SDLK_F3 {284}
+sub SDLK_F4 {285}
+sub SDLK_F5 {286}
+sub SDLK_F6 {287}
+sub SDLK_F7 {288}
+sub SDLK_F8 {289}
+sub SDLK_F9 {290}
+sub SDLK_GREATER {62}
+sub SDLK_HASH {35}
+sub SDLK_HELP {315}
+sub SDLK_HOME {278}
+sub SDLK_INSERT {277}
+sub SDLK_KP0 {256}
+sub SDLK_KP1 {257}
+sub SDLK_KP2 {258}
+sub SDLK_KP3 {259}
+sub SDLK_KP4 {260}
+sub SDLK_KP5 {261}
+sub SDLK_KP6 {262}
+sub SDLK_KP7 {263}
+sub SDLK_KP8 {264}
+sub SDLK_KP9 {265}
+sub SDLK_KP_DIVIDE {267}
+sub SDLK_KP_ENTER {271}
+sub SDLK_KP_EQUALS {272}
+sub SDLK_KP_MINUS {269}
+sub SDLK_KP_MULTIPLY {268}
+sub SDLK_KP_PERIOD {266}
+sub SDLK_KP_PLUS {270}
+sub SDLK_LALT {308}
+sub SDLK_LCTRL {306}
+sub SDLK_LEFT {276}
+sub SDLK_LEFTBRACKET {91}
+sub SDLK_LEFTPAREN {40}
+sub SDLK_LESS {60}
+sub SDLK_LMETA {310}
+sub SDLK_LSHIFT {304}
+sub SDLK_LSUPER {311}
+sub SDLK_MENU {319}
+sub SDLK_MINUS {45}
+sub SDLK_MODE {313}
+sub SDLK_NUMLOCK {300}
+sub SDLK_PAGEDOWN {281}
+sub SDLK_PAGEUP {280}
+sub SDLK_PAUSE {19}
+sub SDLK_PERIOD {46}
+sub SDLK_PLUS {43}
+sub SDLK_POWER {320}
+sub SDLK_PRINT {316}
+sub SDLK_QUESTION {63}
+sub SDLK_QUOTE {39}
+sub SDLK_QUOTEDBL {34}
+sub SDLK_RALT {307}
+sub SDLK_RCTRL {305}
+sub SDLK_RETURN {13}
+sub SDLK_RIGHT {275}
+sub SDLK_RIGHTBRACKET {93}
+sub SDLK_RIGHTPAREN {41}
+sub SDLK_RMETA {309}
+sub SDLK_RSHIFT {303}
+sub SDLK_RSUPER {312}
+sub SDLK_SCROLLOCK {302}
+sub SDLK_SEMICOLON {59}
+sub SDLK_SLASH {47}
+sub SDLK_SPACE {32}
+sub SDLK_SYSREQ {317}
+sub SDLK_TAB {9}
+sub SDLK_UNDERSCORE {95}
+sub SDLK_UP {273}
+sub SDLK_a {97}
+sub SDLK_b {98}
+sub SDLK_c {99}
+sub SDLK_d {100}
+sub SDLK_e {101}
+sub SDLK_f {102}
+sub SDLK_g {103}
+sub SDLK_h {104}
+sub SDLK_i {105}
+sub SDLK_j {106}
+sub SDLK_k {107}
+sub SDLK_l {108}
+sub SDLK_m {109}
+sub SDLK_n {110}
+sub SDLK_o {111}
+sub SDLK_p {112}
+sub SDLK_q {113}
+sub SDLK_r {114}
+sub SDLK_s {115}
+sub SDLK_t {116}
+sub SDLK_u {117}
+sub SDLK_v {118}
+sub SDLK_w {119}
+sub SDLK_x {120}
+sub SDLK_y {121}
+sub SDLK_z {122}
+sub SDL_ACTIVEEVENT {1}
+sub SDL_ANYFORMAT {268435456}
+sub SDL_APPACTIVE {4}
+sub SDL_APPINPUTFOCUS {2}
+sub SDL_APPMOUSEFOCUS {1}
+sub SDL_ASYNCBLIT {4}
+sub SDL_AUDIO_PAUSED {2}
+sub SDL_AUDIO_PLAYING {1}
+sub SDL_AUDIO_STOPPED {0}
+sub SDL_BUTTON_LEFT {1}
+sub SDL_BUTTON_MIDDLE {2}
+sub SDL_BUTTON_RIGHT {4}
+sub SDL_BUTTON_WHEELUP {8}
+sub SDL_BUTTON_WHEELDOWN {16}
+sub SDL_DOUBLEBUF {1073741824}
+sub SDL_ENABLE {1}
+sub SDL_FULLSCREEN {-2147483648}
+sub SDL_GL_ACCUM_ALPHA_SIZE {11}
+sub SDL_GL_ACCUM_BLUE_SIZE {10}
+sub SDL_GL_ACCUM_GREEN_SIZE {9}
+sub SDL_GL_ACCUM_RED_SIZE {8}
+sub SDL_GL_ALPHA_SIZE {3}
+sub SDL_GL_BLUE_SIZE {2}
+sub SDL_GL_BUFFER_SIZE {4}
+sub SDL_GL_DEPTH_SIZE {6}
+sub SDL_GL_DOUBLEBUFFER {5}
+sub SDL_GL_GREEN_SIZE {1}
+sub SDL_GL_RED_SIZE {0}
+sub SDL_GL_STENCIL_SIZE {7}
+sub SDL_GRAB_OFF {0}
+sub SDL_GRAB_ON {1}
+sub SDL_GRAB_QUERY {-1}
+sub SDL_HAT_CENTERED {0}
+sub SDL_HAT_DOWN {4}
+sub SDL_HAT_LEFT {8}
+sub SDL_HAT_LEFTDOWN {12}
+sub SDL_HAT_LEFTUP {9}
+sub SDL_HAT_RIGHT {2}
+sub SDL_HAT_RIGHTDOWN {6}
+sub SDL_HAT_RIGHTUP {3}
+sub SDL_HAT_UP {1}
+sub SDL_HWACCEL {256}
+sub SDL_HWPALETTE {536870912}
+sub SDL_HWSURFACE {1}
+sub SDL_IGNORE {0}
+sub SDL_INIT_AUDIO {16}
+sub SDL_INIT_CDROM {256}
+sub SDL_INIT_EVERYTHING {65535}
+sub SDL_INIT_JOYSTICK {512}
+sub SDL_INIT_NOPARACHUTE {1048576}
+sub SDL_INIT_TIMER {1}
+sub SDL_INIT_VIDEO {32}
+sub SDL_IYUV_OVERLAY {1448433993}
+sub SDL_JOYAXISMOTION {7}
+sub SDL_JOYBALLMOTION {8}
+sub SDL_JOYBUTTONDOWN {10}
+sub SDL_JOYBUTTONUP {11}
+sub SDL_JOYHATMOTION {9}
+sub SDL_KEYDOWN {2}
+sub SDL_KEYUP {3}
+sub SDL_MIX_MAXVOLUME {128}
+sub SDL_MOUSEBUTTONDOWN {5}
+sub SDL_MOUSEBUTTONUP {6}
+sub SDL_MOUSEMOTION {4}
+sub SDL_OPENGL {2}
+sub SDL_OPENGLBLIT {10}
+sub SDL_PREALLOC {16777216}
+sub SDL_PRESSED {1}
+sub SDL_QUERY {-1}
+sub SDL_QUIT {12}
+sub SDL_RELEASED {0}
+sub SDL_RESIZABLE {16}
+sub SDL_RLEACCEL {16384}
+sub SDL_RLEACCELOK {8192}
+sub SDL_SRCALPHA {65536}
+sub SDL_SRCCOLORKEY {4096}
+sub SDL_SWSURFACE {0}
+sub SDL_SYSWMEVENT {13}
+sub SDL_UYVY_OVERLAY {1498831189}
+sub SDL_VIDEOEXPOSE {17}
+sub SDL_VIDEORESIZE {16}
+sub SDL_YUY2_OVERLAY {844715353}
+sub SDL_YV12_OVERLAY {842094169}
+sub SDL_YVYU_OVERLAY {1431918169}
+sub SMPEG_ERROR {-1}
+sub SMPEG_PLAYING {1}
+sub SMPEG_STOPPED {0}
+sub TEXT_BLENDED {4}
+sub TEXT_SHADED {2}
+sub TEXT_SOLID {1}
+sub TTF_STYLE_BOLD {1}
+sub TTF_STYLE_ITALIC {2}
+sub TTF_STYLE_NORMAL {0}
+sub TTF_STYLE_UNDERLINE {4}
+sub UNICODE_BLENDED {256}
+sub UNICODE_SHADED {128}
+sub UNICODE_SOLID {64}
+sub UTF8_BLENDED {32}
+sub UTF8_SHADED {16}
+sub UTF8_SOLID {8}
+
--- /dev/null
+# Cursor.pm
+#
+# Copyright (C) 2000,2002 David J. Goehrig
+#
+
+package SDL::Cursor;
+use strict;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my %options = @_;
+
+ verify (%options, qw/ -data -mask -x -y /) if $SDL::DEBUG;
+
+ my $self = \SDL::NewCursor($options{-data},$options{-mask},
+ $options{-x},$options{-y});
+ bless $self, $class;
+ $self;
+}
+
+sub DESTROY ($) {
+ my $self = shift;
+ SDL::FreeCursor($$self);
+}
+
+sub warp ($$$) {
+ my ($self,$x,$y) = @_;
+ SDL::WarpMouse($x,$y);
+}
+
+sub use ($) {
+ my $self = shift;
+ SDL::SetCursor($$self);
+}
+
+sub get () {
+ SDL::GetCursor();
+}
+
+sub show ($;$) {
+ my ($self,$toggle) = @_;
+ SDL::ShowCursor($toggle);
+}
+
+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
--- /dev/null
+# Event.pm
+#
+# A package for handling SDL_Event *
+#
+# Copyright (C) 2000,2001,2002 David J. Goehrig
+#
+# see the file COPYING for terms of use
+#
+
+package SDL::Event;
+use strict;
+use SDL;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self;
+ $self = \SDL::NewEvent();
+ bless $self, $class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ SDL::FreeEvent($$self);
+}
+
+sub type {
+ my $self = shift;
+ if (@_) {
+ SDL::SetEventType($$self,$_[0]);
+ }
+ return SDL::EventType($$self);
+}
+
+sub pump {
+ SDL::PumpEvents();
+}
+
+sub poll {
+ my $self = shift;
+ return SDL::PollEvent($$self);
+}
+
+sub push {
+ my $self = shift;
+ return SDL::PushEvent($$self);
+}
+
+sub wait {
+ my $self = shift;
+ return SDL::WaitEvent($$self);
+}
+
+sub set {
+ my $self = shift;
+ my $state = shift;
+ return SDL::EventState($self->type(),$state);
+}
+
+sub set_unicode {
+ my $self = shift;
+ my $toggle = shift;
+ return SDL::EnableUnicode($toggle);
+}
+
+sub set_key_repeat {
+ my $self = shift;
+ my $delay = shift;
+ my $interval = shift;
+ return SDL::EnableKeyRepeat($delay,$interval);
+}
+
+sub active_gain {
+ my $self = shift;
+ return SDL::ActiveEventGain($$self);
+}
+
+sub active_state {
+ my $self = shift;
+ return SDL::ActiveEventState($$self);
+}
+
+sub key_state {
+ my $self = shift;
+ return SDL::KeyEventState($$self);
+}
+
+sub key_sym {
+ my $self = shift;
+ return SDL::KeyEventSym($$self);
+}
+
+sub key_name {
+ my $self = shift;
+ return SDL::GetKeyName(SDL::KeyEventSym($$self));
+}
+
+sub key_mod {
+ my $self = shift;
+ return SDL::KeyEventMod($$self);
+}
+
+sub key_unicode {
+ my $self = shift;
+ return SDL::KeyEventUnicode($$self);
+}
+
+sub key_scancode {
+ my $self = shift;
+ return SDL::KeyEventScanCode($$self);
+}
+
+sub motion_state {
+ my $self = shift;
+ return SDL::MouseMotionState($$self);
+}
+
+sub motion_x {
+ my $self = shift;
+ return SDL::MouseMotionX($$self);
+}
+
+sub motion_y {
+ my $self = shift;
+ return SDL::MouseMotionY($$self);
+}
+
+sub motion_xrel {
+ my $self = shift;
+ return SDL::MouseMotionXrel($$self);
+}
+
+sub motion_yrel {
+ my $self = shift;
+ return SDL::MouseMotionYrel($$self);
+}
+
+sub button_state {
+ my $self = shift;
+ return SDL::MouseButtonState($$self);
+}
+
+sub button_x {
+ my $self = shift;
+ return SDL::MouseButtonX($$self);
+}
+
+sub button_y {
+ my $self = shift;
+ return SDL::MouseButtonY($$self);
+}
+
+sub button {
+ my $self = shift;
+ return SDL::MouseButton($$self);
+}
+
+sub resize_w {
+ my $self = shift;
+ SDL::ResizeEventW($$self);
+}
+
+sub resize_h {
+ my $self = shift;
+ SDL::ResizeEventH($$self);
+}
+
+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
+ 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.
+
+=head2 type()
+
+Returns the type of the event, see list of exported symbols for which are
+available.
+
+=head2 pump()
+
+=head2 poll()
+
+=head2 wait()
+
+Waits for an event end returns then. Always returns true.
+
+=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()
+
+=head2 active_state()
+
+=head2 key_state()
+
+=head2 key_sym()
+
+=head2 key_name()
+
+=head2 key_mod()
+
+=head2 key_unicode()
+
+=head2 key_scancode()
+
+=head2 motion_state()
+
+=head2 motion_x()
+
+Returns the motion of the mouse in X direction as an absolute value.
+
+=head2 motion_y()
+
+Returns the motion of the mouse in Y direction as an absolute value.
+
+=head2 motion_xrel()
+
+Returns the motion of the mouse in X direction as a relative value.
+
+=head2 motion_yrel()
+
+Returns the motion of the mouse in Y direction as a relative value.
+
+=head2 button_state()
+
+Returns the state of the mouse buttons.
+
+=head2 button_x()
+
+=head2 button_y()
+
+=head2 button()
+
+=head1 AUTHOR
+
+David J. Goehrig
+Documentation by Tels <http://bloodgate.com/>
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::App>
+
+=cut
--- /dev/null
+# Font.pm
+#
+# a SDL perl extension for SFont support
+#
+# Copyright (C) David J. Goehrig 2000,2002
+#
+
+package SDL::Font;
+use strict;
+use SDL;
+use SDL::SFont;
+use SDL::Surface;
+
+use vars qw(@ISA $CurrentFont );
+
+
+@ISA = qw(SDL::Surface);
+
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = \SDL::SFont::NewFont(shift);
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ SDL::FreeSurface($$self);
+}
+
+sub use ($) {
+ my $self = shift;
+ $CurrentFont = $self;
+ if ( $self->isa('SDL::Font')) {
+ SDL::SFont::UseFont($$self);
+ }
+}
+
+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
--- /dev/null
+#
+# MPEG.pm
+#
+# A package for manipulating MPEG video
+#
+# Copyright (C) 2004 David J. Goehrig
+
+package SDL::MPEG;
+
+use strict;
+use SDL;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my %options = @_;
+
+ verify (%options, qw/ -from / ) if $SDL::DEBUG;
+
+ my $self;
+ if ( $options{-from} ) {
+ die "SDL::MPEG::new -from requires a SDL::Video object\n"
+ unless $options{-from}->isa('SDL::Video');
+
+ $self = \SDL::SMPEGGetInfo(${$options{-from}});
+ } else {
+ $self = \SDL::NewSMPEGInfo();
+ }
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ SDL::FreeSMPEGInfo(${$_[0]});
+}
+
+sub has_audio {
+ SDL::SMPEGInfoHasAudio(${$_[0]});
+}
+
+sub has_video {
+ SDL::SMPEGInfoHasVideo(${$_[0]});
+}
+
+sub width {
+ SDL::SMPEGInfoWidth(${$_[0]});
+}
+
+sub height {
+ SDL::SMPEGInfoHeight(${$_[0]});
+}
+
+sub size {
+ SDL::SMPEGInfoTotalSize(${$_[0]});
+}
+
+sub offset {
+ SDL::SMPEGInfoCurrentOffset(${$_[0]});
+}
+
+sub frame {
+ SDL::SMPEGInfoCurrentFrame(${$_[0]});
+}
+
+sub fps {
+ SDL::SMPEGInfoCurrentFPS(${$_[0]});
+}
+
+sub time {
+ SDL::SMPEGInfoCurrentTime(${$_[0]});
+}
+
+sub length {
+ SDL::SMPEGInfoTotalTime(${$_[0]});
+}
+
+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
+
--- /dev/null
+# Mixer.pm
+#
+# a SDL module for manipulating the SDL_mixer lib.
+#
+# Copyright (C) 2000,2002 David J. Goehrig
+
+package SDL::Mixer;
+use strict;
+use SDL;
+use SDL::Sound;
+use SDL::Music;
+
+BEGIN {
+}
+
+$SDL::Mixer::initialized = 0;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ my %options = @_;
+ my $frequency = $options{-frequency} || $options{-rate} || SDL::MIX_DEFAULT_FREQUENCY();
+ my $format = $options{-format} || SDL::MIX_DEFAULT_FORMAT();
+ my $channels = $options{-channels} || SDL::MIX_DEFAULT_CHANNELS();
+ my $size = $options{-size} || 4096;
+ unless ( $SDL::Mixer::initialized ) {
+ SDL::MixOpenAudio($frequency,$format,$channels,$size ) &&
+ die SDL::GetError();
+ $SDL::Mixer::initialized = 1;
+ } else {
+ ++$SDL::Mixer::initialized;
+ }
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ --$SDL::Mixer::initialized;
+ unless ($SDL::Mixer::initialized) {
+ SDL::MixCloseAudio();
+ }
+}
+
+
+sub query_spec () {
+ my ($status,$freq,$format,$channels) = SDL::MixQuerySpec();
+ my %hash = ( -status => $status, -frequency => $freq,
+ -format => $format, -channels => $channels );
+ return \%hash;
+}
+
+sub reserve_channels ($$) {
+ my ($self,$channels) = @_;
+ return SDL::MixReserveChannels($channels);
+}
+
+sub allocate_channels ($$) {
+ my ($self,$channels) = @_;
+ return SDL::MixAllocateChannels($channels);
+}
+
+sub group_channel ($$$) {
+ my ($self,$channel,$group) = @_;
+ return SDL::MixGroupChannel($channel, $group);
+}
+
+sub group_channels ($$$$) {
+ my ($self,$from,$to,$group) = @_;
+ return SDL::MixGroupChannels($from,$to,$group);
+}
+
+sub group_available ($$) {
+ my ($self,$group) = @_;
+ return SDL::MixGroupAvailable($group);
+}
+
+sub group_count ($$) {
+ my ($self,$group) = @_;
+ return SDL::MixGroupCount($group);
+}
+
+sub group_oldest ($$) {
+ my ($self,$group) = @_;
+ return SDL::MixGroupOldest($group);
+}
+
+sub group_newer ($$) {
+ my ($self,$group) = @_;
+ return SDL::MixGroupNewer($group);
+}
+
+sub play_channel ($$$$;$) {
+ my ($self,$channel,$chunk,$loops,$ticks) = @_;
+ $ticks ||= -1;
+ return SDL::MixPlayChannelTimed($channel,$$chunk,$loops,$ticks);
+}
+
+sub play_music ($$$) {
+ my ($self,$music,$loops) = @_;
+ return SDL::MixPlayMusic($$music,$loops);
+}
+
+sub fade_in_channel ($$$$$;$) {
+ my ($self,$channel,$chunk,$loops,$ms,$ticks) = @_;
+ $ticks ||= -1;
+ return SDL::MixFadeInChannelTimed($channel,$$chunk,$loops,$ms,$ticks);
+}
+
+sub fade_in_music ($$$$) {
+ my ($self,$music,$loops,$ms) = @_;
+ return SDL::MixFadeInMusic($$music,$loops,$ms);
+}
+
+sub channel_volume ($$$) {
+ my ($self,$channel,$volume) = @_;
+ return SDL::MixVolume($channel,$volume);
+}
+
+sub music_volume ($$) {
+ my ($self,$volume) = @_;
+ return SDL::MixVolumeMusic($volume);
+}
+
+sub halt_channel ($$) {
+ my ($self,$channel) = @_;
+ return SDL::MixHaltChannel($channel);
+}
+
+sub halt_group ($$) {
+ my ($self,$group) = @_;
+ return SDL::MixHaltGroup($group);
+}
+
+sub halt_music (){
+ return SDL::MixHaltMusic();
+}
+
+sub channel_expire ($$$) {
+ my ($self,$channel,$ticks) = @_;
+ return SDL::MixExpireChannel($channel,$ticks);
+}
+
+sub fade_out_channel ($$$) {
+ my ($self,$channel,$ms) = @_;
+ return SDL::MixFadeOutChannel($channel,$ms);
+}
+
+sub fade_out_group ($$$) {
+ my ($self,$group,$ms) = @_;
+ return SDL::MixFadeOutGroup($group,$ms);
+}
+
+sub fade_out_music ($$) {
+ my ($self,$ms) = @_;
+ return SDL::MixFadeOutMusic($ms);
+}
+
+sub fading_music () {
+ return SDL::MixFadingMusic();
+}
+
+sub fading_channel ($$) {
+ my ($self,$channel) = @_;
+ return SDL::MixFadingChannel($channel);
+}
+
+sub pause ($$) {
+ my ($self,$channel) = @_;
+ SDL::MixPause($channel);
+}
+
+sub resume ($$) {
+ my ($self,$channel) = @_;
+ SDL::MixResume($channel);
+}
+
+sub paused ($$) {
+ my ($self,$channel) = @_;
+ return SDL::MixPaused($channel);
+}
+
+sub pause_music () {
+ SDL::MixPauseMusic();
+}
+
+sub resume_music () {
+ SDL::MixResumeMusic();
+}
+
+sub rewind_music (){
+ SDL::MixRewindMusic();
+}
+
+sub music_paused (){
+ return SDL::MixPausedMusic();
+}
+
+sub playing ($$) {
+ my ($self,$channel) = @_;
+ return SDL::MixPlaying($channel);
+}
+
+sub playing_music () {
+ return SDL::MixPlayingMusic();
+}
+
+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 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
+# Music.pm
+#
+# a SDL_mixer data module
+#
+# Copyright (C) 2000,2002 David J. Goehrig
+
+package SDL::Music;
+use strict;
+use SDL;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $filename = shift;
+ my $self = \SDL::MixLoadMusic($filename);
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ SDL::MixFreeMusic($$self);
+}
+
+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
--- /dev/null
+# SDL::OpenGL.pm
+#
+# A simplified OpenGL wrapper
+#
+# Copyright (C) 2002, 2003, 2004 David J. Goehrig
+#
+
+package SDL::OpenGL;
+
+require Exporter;
+require DynaLoader;
+use vars qw(
+ @EXPORT
+ @ISA
+);
+@ISA=qw(Exporter DynaLoader);
+
+use SDL;
+use SDL::OpenGL::Constants;
+
+bootstrap SDL::OpenGL;
+for ( keys %SDL::OpenGL:: ) {
+ if (/^gl/) {
+ push @EXPORT,$_;
+ }
+}
+
+# export all GL constants
+for (@SDL::OpenGL::Constants::EXPORT) {
+ push @EXPORT, $_;
+}
+
+
+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
--- /dev/null
+# SDL::OpenGL::Constants
+#
+# This is an autogenerate file, don't bother editing
+#
+# Copyright (C) 2003 David J. Goehrig <dave@sdlperl.org>
+
+package SDL::OpenGL::Constants;
+
+require Exporter;
+
+use SelfLoader;
+#$SelfLoader::DEBUG=1;
+
+use vars qw(
+ @EXPORT
+ @ISA
+);
+
+@ISA=qw(Exporter);
+@EXPORT=qw(
+ GLU_AUTO_LOAD_MATRIX
+ GLU_CULLING
+ GLU_DISPLAY_MODE
+ GLU_DOMAIN_DISTANCE
+ GLU_FILL
+ GLU_MAP1_TRIM_2
+ GLU_MAP1_TRIM_3
+ GLU_NURBS_BEGIN
+ GLU_NURBS_BEGIN_DATA
+ GLU_NURBS_COLOR
+ GLU_NURBS_COLOR_DATA
+ GLU_NURBS_END
+ GLU_NURBS_END_DATA
+ GLU_NURBS_ERROR
+ GLU_NURBS_MODE
+ GLU_NURBS_NORMAL
+ GLU_NURBS_NORMAL_DATA
+ GLU_NURBS_RENDERER
+ GLU_NURBS_TESSELLATOR
+ GLU_NURBS_TEXTURE_COORD
+ GLU_NURBS_TEXTURE_COORD_DATA
+ GLU_NURBS_VERTEX
+ GLU_NURBS_VERTEX_DATA
+ GLU_OBJECT_PARAMETRIC_ERROR
+ GLU_OBJECT_PATH_LENGTH
+ GLU_OUTLINE_PATCH
+ GLU_OUTLINE_POLYGON
+ GLU_PARAMETRIC_TOLERANCE
+ GLU_PATH_LENGTH
+ GLU_SAMPLING_METHOD
+ GLU_SAMPLING_TOLERANCE
+ GLU_TESS_BOUNDARY_ONLY
+ GLU_TESS_TOLERANCE
+ GLU_TESS_WINDING_ABS_GEQ_TWO
+ GLU_TESS_WINDING_NEGATIVE
+ GLU_TESS_WINDING_NONZERO
+ GLU_TESS_WINDING_ODD
+ GLU_TESS_WINDING_POSITIVE
+ GLU_TESS_WINDING_RULE
+ GLU_U_STEP
+ GLU_V_STEP
+ GL_2D
+ GL_2_BYTES
+ GL_3D
+ GL_3D_COLOR
+ GL_3D_COLOR_TEXTURE
+ GL_3_BYTES
+ GL_4D_COLOR_TEXTURE
+ GL_4_BYTES
+ GL_ABGR_EXT
+ GL_ACCUM
+ GL_ACCUM_ALPHA_BITS
+ GL_ACCUM_BLUE_BITS
+ GL_ACCUM_BUFFER_BIT
+ GL_ACCUM_CLEAR_VALUE
+ GL_ACCUM_GREEN_BITS
+ GL_ACCUM_RED_BITS
+ GL_ACTIVE_STENCIL_FACE_EXT
+ GL_ACTIVE_TEXTURE
+ GL_ACTIVE_TEXTURE_ARB
+ GL_ADD
+ GL_ADD_SIGNED
+ GL_ADD_SIGNED_ARB
+ GL_ADD_SIGNED_EXT
+ GL_ALIASED_LINE_WIDTH_RANGE
+ GL_ALIASED_POINT_SIZE_RANGE
+ GL_ALL_ATTRIB_BITS
+ GL_ALL_COMPLETED_NV
+ GL_ALL_EXTENSIONS_NV
+ GL_ALPHA
+ GL_ALPHA12
+ GL_ALPHA16
+ GL_ALPHA4
+ GL_ALPHA8
+ GL_ALPHA_BIAS
+ GL_ALPHA_BITS
+ GL_ALPHA_SCALE
+ GL_ALPHA_TEST
+ GL_ALPHA_TEST_FUNC
+ GL_ALPHA_TEST_REF
+ GL_ALWAYS
+ GL_AMBIENT
+ GL_AMBIENT_AND_DIFFUSE
+ GL_AND
+ GL_AND_INVERTED
+ GL_AND_REVERSE
+ GL_ARRAY_BUFFER_ARB
+ GL_ARRAY_BUFFER_BINDING_ARB
+ GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
+ GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
+ GL_ATTRIB_ARRAY_POINTER_NV
+ GL_ATTRIB_ARRAY_SIZE_NV
+ GL_ATTRIB_ARRAY_STRIDE_NV
+ GL_ATTRIB_ARRAY_TYPE_NV
+ GL_ATTRIB_STACK_DEPTH
+ GL_AUTO_NORMAL
+ GL_AUX0
+ GL_AUX1
+ GL_AUX2
+ GL_AUX3
+ GL_AUX_BUFFERS
+ GL_BACK
+ GL_BACK_LEFT
+ GL_BACK_RIGHT
+ GL_BGR
+ GL_BGRA
+ GL_BGRA_EXT
+ GL_BGR_EXT
+ GL_BIAS_BY_NEGATIVE_ONE_HALF_NV
+ GL_BITMAP
+ GL_BITMAP_TOKEN
+ GL_BLEND
+ GL_BLEND_COLOR
+ GL_BLEND_COLOR_EXT
+ GL_BLEND_DST
+ GL_BLEND_DST_ALPHA
+ GL_BLEND_DST_ALPHA_EXT
+ GL_BLEND_DST_RGB
+ GL_BLEND_DST_RGB_EXT
+ GL_BLEND_EQUATION
+ GL_BLEND_EQUATION_EXT
+ GL_BLEND_SRC
+ GL_BLEND_SRC_ALPHA
+ GL_BLEND_SRC_ALPHA_EXT
+ GL_BLEND_SRC_RGB
+ GL_BLEND_SRC_RGB_EXT
+ GL_BLUE
+ GL_BLUE_BIAS
+ GL_BLUE_BITS
+ GL_BLUE_SCALE
+ GL_BUFFER_ACCESS_ARB
+ GL_BUFFER_MAPPED_ARB
+ GL_BUFFER_MAP_POINTER_ARB
+ GL_BUFFER_SIZE_ARB
+ GL_BUFFER_USAGE_ARB
+ GL_BYTE
+ GL_C3F_V3F
+ GL_C4F_N3F_V3F
+ GL_C4UB_V2F
+ GL_C4UB_V3F
+ GL_CCW
+ GL_CLAMP
+ GL_CLAMP_TO_BORDER
+ GL_CLAMP_TO_BORDER_ARB
+ GL_CLAMP_TO_EDGE
+ GL_CLAMP_TO_EDGE_EXT
+ GL_CLEAR
+ GL_CLIENT_ACTIVE_TEXTURE
+ GL_CLIENT_ACTIVE_TEXTURE_ARB
+ GL_CLIENT_ALL_ATTRIB_BITS
+ GL_ALL_CLIENT_ATTRIB_BITS
+ GL_CLIENT_ATTRIB_STACK_DEPTH
+ GL_CLIENT_PIXEL_STORE_BIT
+ GL_CLIENT_VERTEX_ARRAY_BIT
+ GL_CLIP_PLANE0
+ GL_CLIP_PLANE1
+ GL_CLIP_PLANE2
+ GL_CLIP_PLANE3
+ GL_CLIP_PLANE4
+ GL_CLIP_PLANE5
+ GL_CLIP_VOLUME_CLIPPING_HINT_EXT
+ GL_COEFF
+ GL_COLOR
+ GL_COLOR_ARRAY
+ GL_COLOR_ARRAY_BUFFER_BINDING_ARB
+ GL_COLOR_ARRAY_COUNT_EXT
+ GL_COLOR_ARRAY_EXT
+ GL_COLOR_ARRAY_POINTER
+ GL_COLOR_ARRAY_POINTER_EXT
+ GL_COLOR_ARRAY_SIZE
+ GL_COLOR_ARRAY_SIZE_EXT
+ GL_COLOR_ARRAY_STRIDE
+ GL_COLOR_ARRAY_STRIDE_EXT
+ GL_COLOR_ARRAY_TYPE
+ GL_COLOR_ARRAY_TYPE_EXT
+ GL_COLOR_BUFFER_BIT
+ GL_COLOR_CLEAR_VALUE
+ GL_COLOR_INDEX
+ GL_COLOR_INDEX12_EXT
+ GL_COLOR_INDEX16_EXT
+ GL_COLOR_INDEX1_EXT
+ GL_COLOR_INDEX2_EXT
+ GL_COLOR_INDEX4_EXT
+ GL_COLOR_INDEX8_EXT
+ GL_COLOR_INDEXES
+ GL_COLOR_LOGIC_OP
+ GL_COLOR_MATERIAL
+ GL_COLOR_MATERIAL_FACE
+ GL_COLOR_MATERIAL_PARAMETER
+ GL_COLOR_MATRIX
+ GL_COLOR_MATRIX_STACK_DEPTH
+ GL_COLOR_SUM
+ GL_COLOR_SUM_ARB
+ GL_COLOR_SUM_CLAMP_NV
+ GL_COLOR_SUM_EXT
+ GL_COLOR_TABLE
+ GL_COLOR_TABLE_ALPHA_SIZE
+ GL_COLOR_TABLE_ALPHA_SIZE_EXT
+ GL_COLOR_TABLE_BIAS
+ GL_COLOR_TABLE_BLUE_SIZE
+ GL_COLOR_TABLE_BLUE_SIZE_EXT
+ GL_COLOR_TABLE_FORMAT
+ GL_COLOR_TABLE_FORMAT_EXT
+ GL_COLOR_TABLE_GREEN_SIZE
+ GL_COLOR_TABLE_GREEN_SIZE_EXT
+ GL_COLOR_TABLE_INTENSITY_SIZE
+ GL_COLOR_TABLE_INTENSITY_SIZE_EXT
+ GL_COLOR_TABLE_LUMINANCE_SIZE
+ GL_COLOR_TABLE_LUMINANCE_SIZE_EXT
+ GL_COLOR_TABLE_RED_SIZE
+ GL_COLOR_TABLE_RED_SIZE_EXT
+ GL_COLOR_TABLE_SCALE
+ GL_COLOR_TABLE_WIDTH
+ GL_COLOR_TABLE_WIDTH_EXT
+ GL_COLOR_WRITEMASK
+ GL_COMBINE
+ GL_COMBINE4_NV
+ GL_COMBINER0_NV
+ GL_COMBINER1_NV
+ GL_COMBINER2_NV
+ GL_COMBINER3_NV
+ GL_COMBINER4_NV
+ GL_COMBINER5_NV
+ GL_COMBINER6_NV
+ GL_COMBINER7_NV
+ GL_COMBINER_AB_DOT_PRODUCT_NV
+ GL_COMBINER_AB_OUTPUT_NV
+ GL_COMBINER_BIAS_NV
+ GL_COMBINER_CD_DOT_PRODUCT_NV
+ GL_COMBINER_CD_OUTPUT_NV
+ GL_COMBINER_COMPONENT_USAGE_NV
+ GL_COMBINER_INPUT_NV
+ GL_COMBINER_MAPPING_NV
+ GL_COMBINER_MUX_SUM_NV
+ GL_COMBINER_SCALE_NV
+ GL_COMBINER_SUM_OUTPUT_NV
+ GL_COMBINE_ALPHA
+ GL_COMBINE_ALPHA_ARB
+ GL_COMBINE_ALPHA_EXT
+ GL_COMBINE_ARB
+ GL_COMBINE_EXT
+ GL_COMBINE_RGB
+ GL_COMBINE_RGB_ARB
+ GL_COMBINE_RGB_EXT
+ GL_COMPARE_R_TO_TEXTURE
+ GL_COMPARE_R_TO_TEXTURE_ARB
+ GL_COMPILE
+ GL_COMPILE_AND_EXECUTE
+ GL_COMPRESSED_ALPHA
+ GL_COMPRESSED_ALPHA_ARB
+ GL_COMPRESSED_INTENSITY
+ GL_COMPRESSED_INTENSITY_ARB
+ GL_COMPRESSED_LUMINANCE
+ GL_COMPRESSED_LUMINANCE_ALPHA
+ GL_COMPRESSED_LUMINANCE_ALPHA_ARB
+ GL_COMPRESSED_LUMINANCE_ARB
+ GL_COMPRESSED_RGB
+ GL_COMPRESSED_RGBA
+ GL_COMPRESSED_RGBA_ARB
+ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
+ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
+ GL_COMPRESSED_RGB_ARB
+ GL_COMPRESSED_RGB_S3TC_DXT1_EXT
+ GL_COMPRESSED_TEXTURE_FORMATS
+ GL_COMPRESSED_TEXTURE_FORMATS_ARB
+ GL_CONSTANT
+ GL_CONSTANT_ALPHA
+ GL_CONSTANT_ALPHA_EXT
+ GL_CONSTANT_ARB
+ GL_CONSTANT_ATTENUATION
+ GL_CONSTANT_BORDER
+ GL_CONSTANT_COLOR
+ GL_CONSTANT_COLOR0_NV
+ GL_CONSTANT_COLOR1_NV
+ GL_CONSTANT_COLOR_EXT
+ GL_CONSTANT_EXT
+ GL_CONST_EYE_NV
+ GL_CONVOLUTION_1D
+ GL_CONVOLUTION_2D
+ GL_CONVOLUTION_BORDER_COLOR
+ GL_CONVOLUTION_BORDER_MODE
+ GL_CONVOLUTION_FILTER_BIAS
+ GL_CONVOLUTION_FILTER_SCALE
+ GL_CONVOLUTION_FORMAT
+ GL_CONVOLUTION_HEIGHT
+ GL_CONVOLUTION_WIDTH
+ GL_COORD_REPLACE_NV
+ GL_COPY
+ GL_COPY_INVERTED
+ GL_COPY_PIXEL_TOKEN
+ GL_CRYCBY_422_NVX
+ GL_CULL_FACE
+ GL_CULL_FACE_MODE
+ GL_CULL_FRAGMENT_NV
+ GL_CULL_MODES_NV
+ GL_CURRENT_ATTRIB_NV
+ GL_CURRENT_BIT
+ GL_CURRENT_COLOR
+ GL_CURRENT_FLUSHHOLD_NVX
+ GL_CURRENT_FOG_COORDINATE
+ GL_CURRENT_FOG_COORDINATE_EXT
+ GL_CURRENT_INDEX
+ GL_CURRENT_MATRIX_ARB
+ GL_CURRENT_MATRIX_NV
+ GL_CURRENT_MATRIX_STACK_DEPTH_ARB
+ GL_CURRENT_MATRIX_STACK_DEPTH_NV
+ GL_CURRENT_NORMAL
+ GL_CURRENT_OCCLUSION_QUERY_ID_NV
+ GL_CURRENT_RASTER_COLOR
+ GL_CURRENT_RASTER_DISTANCE
+ GL_CURRENT_RASTER_INDEX
+ GL_CURRENT_RASTER_POSITION
+ GL_CURRENT_RASTER_POSITION_VALID
+ GL_CURRENT_RASTER_TEXTURE_COORDS
+ GL_CURRENT_SECONDARY_COLOR
+ GL_CURRENT_SECONDARY_COLOR_EXT
+ GL_CURRENT_TEXTURE_COORDS
+ GL_CURRENT_VERTEX_ATTRIB_ARB
+ GL_CURRENT_VERTEX_WEIGHT_EXT
+ GL_CW
+ GL_DECAL
+ GL_DECR
+ GL_DECR_WRAP
+ GL_DECR_WRAP_EXT
+ GL_DEPENDENT_AR_TEXTURE_2D_NV
+ GL_DEPENDENT_GB_TEXTURE_2D_NV
+ GL_DEPENDENT_HILO_TEXTURE_2D_NV
+ GL_DEPENDENT_RGB_TEXTURE_3D_NV
+ GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV
+ GL_DEPTH
+ GL_DEPTH_BIAS
+ GL_DEPTH_BITS
+ GL_DEPTH_BOUNDS_NV
+ GL_DEPTH_BOUNDS_TEST_NV
+ GL_DEPTH_BUFFER_BIT
+ GL_DEPTH_CLAMP_NV
+ GL_DEPTH_CLEAR_VALUE
+ GL_DEPTH_COMPONENT
+ GL_DEPTH_COMPONENT16
+ GL_DEPTH_COMPONENT16_ARB
+ GL_DEPTH_COMPONENT16_SGIX
+ GL_DEPTH_COMPONENT24
+ GL_DEPTH_COMPONENT24_ARB
+ GL_DEPTH_COMPONENT24_SGIX
+ GL_DEPTH_COMPONENT32
+ GL_DEPTH_COMPONENT32_ARB
+ GL_DEPTH_COMPONENT32_SGIX
+ GL_DEPTH_FUNC
+ GL_DEPTH_RANGE
+ GL_DEPTH_SCALE
+ GL_DEPTH_STENCIL_NV
+ GL_DEPTH_STENCIL_TO_BGRA_NV
+ GL_DEPTH_STENCIL_TO_RGBA_NV
+ GL_DEPTH_TEST
+ GL_DEPTH_TEXTURE_MODE
+ GL_DEPTH_TEXTURE_MODE_ARB
+ GL_DEPTH_WRITEMASK
+ GL_DIFFUSE
+ GL_DISCARD_NV
+ GL_DISTANCE_ATTENUATION_EXT
+ GL_DITHER
+ GL_DOMAIN
+ GL_DONT_CARE
+ GL_DOT3_RGB
+ GL_DOT3_RGBA
+ GL_DOT3_RGBA_ARB
+ GL_DOT3_RGBA_EXT
+ GL_DOT3_RGB_ARB
+ GL_DOT3_RGB_EXT
+ GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV
+ GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV
+ GL_DOT_PRODUCT_DEPTH_REPLACE_NV
+ GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV
+ GL_DOT_PRODUCT_NV
+ GL_DOT_PRODUCT_PASS_THROUGH_NV
+ GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV
+ GL_DOT_PRODUCT_TEXTURE_1D_NV
+ GL_DOT_PRODUCT_TEXTURE_2D_NV
+ GL_DOT_PRODUCT_TEXTURE_3D_NV
+ GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV
+ GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV
+ GL_DOUBLE
+ GL_DOUBLEBUFFER
+ GL_DOUBLE_EXT
+ GL_DRAW_BUFFER
+ GL_DRAW_PIXEL_TOKEN
+ GL_DSDT8_MAG8_INTENSITY8_NV
+ GL_DSDT8_MAG8_NV
+ GL_DSDT8_NV
+ GL_DSDT_MAG_INTENSITY_NV
+ GL_DSDT_MAG_NV
+ GL_DSDT_MAG_VIB_NV
+ GL_DSDT_NV
+ GL_DST_ALPHA
+ GL_DST_COLOR
+ GL_DS_BIAS_NV
+ GL_DS_SCALE_NV
+ GL_DT_BIAS_NV
+ GL_DT_SCALE_NV
+ GL_DYNAMIC_COPY_ARB
+ GL_DYNAMIC_DRAW_ARB
+ GL_DYNAMIC_READ_ARB
+ GL_EDGE_FLAG
+ GL_EDGE_FLAG_ARRAY
+ GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
+ GL_EDGE_FLAG_ARRAY_COUNT_EXT
+ GL_EDGE_FLAG_ARRAY_EXT
+ GL_EDGE_FLAG_ARRAY_POINTER
+ GL_EDGE_FLAG_ARRAY_POINTER_EXT
+ GL_EDGE_FLAG_ARRAY_STRIDE
+ GL_EDGE_FLAG_ARRAY_STRIDE_EXT
+ GL_ELEMENT_ARRAY_BUFFER_ARB
+ GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
+ GL_EMISSION
+ GL_ENABLE_BIT
+ GL_EQUAL
+ GL_EQUIV
+ GL_EVAL_BIT
+ GL_EXP
+ GL_EXP2
+ GL_EXPAND_NEGATE_NV
+ GL_EXPAND_NORMAL_NV
+ GL_EXTENSIONS
+ GL_EYE_LINEAR
+ GL_EYE_PLANE
+ GL_EYE_PLANE_ABSOLUTE_NV
+ GL_EYE_RADIAL_NV
+ GL_E_TIMES_F_NV
+ GL_FALSE
+ GL_FASTEST
+ GL_FEEDBACK
+ GL_FEEDBACK_BUFFER_POINTER
+ GL_FEEDBACK_BUFFER_SIZE
+ GL_FEEDBACK_BUFFER_TYPE
+ GL_FENCE_CONDITION_NV
+ GL_FENCE_STATUS_NV
+ GL_FILL
+ GL_FLAT
+ GL_FLOAT
+ GL_FLOAT_CLEAR_COLOR_VALUE_NV
+ GL_FLOAT_R16_NV
+ GL_FLOAT_R32_NV
+ GL_FLOAT_RG16_NV
+ GL_FLOAT_RG32_NV
+ GL_FLOAT_RGB16_NV
+ GL_FLOAT_RGB32_NV
+ GL_FLOAT_RGBA16_NV
+ GL_FLOAT_RGBA32_NV
+ GL_FLOAT_RGBA_MODE_NV
+ GL_FLOAT_RGBA_NV
+ GL_FLOAT_RGB_NV
+ GL_FLOAT_RG_NV
+ GL_FLOAT_R_NV
+ GL_FOG
+ GL_FOG_BIT
+ GL_FOG_COLOR
+ GL_FOG_COORDINATE
+ GL_FOG_COORDINATE_ARRAY
+ GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
+ GL_FOG_COORDINATE_ARRAY_EXT
+ GL_FOG_COORDINATE_ARRAY_POINTER
+ GL_FOG_COORDINATE_ARRAY_POINTER_EXT
+ GL_FOG_COORDINATE_ARRAY_STRIDE
+ GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
+ GL_FOG_COORDINATE_ARRAY_TYPE
+ GL_FOG_COORDINATE_ARRAY_TYPE_EXT
+ GL_FOG_COORDINATE_EXT
+ GL_FOG_COORDINATE_SOURCE
+ GL_FOG_COORDINATE_SOURCE_EXT
+ GL_FOG_DENSITY
+ GL_FOG_DISTANCE_MODE_NV
+ GL_FOG_END
+ GL_FOG_HINT
+ GL_FOG_INDEX
+ GL_FOG_MODE
+ GL_FOG_START
+ GL_FORCE_BLUE_TO_ONE_NV
+ GL_FORCE_SOFTWARE_NV
+ GL_FRAGMENT_DEPTH
+ GL_FRAGMENT_DEPTH_EXT
+ GL_FRAGMENT_PROGRAM_ARB
+ GL_FRAGMENT_PROGRAM_BINDING_NV
+ GL_FRAGMENT_PROGRAM_NV
+ GL_FRONT
+ GL_FRONT_AND_BACK
+ GL_FRONT_FACE
+ GL_FRONT_LEFT
+ GL_FRONT_RIGHT
+ GL_FUNC_ADD
+ GL_FUNC_ADD_EXT
+ GL_FUNC_REVERSE_SUBTRACT
+ GL_FUNC_REVERSE_SUBTRACT_EXT
+ GL_FUNC_SUBTRACT
+ GL_FUNC_SUBTRACT_EXT
+ GL_GENERATE_MIPMAP
+ GL_GENERATE_MIPMAP_HINT
+ GL_GENERATE_MIPMAP_HINT_SGIS
+ GL_GENERATE_MIPMAP_SGIS
+ GL_GEQUAL
+ GL_GREATER
+ GL_GREEN
+ GL_GREEN_BIAS
+ GL_GREEN_BITS
+ GL_GREEN_SCALE
+ GL_HALF_BIAS_NEGATE_NV
+ GL_HALF_BIAS_NORMAL_NV
+ GL_HALF_FLOAT_NV
+ GL_HILO16_NV
+ GL_HILO8_NV
+ GL_HILO_NV
+ GL_HINT_BIT
+ GL_HISTOGRAM
+ GL_HISTOGRAM_ALPHA_SIZE
+ GL_HISTOGRAM_BLUE_SIZE
+ GL_HISTOGRAM_FORMAT
+ GL_HISTOGRAM_GREEN_SIZE
+ GL_HISTOGRAM_LUMINANCE_SIZE
+ GL_HISTOGRAM_RED_SIZE
+ GL_HISTOGRAM_SINK
+ GL_HISTOGRAM_WIDTH
+ GL_HI_BIAS_NV
+ GL_HI_SCALE_NV
+ GL_IDENTITY_NV
+ GL_IGNORE_BORDER
+ GL_INCR
+ GL_INCR_WRAP
+ GL_INCR_WRAP_EXT
+ GL_INDEX_ARRAY
+ GL_INDEX_ARRAY_BUFFER_BINDING_ARB
+ GL_INDEX_ARRAY_COUNT_EXT
+ GL_INDEX_ARRAY_EXT
+ GL_INDEX_ARRAY_POINTER
+ GL_INDEX_ARRAY_POINTER_EXT
+ GL_INDEX_ARRAY_STRIDE
+ GL_INDEX_ARRAY_STRIDE_EXT
+ GL_INDEX_ARRAY_TYPE
+ GL_INDEX_ARRAY_TYPE_EXT
+ GL_INDEX_BITS
+ GL_INDEX_CLEAR_VALUE
+ GL_INDEX_LOGIC_OP
+ GL_INDEX_MODE
+ GL_INDEX_OFFSET
+ GL_INDEX_SHIFT
+ GL_INDEX_WRITEMASK
+ GL_INT
+ GL_INTENSITY
+ GL_INTENSITY12
+ GL_INTENSITY16
+ GL_INTENSITY4
+ GL_INTENSITY8
+ GL_INTERPOLATE
+ GL_INTERPOLATE_ARB
+ GL_INTERPOLATE_EXT
+ GL_INVALID_ENUM
+ GL_INVALID_OPERATION
+ GL_INVALID_VALUE
+ GL_INVERSE_NV
+ GL_INVERSE_TRANSPOSE_NV
+ GL_INVERT
+ GL_KEEP
+ GL_LEFT
+ GL_LEQUAL
+ GL_LESS
+ GL_LIGHT0
+ GL_LIGHT1
+ GL_LIGHT2
+ GL_LIGHT3
+ GL_LIGHT4
+ GL_LIGHT5
+ GL_LIGHT6
+ GL_LIGHT7
+ GL_LIGHTING
+ GL_LIGHTING_BIT
+ GL_LIGHT_MODEL_AMBIENT
+ GL_LIGHT_MODEL_COLOR_CONTROL
+ GL_LIGHT_MODEL_COLOR_CONTROL_EXT
+ GL_LIGHT_MODEL_LOCAL_VIEWER
+ GL_LIGHT_MODEL_TWO_SIDE
+ GL_LINE
+ GL_LINEAR
+ GL_LINEAR_ATTENUATION
+ GL_LINEAR_MIPMAP_LINEAR
+ GL_LINEAR_MIPMAP_NEAREST
+ GL_LINES
+ GL_LINE_BIT
+ GL_LINE_LOOP
+ GL_LINE_RESET_TOKEN
+ GL_LINE_SMOOTH
+ GL_LINE_SMOOTH_HINT
+ GL_LINE_STIPPLE
+ GL_LINE_STIPPLE_PATTERN
+ GL_LINE_STIPPLE_REPEAT
+ GL_LINE_STRIP
+ GL_LINE_TOKEN
+ GL_LINE_WIDTH
+ GL_LINE_WIDTH_GRANULARITY
+ GL_LINE_WIDTH_RANGE
+ GL_LIST_BASE
+ GL_LIST_BIT
+ GL_LIST_INDEX
+ GL_LIST_MODE
+ GL_LOAD
+ GL_LOGIC_OP
+ GL_LOGIC_OP_MODE
+ GL_LO_BIAS_NV
+ GL_LO_SCALE_NV
+ GL_LUMINANCE
+ GL_LUMINANCE12
+ GL_LUMINANCE12_ALPHA12
+ GL_LUMINANCE12_ALPHA4
+ GL_LUMINANCE16
+ GL_LUMINANCE16_ALPHA16
+ GL_LUMINANCE4
+ GL_LUMINANCE4_ALPHA4
+ GL_LUMINANCE6_ALPHA2
+ GL_LUMINANCE8
+ GL_LUMINANCE8_ALPHA8
+ GL_LUMINANCE_ALPHA
+ GL_MAC_GET_PROC_ADDRESS_NV
+ GL_MAGNITUDE_BIAS_NV
+ GL_MAGNITUDE_SCALE_NV
+ GL_MAP1_COLOR_4
+ GL_MAP1_GRID_DOMAIN
+ GL_MAP1_GRID_SEGMENTS
+ GL_MAP1_INDEX
+ GL_MAP1_NORMAL
+ GL_MAP1_TEXTURE_COORD_1
+ GL_MAP1_TEXTURE_COORD_2
+ GL_MAP1_TEXTURE_COORD_3
+ GL_MAP1_TEXTURE_COORD_4
+ GL_MAP1_VERTEX_3
+ GL_MAP1_VERTEX_4
+ GL_MAP1_VERTEX_ATTRIB0_4_NV
+ GL_MAP1_VERTEX_ATTRIB10_4_NV
+ GL_MAP1_VERTEX_ATTRIB11_4_NV
+ GL_MAP1_VERTEX_ATTRIB12_4_NV
+ GL_MAP1_VERTEX_ATTRIB13_4_NV
+ GL_MAP1_VERTEX_ATTRIB14_4_NV
+ GL_MAP1_VERTEX_ATTRIB15_4_NV
+ GL_MAP1_VERTEX_ATTRIB1_4_NV
+ GL_MAP1_VERTEX_ATTRIB2_4_NV
+ GL_MAP1_VERTEX_ATTRIB3_4_NV
+ GL_MAP1_VERTEX_ATTRIB4_4_NV
+ GL_MAP1_VERTEX_ATTRIB5_4_NV
+ GL_MAP1_VERTEX_ATTRIB6_4_NV
+ GL_MAP1_VERTEX_ATTRIB7_4_NV
+ GL_MAP1_VERTEX_ATTRIB8_4_NV
+ GL_MAP1_VERTEX_ATTRIB9_4_NV
+ GL_MAP2_COLOR_4
+ GL_MAP2_GRID_DOMAIN
+ GL_MAP2_GRID_SEGMENTS
+ GL_MAP2_INDEX
+ GL_MAP2_NORMAL
+ GL_MAP2_TEXTURE_COORD_1
+ GL_MAP2_TEXTURE_COORD_2
+ GL_MAP2_TEXTURE_COORD_3
+ GL_MAP2_TEXTURE_COORD_4
+ GL_MAP2_VERTEX_3
+ GL_MAP2_VERTEX_4
+ GL_MAP2_VERTEX_ATTRIB0_4_NV
+ GL_MAP2_VERTEX_ATTRIB10_4_NV
+ GL_MAP2_VERTEX_ATTRIB11_4_NV
+ GL_MAP2_VERTEX_ATTRIB12_4_NV
+ GL_MAP2_VERTEX_ATTRIB13_4_NV
+ GL_MAP2_VERTEX_ATTRIB14_4_NV
+ GL_MAP2_VERTEX_ATTRIB15_4_NV
+ GL_MAP2_VERTEX_ATTRIB1_4_NV
+ GL_MAP2_VERTEX_ATTRIB2_4_NV
+ GL_MAP2_VERTEX_ATTRIB3_4_NV
+ GL_MAP2_VERTEX_ATTRIB4_4_NV
+ GL_MAP2_VERTEX_ATTRIB5_4_NV
+ GL_MAP2_VERTEX_ATTRIB6_4_NV
+ GL_MAP2_VERTEX_ATTRIB7_4_NV
+ GL_MAP2_VERTEX_ATTRIB8_4_NV
+ GL_MAP2_VERTEX_ATTRIB9_4_NV
+ GL_MAP_COLOR
+ GL_MAP_STENCIL
+ GL_MATRIX0_ARB
+ GL_MATRIX0_NV
+ GL_MATRIX10_ARB
+ GL_MATRIX11_ARB
+ GL_MATRIX12_ARB
+ GL_MATRIX13_ARB
+ GL_MATRIX14_ARB
+ GL_MATRIX15_ARB
+ GL_MATRIX16_ARB
+ GL_MATRIX17_ARB
+ GL_MATRIX18_ARB
+ GL_MATRIX19_ARB
+ GL_MATRIX1_ARB
+ GL_MATRIX1_NV
+ GL_MATRIX20_ARB
+ GL_MATRIX21_ARB
+ GL_MATRIX22_ARB
+ GL_MATRIX23_ARB
+ GL_MATRIX24_ARB
+ GL_MATRIX25_ARB
+ GL_MATRIX26_ARB
+ GL_MATRIX27_ARB
+ GL_MATRIX28_ARB
+ GL_MATRIX29_ARB
+ GL_MATRIX2_ARB
+ GL_MATRIX2_NV
+ GL_MATRIX30_ARB
+ GL_MATRIX31_ARB
+ GL_MATRIX3_ARB
+ GL_MATRIX3_NV
+ GL_MATRIX4_ARB
+ GL_MATRIX4_NV
+ GL_MATRIX5_ARB
+ GL_MATRIX5_NV
+ GL_MATRIX6_ARB
+ GL_MATRIX6_NV
+ GL_MATRIX7_ARB
+ GL_MATRIX7_NV
+ GL_MATRIX8_ARB
+ GL_MATRIX9_ARB
+ GL_MATRIX_MODE
+ GL_MAX
+ GL_MAX_3D_TEXTURE_SIZE
+ GL_MAX_3D_TEXTURE_SIZE_EXT
+ GL_MAX_ATTRIB_STACK_DEPTH
+ GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
+ GL_MAX_CLIP_PLANES
+ GL_MAX_COLOR_MATRIX_STACK_DEPTH
+ GL_MAX_CONVOLUTION_HEIGHT
+ GL_MAX_CONVOLUTION_WIDTH
+ GL_MAX_CUBE_MAP_TEXTURE_SIZE
+ GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
+ GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT
+ GL_MAX_ELEMENTS_INDICES
+ GL_MAX_ELEMENTS_INDICES_EXT
+ GL_MAX_ELEMENTS_VERTICES
+ GL_MAX_ELEMENTS_VERTICES_EXT
+ GL_MAX_EVAL_ORDER
+ GL_MAX_EXT
+ GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
+ GL_MAX_GENERAL_COMBINERS_NV
+ GL_MAX_LIGHTS
+ GL_MAX_LIST_NESTING
+ GL_MAX_MODELVIEW_STACK_DEPTH
+ GL_MAX_NAME_STACK_DEPTH
+ GL_MAX_PENDING_FLUSHHOLD_NVX
+ GL_MAX_PIXEL_MAP_TABLE
+ GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB
+ GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB
+ GL_MAX_PROGRAM_ATTRIBS_ARB
+ GL_MAX_PROGRAM_ENV_PARAMETERS_ARB
+ GL_MAX_PROGRAM_INSTRUCTIONS_ARB
+ GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB
+ GL_MAX_PROGRAM_MATRICES_ARB
+ GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
+ GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB
+ GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB
+ GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB
+ GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB
+ GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB
+ GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB
+ GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB
+ GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB
+ GL_MAX_PROGRAM_PARAMETERS_ARB
+ GL_MAX_PROGRAM_TEMPORARIES_ARB
+ GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB
+ GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB
+ GL_MAX_PROJECTION_STACK_DEPTH
+ GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
+ GL_MAX_SHININESS_NV
+ GL_MAX_SPOT_EXPONENT_NV
+ GL_MAX_TEXTURES_SGIS
+ GL_MAX_TEXTURE_COORDS_ARB
+ GL_MAX_TEXTURE_COORDS_NV
+ GL_MAX_TEXTURE_IMAGE_UNITS_ARB
+ GL_MAX_TEXTURE_IMAGE_UNITS_NV
+ GL_MAX_TEXTURE_LOD_BIAS
+ GL_MAX_TEXTURE_LOD_BIAS_EXT
+ GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
+ GL_MAX_TEXTURE_SIZE
+ GL_MAX_TEXTURE_STACK_DEPTH
+ GL_MAX_TEXTURE_UNITS
+ GL_MAX_TEXTURE_UNITS_ARB
+ GL_MAX_TRACK_MATRICES_NV
+ GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV
+ GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV
+ GL_MAX_VERTEX_ATTRIBS_ARB
+ GL_MAX_VIEWPORT_DIMS
+ GL_MIN
+ GL_MINMAX
+ GL_MINMAX_FORMAT
+ GL_MINMAX_SINK
+ GL_MIN_EXT
+ GL_MIRRORED_REPEAT
+ GL_MIRRORED_REPEAT_ARB
+ GL_MIRRORED_REPEAT_IBM
+ GL_MODELVIEW
+ GL_MODELVIEW0_EXT
+ GL_MODELVIEW0_MATRIX_EXT
+ GL_MODELVIEW0_STACK_DEPTH_EXT
+ GL_MODELVIEW1_EXT
+ GL_MODELVIEW1_MATRIX_EXT
+ GL_MODELVIEW1_STACK_DEPTH_EXT
+ GL_MODELVIEW_MATRIX
+ GL_MODELVIEW_PROJECTION_NV
+ GL_MODELVIEW_STACK_DEPTH
+ GL_MODULATE
+ GL_MULT
+ GL_MULTISAMPLE
+ GL_MULTISAMPLE_ARB
+ GL_MULTISAMPLE_BIT
+ GL_MULTISAMPLE_BIT_ARB
+ GL_MULTISAMPLE_FILTER_HINT_NV
+ GL_N3F_V3F
+ GL_NAME_STACK_DEPTH
+ GL_NAND
+ GL_NEAREST
+ GL_NEAREST_MIPMAP_LINEAR
+ GL_NEAREST_MIPMAP_NEAREST
+ GL_NEVER
+ GL_NICEST
+ GL_NONE
+ GL_NOOP
+ GL_NOR
+ GL_NORMALIZE
+ GL_NORMAL_ARRAY
+ GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
+ GL_NORMAL_ARRAY_COUNT_EXT
+ GL_NORMAL_ARRAY_EXT
+ GL_NORMAL_ARRAY_POINTER
+ GL_NORMAL_ARRAY_POINTER_EXT
+ GL_NORMAL_ARRAY_STRIDE
+ GL_NORMAL_ARRAY_STRIDE_EXT
+ GL_NORMAL_ARRAY_TYPE
+ GL_NORMAL_ARRAY_TYPE_EXT
+ GL_NORMAL_MAP
+ GL_NORMAL_MAP_ARB
+ GL_NORMAL_MAP_EXT
+ GL_NORMAL_MAP_NV
+ GL_NOTEQUAL
+ GL_NO_ERROR
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS
+ GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
+ GL_NUM_GENERAL_COMBINERS_NV
+ GL_OBJECT_LINEAR
+ GL_OBJECT_PLANE
+ GL_OCCLUSION_TEST_HP
+ GL_OCCLUSION_TEST_RESULT_HP
+ GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV
+ GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV
+ GL_OFFSET_HILO_TEXTURE_2D_NV
+ GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV
+ GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV
+ GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV
+ GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV
+ GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV
+ GL_OFFSET_TEXTURE_2D_BIAS_NV
+ GL_OFFSET_TEXTURE_2D_MATRIX_NV
+ GL_OFFSET_TEXTURE_2D_NV
+ GL_OFFSET_TEXTURE_2D_SCALE_NV
+ GL_OFFSET_TEXTURE_BIAS_NV
+ GL_OFFSET_TEXTURE_MATRIX_NV
+ GL_OFFSET_TEXTURE_RECTANGLE_NV
+ GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV
+ GL_OFFSET_TEXTURE_SCALE_NV
+ GL_ONE
+ GL_ONE_MINUS_CONSTANT_ALPHA
+ GL_ONE_MINUS_CONSTANT_ALPHA_EXT
+ GL_ONE_MINUS_CONSTANT_COLOR
+ GL_ONE_MINUS_CONSTANT_COLOR_EXT
+ GL_ONE_MINUS_DST_ALPHA
+ GL_ONE_MINUS_DST_COLOR
+ GL_ONE_MINUS_SRC_ALPHA
+ GL_ONE_MINUS_SRC_COLOR
+ GL_OPERAND0_ALPHA
+ GL_OPERAND0_ALPHA_ARB
+ GL_OPERAND0_ALPHA_EXT
+ GL_OPERAND0_RGB
+ GL_OPERAND0_RGB_ARB
+ GL_OPERAND0_RGB_EXT
+ GL_OPERAND1_ALPHA
+ GL_OPERAND1_ALPHA_ARB
+ GL_OPERAND1_ALPHA_EXT
+ GL_OPERAND1_RGB
+ GL_OPERAND1_RGB_ARB
+ GL_OPERAND1_RGB_EXT
+ GL_OPERAND2_ALPHA
+ GL_OPERAND2_ALPHA_ARB
+ GL_OPERAND2_ALPHA_EXT
+ GL_OPERAND2_RGB
+ GL_OPERAND2_RGB_ARB
+ GL_OPERAND2_RGB_EXT
+ GL_OPERAND3_ALPHA_NV
+ GL_OPERAND3_RGB_NV
+ GL_OR
+ GL_ORDER
+ GL_OR_INVERTED
+ GL_OR_REVERSE
+ GL_OUT_OF_MEMORY
+ GL_PACK_ALIGNMENT
+ GL_PACK_IMAGE_HEIGHT
+ GL_PACK_IMAGE_HEIGHT_EXT
+ GL_PACK_LSB_FIRST
+ GL_PACK_ROW_LENGTH
+ GL_PACK_SKIP_IMAGES
+ GL_PACK_SKIP_IMAGES_EXT
+ GL_PACK_SKIP_PIXELS
+ GL_PACK_SKIP_ROWS
+ GL_PACK_SWAP_BYTES
+ GL_PASS_THROUGH_NV
+ GL_PASS_THROUGH_TOKEN
+ GL_PERSPECTIVE_CORRECTION_HINT
+ GL_PER_STAGE_CONSTANTS_NV
+ GL_PIXEL_COUNTER_BITS_NV
+ GL_PIXEL_COUNT_AVAILABLE_NV
+ GL_PIXEL_COUNT_NV
+ GL_PIXEL_MAP_A_TO_A
+ GL_PIXEL_MAP_A_TO_A_SIZE
+ GL_PIXEL_MAP_B_TO_B
+ GL_PIXEL_MAP_B_TO_B_SIZE
+ GL_PIXEL_MAP_G_TO_G
+ GL_PIXEL_MAP_G_TO_G_SIZE
+ GL_PIXEL_MAP_I_TO_A
+ GL_PIXEL_MAP_I_TO_A_SIZE
+ GL_PIXEL_MAP_I_TO_B
+ GL_PIXEL_MAP_I_TO_B_SIZE
+ GL_PIXEL_MAP_I_TO_G
+ GL_PIXEL_MAP_I_TO_G_SIZE
+ GL_PIXEL_MAP_I_TO_I
+ GL_PIXEL_MAP_I_TO_I_SIZE
+ GL_PIXEL_MAP_I_TO_R
+ GL_PIXEL_MAP_I_TO_R_SIZE
+ GL_PIXEL_MAP_R_TO_R
+ GL_PIXEL_MAP_R_TO_R_SIZE
+ GL_PIXEL_MAP_S_TO_S
+ GL_PIXEL_MAP_S_TO_S_SIZE
+ GL_PIXEL_MODE_BIT
+ GL_POINT
+ GL_POINTS
+ GL_POINT_BIT
+ GL_POINT_DISTANCE_ATTENUATION
+ GL_POINT_DISTANCE_ATTENUATION_ARB
+ GL_POINT_FADE_THRESHOLD_SIZE
+ GL_POINT_FADE_THRESHOLD_SIZE_ARB
+ GL_POINT_FADE_THRESHOLD_SIZE_EXT
+ GL_POINT_SIZE
+ GL_POINT_SIZE_GRANULARITY
+ GL_POINT_SIZE_MAX
+ GL_POINT_SIZE_MAX_ARB
+ GL_POINT_SIZE_MAX_EXT
+ GL_POINT_SIZE_MIN
+ GL_POINT_SIZE_MIN_ARB
+ GL_POINT_SIZE_MIN_EXT
+ GL_POINT_SIZE_RANGE
+ GL_POINT_SMOOTH
+ GL_POINT_SMOOTH_HINT
+ GL_POINT_SPRITE_NV
+ GL_POINT_SPRITE_R_MODE_NV
+ GL_POINT_TOKEN
+ GL_POLYGON
+ GL_POLYGON_BIT
+ GL_POLYGON_MODE
+ GL_POLYGON_OFFSET_FACTOR
+ GL_POLYGON_OFFSET_FILL
+ GL_POLYGON_OFFSET_LINE
+ GL_POLYGON_OFFSET_POINT
+ GL_POLYGON_OFFSET_UNITS
+ GL_POLYGON_SMOOTH
+ GL_POLYGON_SMOOTH_HINT
+ GL_POLYGON_STIPPLE
+ GL_POLYGON_STIPPLE_BIT
+ GL_POLYGON_TOKEN
+ GL_POSITION
+ GL_POST_COLOR_MATRIX_ALPHA_BIAS
+ GL_POST_COLOR_MATRIX_ALPHA_SCALE
+ GL_POST_COLOR_MATRIX_BLUE_BIAS
+ GL_POST_COLOR_MATRIX_BLUE_SCALE
+ GL_POST_COLOR_MATRIX_COLOR_TABLE
+ GL_POST_COLOR_MATRIX_GREEN_BIAS
+ GL_POST_COLOR_MATRIX_GREEN_SCALE
+ GL_POST_COLOR_MATRIX_RED_BIAS
+ GL_POST_COLOR_MATRIX_RED_SCALE
+ GL_POST_CONVOLUTION_ALPHA_BIAS
+ GL_POST_CONVOLUTION_ALPHA_SCALE
+ GL_POST_CONVOLUTION_BLUE_BIAS
+ GL_POST_CONVOLUTION_BLUE_SCALE
+ GL_POST_CONVOLUTION_COLOR_TABLE
+ GL_POST_CONVOLUTION_GREEN_BIAS
+ GL_POST_CONVOLUTION_GREEN_SCALE
+ GL_POST_CONVOLUTION_RED_BIAS
+ GL_POST_CONVOLUTION_RED_SCALE
+ GL_PREVIOUS
+ GL_PREVIOUS_ARB
+ GL_PREVIOUS_EXT
+ GL_PREVIOUS_TEXTURE_INPUT_NV
+ GL_PRIMARY_COLOR
+ GL_PRIMARY_COLOR_ARB
+ GL_PRIMARY_COLOR_EXT
+ GL_PRIMARY_COLOR_NV
+ GL_PRIMITIVE_RESTART_INDEX_NV
+ GL_PRIMITIVE_RESTART_NV
+ GL_PROGRAM_ADDRESS_REGISTERS_ARB
+ GL_PROGRAM_ALU_INSTRUCTIONS_ARB
+ GL_PROGRAM_ATTRIBS_ARB
+ GL_PROGRAM_BINDING_ARB
+ GL_PROGRAM_ERROR_POSITION_ARB
+ GL_PROGRAM_ERROR_POSITION_NV
+ GL_PROGRAM_ERROR_STRING_ARB
+ GL_PROGRAM_ERROR_STRING_NV
+ GL_PROGRAM_FORMAT_ARB
+ GL_PROGRAM_FORMAT_ASCII_ARB
+ GL_PROGRAM_INSTRUCTIONS_ARB
+ GL_PROGRAM_LENGTH_ARB
+ GL_PROGRAM_LENGTH_NV
+ GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB
+ GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB
+ GL_PROGRAM_NATIVE_ATTRIBS_ARB
+ GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB
+ GL_PROGRAM_NATIVE_PARAMETERS_ARB
+ GL_PROGRAM_NATIVE_TEMPORARIES_ARB
+ GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB
+ GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB
+ GL_PROGRAM_PARAMETERS_ARB
+ GL_PROGRAM_PARAMETER_NV
+ GL_PROGRAM_RESIDENT_NV
+ GL_PROGRAM_STRING_ARB
+ GL_PROGRAM_STRING_NV
+ GL_PROGRAM_TARGET_NV
+ GL_PROGRAM_TEMPORARIES_ARB
+ GL_PROGRAM_TEX_INDIRECTIONS_ARB
+ GL_PROGRAM_TEX_INSTRUCTIONS_ARB
+ GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB
+ GL_PROJECTION
+ GL_PROJECTION_MATRIX
+ GL_PROJECTION_STACK_DEPTH
+ GL_PROXY_COLOR_TABLE
+ GL_PROXY_HISTOGRAM
+ GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE
+ GL_PROXY_POST_CONVOLUTION_COLOR_TABLE
+ GL_PROXY_TEXTURE_1D
+ GL_PROXY_TEXTURE_2D
+ GL_PROXY_TEXTURE_3D
+ GL_PROXY_TEXTURE_3D_EXT
+ GL_PROXY_TEXTURE_CUBE_MAP
+ GL_PROXY_TEXTURE_CUBE_MAP_ARB
+ GL_PROXY_TEXTURE_CUBE_MAP_EXT
+ GL_PROXY_TEXTURE_RECTANGLE_NV
+ GL_Q
+ GL_QUADRATIC_ATTENUATION
+ GL_QUADS
+ GL_QUAD_STRIP
+ GL_R
+ GL_R3_G3_B2
+ GL_READ_BUFFER
+ GL_READ_ONLY_ARB
+ GL_READ_PIXEL_DATA_RANGE_LENGTH_NV
+ GL_READ_PIXEL_DATA_RANGE_NV
+ GL_READ_PIXEL_DATA_RANGE_POINTER_NV
+ GL_READ_WRITE_ARB
+ GL_RED
+ GL_REDUCE
+ GL_RED_BIAS
+ GL_RED_BITS
+ GL_RED_SCALE
+ GL_REFLECTION_MAP
+ GL_REFLECTION_MAP_ARB
+ GL_REFLECTION_MAP_EXT
+ GL_REFLECTION_MAP_NV
+ GL_REGISTER_COMBINERS_NV
+ GL_RENDER
+ GL_RENDERER
+ GL_RENDER_MODE
+ GL_REPEAT
+ GL_REPLACE
+ GL_REPLICATE_BORDER
+ GL_RESCALE_NORMAL
+ GL_RESCALE_NORMAL_EXT
+ GL_RETURN
+ GL_RGB
+ GL_RGB10
+ GL_RGB10_A2
+ GL_RGB12
+ GL_RGB16
+ GL_RGB4
+ GL_RGB4_S3TC
+ GL_RGB5
+ GL_RGB5_A1
+ GL_RGB8
+ GL_RGBA
+ GL_RGBA12
+ GL_RGBA16
+ GL_RGBA2
+ GL_RGBA4
+ GL_RGBA4_DXT5_S3TC
+ GL_RGBA4_S3TC
+ GL_RGBA8
+ GL_RGBA_DXT5_S3TC
+ GL_RGBA_MODE
+ GL_RGBA_S3TC
+ GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV
+ GL_RGB_S3TC
+ GL_RGB_SCALE
+ GL_RGB_SCALE_ARB
+ GL_RGB_SCALE_EXT
+ GL_RIGHT
+ GL_S
+ GL_SAMPLES
+ GL_SAMPLES_ARB
+ GL_SAMPLE_ALPHA_TO_COVERAGE
+ GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
+ GL_SAMPLE_ALPHA_TO_ONE
+ GL_SAMPLE_ALPHA_TO_ONE_ARB
+ GL_SAMPLE_BUFFERS
+ GL_SAMPLE_BUFFERS_ARB
+ GL_SAMPLE_COVERAGE
+ GL_SAMPLE_COVERAGE_ARB
+ GL_SAMPLE_COVERAGE_INVERT
+ GL_SAMPLE_COVERAGE_INVERT_ARB
+ GL_SAMPLE_COVERAGE_VALUE
+ GL_SAMPLE_COVERAGE_VALUE_ARB
+ GL_SCALE_BY_FOUR_NV
+ GL_SCALE_BY_ONE_HALF_NV
+ GL_SCALE_BY_TWO_NV
+ GL_SCISSOR_BIT
+ GL_SCISSOR_BOX
+ GL_SCISSOR_TEST
+ GL_SECONDARY_COLOR_ARRAY
+ GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
+ GL_SECONDARY_COLOR_ARRAY_EXT
+ GL_SECONDARY_COLOR_ARRAY_POINTER
+ GL_SECONDARY_COLOR_ARRAY_POINTER_EXT
+ GL_SECONDARY_COLOR_ARRAY_SIZE
+ GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
+ GL_SECONDARY_COLOR_ARRAY_STRIDE
+ GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
+ GL_SECONDARY_COLOR_ARRAY_TYPE
+ GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
+ GL_SECONDARY_COLOR_NV
+ GL_SELECT
+ GL_SELECTED_TEXTURE_SGIS
+ GL_SELECTION_BUFFER_POINTER
+ GL_SELECTION_BUFFER_SIZE
+ GL_SEPARABLE_2D
+ GL_SEPARATE_SPECULAR_COLOR
+ GL_SEPARATE_SPECULAR_COLOR_EXT
+ GL_SET
+ GL_SHADER_CONSISTENT_NV
+ GL_SHADER_OPERATION_NV
+ GL_SHADE_MODEL
+ GL_SHARED_TEXTURE_PALETTE_EXT
+ GL_SHININESS
+ GL_SHORT
+ GL_SIGNED_ALPHA8_NV
+ GL_SIGNED_ALPHA_NV
+ GL_SIGNED_HILO16_NV
+ GL_SIGNED_HILO8_NV
+ GL_SIGNED_HILO_NV
+ GL_SIGNED_IDENTITY_NV
+ GL_SIGNED_INTENSITY8_NV
+ GL_SIGNED_INTENSITY_NV
+ GL_SIGNED_LUMINANCE8_ALPHA8_NV
+ GL_SIGNED_LUMINANCE8_NV
+ GL_SIGNED_LUMINANCE_ALPHA_NV
+ GL_SIGNED_LUMINANCE_NV
+ GL_SIGNED_NEGATE_NV
+ GL_SIGNED_RGB8_NV
+ GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV
+ GL_SIGNED_RGBA8_NV
+ GL_SIGNED_RGBA_NV
+ GL_SIGNED_RGB_NV
+ GL_SIGNED_RGB_UNSIGNED_ALPHA_NV
+ GL_SINGLE_COLOR
+ GL_SINGLE_COLOR_EXT
+ GL_SMOOTH
+ GL_SMOOTH_LINE_WIDTH_GRANULARITY
+ GL_SMOOTH_LINE_WIDTH_RANGE
+ GL_SMOOTH_POINT_SIZE_GRANULARITY
+ GL_SMOOTH_POINT_SIZE_RANGE
+ GL_SOURCE0_ALPHA
+ GL_SOURCE0_ALPHA_ARB
+ GL_SOURCE0_ALPHA_EXT
+ GL_SOURCE0_RGB
+ GL_SOURCE0_RGB_ARB
+ GL_SOURCE0_RGB_EXT
+ GL_SOURCE1_ALPHA
+ GL_SOURCE1_ALPHA_ARB
+ GL_SOURCE1_ALPHA_EXT
+ GL_SOURCE1_RGB
+ GL_SOURCE1_RGB_ARB
+ GL_SOURCE1_RGB_EXT
+ GL_SOURCE2_ALPHA
+ GL_SOURCE2_ALPHA_ARB
+ GL_SOURCE2_ALPHA_EXT
+ GL_SOURCE2_RGB
+ GL_SOURCE2_RGB_ARB
+ GL_SOURCE2_RGB_EXT
+ GL_SOURCE3_ALPHA_NV
+ GL_SOURCE3_RGB_NV
+ GL_SPARE0_NV
+ GL_SPARE0_PLUS_SECONDARY_COLOR_NV
+ GL_SPARE1_NV
+ GL_SPECULAR
+ GL_SPHERE_MAP
+ GL_SPOT_CUTOFF
+ GL_SPOT_DIRECTION
+ GL_SPOT_EXPONENT
+ GL_SRC_ALPHA
+ GL_SRC_ALPHA_SATURATE
+ GL_SRC_COLOR
+ GL_STACK_OVERFLOW
+ GL_STACK_UNDERFLOW
+ GL_STATIC_COPY_ARB
+ GL_STATIC_DRAW_ARB
+ GL_STATIC_READ_ARB
+ GL_STENCIL
+ GL_STENCIL_BITS
+ GL_STENCIL_BUFFER_BIT
+ GL_STENCIL_CLEAR_VALUE
+ GL_STENCIL_FAIL
+ GL_STENCIL_FUNC
+ GL_STENCIL_INDEX
+ GL_STENCIL_PASS_DEPTH_FAIL
+ GL_STENCIL_PASS_DEPTH_PASS
+ GL_STENCIL_REF
+ GL_STENCIL_TEST
+ GL_STENCIL_TEST_TWO_SIDE_EXT
+ GL_STENCIL_VALUE_MASK
+ GL_STENCIL_WRITEMASK
+ GL_STEREO
+ GL_STREAM_COPY_ARB
+ GL_STREAM_DRAW_ARB
+ GL_STREAM_READ_ARB
+ GL_SUBPIXEL_BITS
+ GL_SUBTRACT
+ GL_SUBTRACT_ARB
+ GL_T
+ GL_T2F_C3F_V3F
+ GL_T2F_C4F_N3F_V3F
+ GL_T2F_C4UB_V3F
+ GL_T2F_N3F_V3F
+ GL_T2F_V3F
+ GL_T4F_C4F_N3F_V4F
+ GL_T4F_V4F
+ GL_TABLE_TOO_LARGE
+ GL_TABLE_TOO_LARGE_EXT
+ GL_TBUFFER_WRITE_MASK_3DFX
+ GL_TEXTURE
+ GL_TEXTURE0
+ GL_TEXTURE0_ARB
+ GL_TEXTURE0_SGIS
+ GL_TEXTURE1
+ GL_TEXTURE10
+ GL_TEXTURE10_ARB
+ GL_TEXTURE11
+ GL_TEXTURE11_ARB
+ GL_TEXTURE12
+ GL_TEXTURE12_ARB
+ GL_TEXTURE13
+ GL_TEXTURE13_ARB
+ GL_TEXTURE14
+ GL_TEXTURE14_ARB
+ GL_TEXTURE15
+ GL_TEXTURE15_ARB
+ GL_TEXTURE16
+ GL_TEXTURE16_ARB
+ GL_TEXTURE17
+ GL_TEXTURE17_ARB
+ GL_TEXTURE18
+ GL_TEXTURE18_ARB
+ GL_TEXTURE19
+ GL_TEXTURE19_ARB
+ GL_TEXTURE1_ARB
+ GL_TEXTURE1_SGIS
+ GL_TEXTURE2
+ GL_TEXTURE20
+ GL_TEXTURE20_ARB
+ GL_TEXTURE21
+ GL_TEXTURE21_ARB
+ GL_TEXTURE22
+ GL_TEXTURE22_ARB
+ GL_TEXTURE23
+ GL_TEXTURE23_ARB
+ GL_TEXTURE24
+ GL_TEXTURE24_ARB
+ GL_TEXTURE25
+ GL_TEXTURE25_ARB
+ GL_TEXTURE26
+ GL_TEXTURE26_ARB
+ GL_TEXTURE27
+ GL_TEXTURE27_ARB
+ GL_TEXTURE28
+ GL_TEXTURE28_ARB
+ GL_TEXTURE29
+ GL_TEXTURE29_ARB
+ GL_TEXTURE2_ARB
+ GL_TEXTURE2_SGIS
+ GL_TEXTURE3
+ GL_TEXTURE30
+ GL_TEXTURE30_ARB
+ GL_TEXTURE31
+ GL_TEXTURE31_ARB
+ GL_TEXTURE3_ARB
+ GL_TEXTURE3_SGIS
+ GL_TEXTURE4
+ GL_TEXTURE4_ARB
+ GL_TEXTURE5
+ GL_TEXTURE5_ARB
+ GL_TEXTURE6
+ GL_TEXTURE6_ARB
+ GL_TEXTURE7
+ GL_TEXTURE7_ARB
+ GL_TEXTURE8
+ GL_TEXTURE8_ARB
+ GL_TEXTURE9
+ GL_TEXTURE9_ARB
+ GL_TEXTURE_1D
+ GL_TEXTURE_2D
+ GL_TEXTURE_3D
+ GL_TEXTURE_3D_EXT
+ GL_TEXTURE_ALPHA_SIZE
+ GL_TEXTURE_BASE_LEVEL
+ GL_TEXTURE_BASE_LEVEL_SGIS
+ GL_TEXTURE_BINDING_1D
+ GL_TEXTURE_BINDING_2D
+ GL_TEXTURE_BINDING_3D
+ GL_TEXTURE_BINDING_CUBE_MAP
+ GL_TEXTURE_BINDING_CUBE_MAP_ARB
+ GL_TEXTURE_BINDING_CUBE_MAP_EXT
+ GL_TEXTURE_BINDING_RECTANGLE_NV
+ GL_TEXTURE_BIT
+ GL_TEXTURE_BLUE_SIZE
+ GL_TEXTURE_BORDER
+ GL_TEXTURE_BORDER_COLOR
+ GL_TEXTURE_BORDER_VALUES_NV
+ GL_TEXTURE_COLOR_WRITEMASK_SGIS
+ GL_TEXTURE_COMPARE_FAIL_VALUE_ARB
+ GL_TEXTURE_COMPARE_FUNC
+ GL_TEXTURE_COMPARE_FUNC_ARB
+ GL_TEXTURE_COMPARE_MODE
+ GL_TEXTURE_COMPARE_MODE_ARB
+ GL_TEXTURE_COMPARE_OPERATOR_SGIX
+ GL_TEXTURE_COMPARE_SGIX
+ GL_TEXTURE_COMPONENTS
+ GL_TEXTURE_COMPRESSED
+ GL_TEXTURE_COMPRESSED_ARB
+ GL_TEXTURE_COMPRESSED_IMAGE_SIZE
+ GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB
+ GL_TEXTURE_COMPRESSION_HINT
+ GL_TEXTURE_COMPRESSION_HINT_ARB
+ GL_TEXTURE_COORD_ARRAY
+ GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
+ GL_TEXTURE_COORD_ARRAY_COUNT_EXT
+ GL_TEXTURE_COORD_ARRAY_EXT
+ GL_TEXTURE_COORD_ARRAY_POINTER
+ GL_TEXTURE_COORD_ARRAY_POINTER_EXT
+ GL_TEXTURE_COORD_ARRAY_SIZE
+ GL_TEXTURE_COORD_ARRAY_SIZE_EXT
+ GL_TEXTURE_COORD_ARRAY_STRIDE
+ GL_TEXTURE_COORD_ARRAY_STRIDE_EXT
+ GL_TEXTURE_COORD_ARRAY_TYPE
+ GL_TEXTURE_COORD_ARRAY_TYPE_EXT
+ GL_TEXTURE_CUBE_MAP
+ GL_TEXTURE_CUBE_MAP_ARB
+ GL_TEXTURE_CUBE_MAP_EXT
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
+ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB
+ GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT
+ GL_TEXTURE_DEPTH
+ GL_TEXTURE_DEPTH_EXT
+ GL_TEXTURE_DEPTH_SIZE
+ GL_TEXTURE_DEPTH_SIZE_ARB
+ GL_TEXTURE_DS_SIZE_NV
+ GL_TEXTURE_DT_SIZE_NV
+ GL_TEXTURE_ENV
+ GL_TEXTURE_ENV_COLOR
+ GL_TEXTURE_ENV_MODE
+ GL_TEXTURE_FILTER_CONTROL
+ GL_TEXTURE_FILTER_CONTROL_EXT
+ GL_TEXTURE_FLOAT_COMPONENTS_NV
+ GL_TEXTURE_GEN_MODE
+ GL_TEXTURE_GEN_Q
+ GL_TEXTURE_GEN_R
+ GL_TEXTURE_GEN_S
+ GL_TEXTURE_GEN_T
+ GL_TEXTURE_GEQUAL_R_SGIX
+ GL_TEXTURE_GREEN_SIZE
+ GL_TEXTURE_HEIGHT
+ GL_TEXTURE_HI_SIZE_NV
+ GL_TEXTURE_INDEX_SIZE_EXT
+ GL_TEXTURE_INTENSITY_SIZE
+ GL_TEXTURE_INTERNAL_FORMAT
+ GL_TEXTURE_LEQUAL_R_SGIX
+ GL_TEXTURE_LOD_BIAS
+ GL_TEXTURE_LOD_BIAS_EXT
+ GL_TEXTURE_LO_SIZE_NV
+ GL_TEXTURE_LUMINANCE_SIZE
+ GL_TEXTURE_MAG_FILTER
+ GL_TEXTURE_MAG_SIZE_NV
+ GL_TEXTURE_MATRIX
+ GL_TEXTURE_MAX_ANISOTROPY_EXT
+ GL_TEXTURE_MAX_LEVEL
+ GL_TEXTURE_MAX_LEVEL_SGIS
+ GL_TEXTURE_MAX_LOD
+ GL_TEXTURE_MAX_LOD_SGIS
+ GL_TEXTURE_MIN_FILTER
+ GL_TEXTURE_MIN_LOD
+ GL_TEXTURE_MIN_LOD_SGIS
+ GL_TEXTURE_PRIORITY
+ GL_TEXTURE_RECTANGLE_NV
+ GL_TEXTURE_RED_SIZE
+ GL_TEXTURE_RESIDENT
+ GL_TEXTURE_SHADER_NV
+ GL_TEXTURE_STACK_DEPTH
+ GL_TEXTURE_UNSIGNED_REMAP_MODE_NV
+ GL_TEXTURE_WIDTH
+ GL_TEXTURE_WRAP_R
+ GL_TEXTURE_WRAP_R_EXT
+ GL_TEXTURE_WRAP_S
+ GL_TEXTURE_WRAP_T
+ GL_TRACK_MATRIX_NV
+ GL_TRACK_MATRIX_TRANSFORM_NV
+ GL_TRANSFORM_BIT
+ GL_TRANSFORM_HINT_APPLE
+ GL_TRANSPOSE_COLOR_MATRIX
+ GL_TRANSPOSE_COLOR_MATRIX_ARB
+ GL_TRANSPOSE_CURRENT_MATRIX_ARB
+ GL_TRANSPOSE_MODELVIEW_MATRIX
+ GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
+ GL_TRANSPOSE_NV
+ GL_TRANSPOSE_PROJECTION_MATRIX
+ GL_TRANSPOSE_PROJECTION_MATRIX_ARB
+ GL_TRANSPOSE_TEXTURE_MATRIX
+ GL_TRANSPOSE_TEXTURE_MATRIX_ARB
+ GL_TRIANGLES
+ GL_TRIANGLE_FAN
+ GL_TRIANGLE_STRIP
+ GL_TRUE
+ GL_UNPACK_ALIGNMENT
+ GL_UNPACK_IMAGE_HEIGHT
+ GL_UNPACK_IMAGE_HEIGHT_EXT
+ GL_UNPACK_LSB_FIRST
+ GL_UNPACK_ROW_LENGTH
+ GL_UNPACK_SKIP_IMAGES
+ GL_UNPACK_SKIP_IMAGES_EXT
+ GL_UNPACK_SKIP_PIXELS
+ GL_UNPACK_SKIP_ROWS
+ GL_UNPACK_SWAP_BYTES
+ GL_UNSIGNED_BYTE
+ GL_UNSIGNED_BYTE_2_3_3_REV
+ GL_UNSIGNED_BYTE_3_3_2
+ GL_UNSIGNED_BYTE_3_3_2_EXT
+ GL_UNSIGNED_IDENTITY_NV
+ GL_UNSIGNED_INT
+ GL_UNSIGNED_INT_10_10_10_2
+ GL_UNSIGNED_INT_10_10_10_2_EXT
+ GL_UNSIGNED_INT_24_8_NV
+ GL_UNSIGNED_INT_2_10_10_10_REV
+ GL_UNSIGNED_INT_8_8_8_8
+ GL_UNSIGNED_INT_8_8_8_8_EXT
+ GL_UNSIGNED_INT_8_8_8_8_REV
+ GL_UNSIGNED_INT_8_8_S8_S8_REV_NV
+ GL_UNSIGNED_INT_S10_S11_S11_REV_NV
+ GL_UNSIGNED_INT_S8_S8_8_8_NV
+ GL_UNSIGNED_INVERT_NV
+ GL_UNSIGNED_SHORT
+ GL_UNSIGNED_SHORT_1_5_5_5_REV
+ GL_UNSIGNED_SHORT_4_4_4_4
+ GL_UNSIGNED_SHORT_4_4_4_4_EXT
+ GL_UNSIGNED_SHORT_4_4_4_4_REV
+ GL_UNSIGNED_SHORT_5_5_5_1
+ GL_UNSIGNED_SHORT_5_5_5_1_EXT
+ GL_UNSIGNED_SHORT_5_6_5
+ GL_UNSIGNED_SHORT_5_6_5_REV
+ GL_V2F
+ GL_V3F
+ GL_VARIABLE_A_NV
+ GL_VARIABLE_B_NV
+ GL_VARIABLE_C_NV
+ GL_VARIABLE_D_NV
+ GL_VARIABLE_E_NV
+ GL_VARIABLE_F_NV
+ GL_VARIABLE_G_NV
+ GL_VENDOR
+ GL_VERSION
+ GL_VERTEX_ARRAY
+ GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
+ GL_VERTEX_ARRAY_COUNT_EXT
+ GL_VERTEX_ARRAY_EXT
+ GL_VERTEX_ARRAY_POINTER
+ GL_VERTEX_ARRAY_POINTER_EXT
+ GL_VERTEX_ARRAY_RANGE_LENGTH_NV
+ GL_VERTEX_ARRAY_RANGE_NV
+ GL_VERTEX_ARRAY_RANGE_POINTER_NV
+ GL_VERTEX_ARRAY_RANGE_VALID_NV
+ GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV
+ GL_VERTEX_ARRAY_SIZE
+ GL_VERTEX_ARRAY_SIZE_EXT
+ GL_VERTEX_ARRAY_STRIDE
+ GL_VERTEX_ARRAY_STRIDE_EXT
+ GL_VERTEX_ARRAY_TYPE
+ GL_VERTEX_ARRAY_TYPE_EXT
+ GL_VERTEX_ATTRIB_ARRAY0_NV
+ GL_VERTEX_ATTRIB_ARRAY10_NV
+ GL_VERTEX_ATTRIB_ARRAY11_NV
+ GL_VERTEX_ATTRIB_ARRAY12_NV
+ GL_VERTEX_ATTRIB_ARRAY13_NV
+ GL_VERTEX_ATTRIB_ARRAY14_NV
+ GL_VERTEX_ATTRIB_ARRAY15_NV
+ GL_VERTEX_ATTRIB_ARRAY1_NV
+ GL_VERTEX_ATTRIB_ARRAY2_NV
+ GL_VERTEX_ATTRIB_ARRAY3_NV
+ GL_VERTEX_ATTRIB_ARRAY4_NV
+ GL_VERTEX_ATTRIB_ARRAY5_NV
+ GL_VERTEX_ATTRIB_ARRAY6_NV
+ GL_VERTEX_ATTRIB_ARRAY7_NV
+ GL_VERTEX_ATTRIB_ARRAY8_NV
+ GL_VERTEX_ATTRIB_ARRAY9_NV
+ GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB
+ GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB
+ GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB
+ GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB
+ GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB
+ GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB
+ GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB
+ GL_VERTEX_PROGRAM_ARB
+ GL_VERTEX_PROGRAM_BINDING_NV
+ GL_VERTEX_PROGRAM_NV
+ GL_VERTEX_PROGRAM_POINT_SIZE_ARB
+ GL_VERTEX_PROGRAM_POINT_SIZE_NV
+ GL_VERTEX_PROGRAM_TWO_SIDE_ARB
+ GL_VERTEX_PROGRAM_TWO_SIDE_NV
+ GL_VERTEX_STATE_PROGRAM_NV
+ GL_VERTEX_WEIGHTING_EXT
+ GL_VERTEX_WEIGHT_ARRAY_EXT
+ GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT
+ GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT
+ GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT
+ GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT
+ GL_VIBRANCE_BIAS_NV
+ GL_VIBRANCE_SCALE_NV
+ GL_VIEWPORT
+ GL_VIEWPORT_BIT
+ GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB
+ GL_WRITE_ONLY_ARB
+ GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV
+ GL_WRITE_PIXEL_DATA_RANGE_NV
+ GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV
+ GL_XOR
+ GL_YCRYCB_422_NVX
+ GL_ZERO
+ GL_ZOOM_X
+ GL_ZOOM_Y
+);
+
+__DATA__
+sub GLU_AUTO_LOAD_MATRIX {100200}
+sub GLU_CULLING {100201}
+sub GLU_DISPLAY_MODE {100204}
+sub GLU_DOMAIN_DISTANCE {100217}
+sub GLU_FILL {100012}
+sub GLU_MAP1_TRIM_2 {100210}
+sub GLU_MAP1_TRIM_3 {100211}
+sub GLU_NURBS_BEGIN {100164}
+sub GLU_NURBS_BEGIN_DATA {100170}
+sub GLU_NURBS_COLOR {100167}
+sub GLU_NURBS_COLOR_DATA {100173}
+sub GLU_NURBS_END {100169}
+sub GLU_NURBS_END_DATA {100175}
+sub GLU_NURBS_ERROR {100103}
+sub GLU_NURBS_MODE {100160}
+sub GLU_NURBS_NORMAL {100166}
+sub GLU_NURBS_NORMAL_DATA {100172}
+sub GLU_NURBS_RENDERER {100162}
+sub GLU_NURBS_TESSELLATOR {100161}
+sub GLU_NURBS_TEXTURE_COORD {100168}
+sub GLU_NURBS_TEXTURE_COORD_DATA {100174}
+sub GLU_NURBS_VERTEX {100165}
+sub GLU_NURBS_VERTEX_DATA {100171}
+sub GLU_OBJECT_PARAMETRIC_ERROR {100208}
+sub GLU_OBJECT_PATH_LENGTH {100209}
+sub GLU_OUTLINE_PATCH {100241}
+sub GLU_OUTLINE_POLYGON {100240}
+sub GLU_PARAMETRIC_TOLERANCE {100202}
+sub GLU_PATH_LENGTH {100215}
+sub GLU_SAMPLING_METHOD {100205}
+sub GLU_SAMPLING_TOLERANCE {100203}
+sub GLU_TESS_BOUNDARY_ONLY {100141}
+sub GLU_TESS_TOLERANCE {100142}
+sub GLU_TESS_WINDING_ABS_GEQ_TWO {100134}
+sub GLU_TESS_WINDING_NEGATIVE {100133}
+sub GLU_TESS_WINDING_NONZERO {100131}
+sub GLU_TESS_WINDING_ODD {100130}
+sub GLU_TESS_WINDING_POSITIVE {100132}
+sub GLU_TESS_WINDING_RULE {100140}
+sub GLU_U_STEP {100206}
+sub GLU_V_STEP {100207}
+sub GL_2D {0x0600}
+sub GL_2_BYTES {0x1407}
+sub GL_3D {0x0601}
+sub GL_3D_COLOR {0x0602}
+sub GL_3D_COLOR_TEXTURE {0x0603}
+sub GL_3_BYTES {0x1408}
+sub GL_4D_COLOR_TEXTURE {0x0604}
+sub GL_4_BYTES {0x1409}
+sub GL_ABGR_EXT {0x8000}
+sub GL_ACCUM {0x0100}
+sub GL_ACCUM_ALPHA_BITS {0x0D5B}
+sub GL_ACCUM_BLUE_BITS {0x0D5A}
+sub GL_ACCUM_BUFFER_BIT {0x00000200}
+sub GL_ACCUM_CLEAR_VALUE {0x0B80}
+sub GL_ACCUM_GREEN_BITS {0x0D59}
+sub GL_ACCUM_RED_BITS {0x0D58}
+sub GL_ACTIVE_STENCIL_FACE_EXT {0x8911}
+sub GL_ACTIVE_TEXTURE {0x84E0}
+sub GL_ACTIVE_TEXTURE_ARB {0x84E0}
+sub GL_ADD {0x0104}
+sub GL_ADD_SIGNED {0x8574}
+sub GL_ADD_SIGNED_ARB {0x8574}
+sub GL_ADD_SIGNED_EXT {0x8574}
+sub GL_ALIASED_LINE_WIDTH_RANGE {0x846E}
+sub GL_ALIASED_POINT_SIZE_RANGE {0x846D}
+sub GL_ALL_ATTRIB_BITS {0xFFFFFFFF}
+sub GL_ALL_COMPLETED_NV {0x84F2}
+sub GL_ALL_EXTENSIONS_NV {0x84FB}
+sub GL_ALPHA {0x1906}
+sub GL_ALPHA12 {0x803D}
+sub GL_ALPHA16 {0x803E}
+sub GL_ALPHA4 {0x803B}
+sub GL_ALPHA8 {0x803C}
+sub GL_ALPHA_BIAS {0x0D1D}
+sub GL_ALPHA_BITS {0x0D55}
+sub GL_ALPHA_SCALE {0x0D1C}
+sub GL_ALPHA_TEST {0x0BC0}
+sub GL_ALPHA_TEST_FUNC {0x0BC1}
+sub GL_ALPHA_TEST_REF {0x0BC2}
+sub GL_ALWAYS {0x0207}
+sub GL_AMBIENT {0x1200}
+sub GL_AMBIENT_AND_DIFFUSE {0x1602}
+sub GL_AND {0x1501}
+sub GL_AND_INVERTED {0x1504}
+sub GL_AND_REVERSE {0x1502}
+sub GL_ARRAY_BUFFER_ARB {0x8892}
+sub GL_ARRAY_BUFFER_BINDING_ARB {0x8894}
+sub GL_ARRAY_ELEMENT_LOCK_COUNT_EXT {0x81A9}
+sub GL_ARRAY_ELEMENT_LOCK_FIRST_EXT {0x81A8}
+sub GL_ATTRIB_ARRAY_POINTER_NV {0x8645}
+sub GL_ATTRIB_ARRAY_SIZE_NV {0x8623}
+sub GL_ATTRIB_ARRAY_STRIDE_NV {0x8624}
+sub GL_ATTRIB_ARRAY_TYPE_NV {0x8625}
+sub GL_ATTRIB_STACK_DEPTH {0x0BB0}
+sub GL_AUTO_NORMAL {0x0D80}
+sub GL_AUX0 {0x0409}
+sub GL_AUX1 {0x040A}
+sub GL_AUX2 {0x040B}
+sub GL_AUX3 {0x040C}
+sub GL_AUX_BUFFERS {0x0C00}
+sub GL_BACK {0x0405}
+sub GL_BACK_LEFT {0x0402}
+sub GL_BACK_RIGHT {0x0403}
+sub GL_BGR {0x80E0}
+sub GL_BGRA {0x80E1}
+sub GL_BGRA_EXT {0x80E1}
+sub GL_BGR_EXT {0x80E0}
+sub GL_BIAS_BY_NEGATIVE_ONE_HALF_NV {0x8541}
+sub GL_BITMAP {0x1A00}
+sub GL_BITMAP_TOKEN {0x0704}
+sub GL_BLEND {0x0BE2}
+sub GL_BLEND_COLOR {0x8005}
+sub GL_BLEND_COLOR_EXT {0x8005}
+sub GL_BLEND_DST {0x0BE0}
+sub GL_BLEND_DST_ALPHA {0x80CA}
+sub GL_BLEND_DST_ALPHA_EXT {0x80CA}
+sub GL_BLEND_DST_RGB {0x80C8}
+sub GL_BLEND_DST_RGB_EXT {0x80C8}
+sub GL_BLEND_EQUATION {0x8009}
+sub GL_BLEND_EQUATION_EXT {0x8009}
+sub GL_BLEND_SRC {0x0BE1}
+sub GL_BLEND_SRC_ALPHA {0x80CB}
+sub GL_BLEND_SRC_ALPHA_EXT {0x80CB}
+sub GL_BLEND_SRC_RGB {0x80C9}
+sub GL_BLEND_SRC_RGB_EXT {0x80C9}
+sub GL_BLUE {0x1905}
+sub GL_BLUE_BIAS {0x0D1B}
+sub GL_BLUE_BITS {0x0D54}
+sub GL_BLUE_SCALE {0x0D1A}
+sub GL_BUFFER_ACCESS_ARB {0x88BB}
+sub GL_BUFFER_MAPPED_ARB {0x88BC}
+sub GL_BUFFER_MAP_POINTER_ARB {0x88BD}
+sub GL_BUFFER_SIZE_ARB {0x8764}
+sub GL_BUFFER_USAGE_ARB {0x8765}
+sub GL_BYTE {0x1400}
+sub GL_C3F_V3F {0x2A24}
+sub GL_C4F_N3F_V3F {0x2A26}
+sub GL_C4UB_V2F {0x2A22}
+sub GL_C4UB_V3F {0x2A23}
+sub GL_CCW {0x0901}
+sub GL_CLAMP {0x2900}
+sub GL_CLAMP_TO_BORDER {0x812D}
+sub GL_CLAMP_TO_BORDER_ARB {0x812D}
+sub GL_CLAMP_TO_EDGE {0x812F}
+sub GL_CLAMP_TO_EDGE_EXT {0x812F}
+sub GL_CLEAR {0x1500}
+sub GL_CLIENT_ACTIVE_TEXTURE {0x84E1}
+sub GL_CLIENT_ACTIVE_TEXTURE_ARB {0x84E1}
+sub GL_CLIENT_ALL_ATTRIB_BITS {0xFFFFFFFF}
+sub GL_ALL_CLIENT_ATTRIB_BITS {0xFFFFFFFF}
+sub GL_CLIENT_ATTRIB_STACK_DEPTH {0x0BB1}
+sub GL_CLIENT_PIXEL_STORE_BIT {0x00000001}
+sub GL_CLIENT_VERTEX_ARRAY_BIT {0x00000002}
+sub GL_CLIP_PLANE0 {0x3000}
+sub GL_CLIP_PLANE1 {0x3001}
+sub GL_CLIP_PLANE2 {0x3002}
+sub GL_CLIP_PLANE3 {0x3003}
+sub GL_CLIP_PLANE4 {0x3004}
+sub GL_CLIP_PLANE5 {0x3005}
+sub GL_CLIP_VOLUME_CLIPPING_HINT_EXT {0x80F0}
+sub GL_COEFF {0x0A00}
+sub GL_COLOR {0x1800}
+sub GL_COLOR_ARRAY {0x8076}
+sub GL_COLOR_ARRAY_BUFFER_BINDING_ARB {0x8898}
+sub GL_COLOR_ARRAY_COUNT_EXT {0x8084}
+sub GL_COLOR_ARRAY_EXT {0x8076}
+sub GL_COLOR_ARRAY_POINTER {0x8090}
+sub GL_COLOR_ARRAY_POINTER_EXT {0x8090}
+sub GL_COLOR_ARRAY_SIZE {0x8081}
+sub GL_COLOR_ARRAY_SIZE_EXT {0x8081}
+sub GL_COLOR_ARRAY_STRIDE {0x8083}
+sub GL_COLOR_ARRAY_STRIDE_EXT {0x8083}
+sub GL_COLOR_ARRAY_TYPE {0x8082}
+sub GL_COLOR_ARRAY_TYPE_EXT {0x8082}
+sub GL_COLOR_BUFFER_BIT {0x00004000}
+sub GL_COLOR_CLEAR_VALUE {0x0C22}
+sub GL_COLOR_INDEX {0x1900}
+sub GL_COLOR_INDEX12_EXT {0x80E6}
+sub GL_COLOR_INDEX16_EXT {0x80E7}
+sub GL_COLOR_INDEX1_EXT {0x80E2}
+sub GL_COLOR_INDEX2_EXT {0x80E3}
+sub GL_COLOR_INDEX4_EXT {0x80E4}
+sub GL_COLOR_INDEX8_EXT {0x80E5}
+sub GL_COLOR_INDEXES {0x1603}
+sub GL_COLOR_LOGIC_OP {0x0BF2}
+sub GL_COLOR_MATERIAL {0x0B57}
+sub GL_COLOR_MATERIAL_FACE {0x0B55}
+sub GL_COLOR_MATERIAL_PARAMETER {0x0B56}
+sub GL_COLOR_MATRIX {0x80B1}
+sub GL_COLOR_MATRIX_STACK_DEPTH {0x80B2}
+sub GL_COLOR_SUM {0x8458}
+sub GL_COLOR_SUM_ARB {0x8458}
+sub GL_COLOR_SUM_CLAMP_NV {0x854F}
+sub GL_COLOR_SUM_EXT {0x8458}
+sub GL_COLOR_TABLE {0x80D0}
+sub GL_COLOR_TABLE_ALPHA_SIZE {0x80DD}
+sub GL_COLOR_TABLE_ALPHA_SIZE_EXT {0x80DD}
+sub GL_COLOR_TABLE_BIAS {0x80D7}
+sub GL_COLOR_TABLE_BLUE_SIZE {0x80DC}
+sub GL_COLOR_TABLE_BLUE_SIZE_EXT {0x80DC}
+sub GL_COLOR_TABLE_FORMAT {0x80D8}
+sub GL_COLOR_TABLE_FORMAT_EXT {0x80D8}
+sub GL_COLOR_TABLE_GREEN_SIZE {0x80DB}
+sub GL_COLOR_TABLE_GREEN_SIZE_EXT {0x80DB}
+sub GL_COLOR_TABLE_INTENSITY_SIZE {0x80DF}
+sub GL_COLOR_TABLE_INTENSITY_SIZE_EXT {0x80DF}
+sub GL_COLOR_TABLE_LUMINANCE_SIZE {0x80DE}
+sub GL_COLOR_TABLE_LUMINANCE_SIZE_EXT {0x80DE}
+sub GL_COLOR_TABLE_RED_SIZE {0x80DA}
+sub GL_COLOR_TABLE_RED_SIZE_EXT {0x80DA}
+sub GL_COLOR_TABLE_SCALE {0x80D6}
+sub GL_COLOR_TABLE_WIDTH {0x80D9}
+sub GL_COLOR_TABLE_WIDTH_EXT {0x80D9}
+sub GL_COLOR_WRITEMASK {0x0C23}
+sub GL_COMBINE {0x8570}
+sub GL_COMBINE4_NV {0x8503}
+sub GL_COMBINER0_NV {0x8550}
+sub GL_COMBINER1_NV {0x8551}
+sub GL_COMBINER2_NV {0x8552}
+sub GL_COMBINER3_NV {0x8553}
+sub GL_COMBINER4_NV {0x8554}
+sub GL_COMBINER5_NV {0x8555}
+sub GL_COMBINER6_NV {0x8556}
+sub GL_COMBINER7_NV {0x8557}
+sub GL_COMBINER_AB_DOT_PRODUCT_NV {0x8545}
+sub GL_COMBINER_AB_OUTPUT_NV {0x854A}
+sub GL_COMBINER_BIAS_NV {0x8549}
+sub GL_COMBINER_CD_DOT_PRODUCT_NV {0x8546}
+sub GL_COMBINER_CD_OUTPUT_NV {0x854B}
+sub GL_COMBINER_COMPONENT_USAGE_NV {0x8544}
+sub GL_COMBINER_INPUT_NV {0x8542}
+sub GL_COMBINER_MAPPING_NV {0x8543}
+sub GL_COMBINER_MUX_SUM_NV {0x8547}
+sub GL_COMBINER_SCALE_NV {0x8548}
+sub GL_COMBINER_SUM_OUTPUT_NV {0x854C}
+sub GL_COMBINE_ALPHA {0x8572}
+sub GL_COMBINE_ALPHA_ARB {0x8572}
+sub GL_COMBINE_ALPHA_EXT {0x8572}
+sub GL_COMBINE_ARB {0x8570}
+sub GL_COMBINE_EXT {0x8570}
+sub GL_COMBINE_RGB {0x8571}
+sub GL_COMBINE_RGB_ARB {0x8571}
+sub GL_COMBINE_RGB_EXT {0x8571}
+sub GL_COMPARE_R_TO_TEXTURE {0x884E}
+sub GL_COMPARE_R_TO_TEXTURE_ARB {0x884E}
+sub GL_COMPILE {0x1300}
+sub GL_COMPILE_AND_EXECUTE {0x1301}
+sub GL_COMPRESSED_ALPHA {0x84E9}
+sub GL_COMPRESSED_ALPHA_ARB {0x84E9}
+sub GL_COMPRESSED_INTENSITY {0x84EC}
+sub GL_COMPRESSED_INTENSITY_ARB {0x84EC}
+sub GL_COMPRESSED_LUMINANCE {0x84EA}
+sub GL_COMPRESSED_LUMINANCE_ALPHA {0x84EB}
+sub GL_COMPRESSED_LUMINANCE_ALPHA_ARB {0x84EB}
+sub GL_COMPRESSED_LUMINANCE_ARB {0x84EA}
+sub GL_COMPRESSED_RGB {0x84ED}
+sub GL_COMPRESSED_RGBA {0x84EE}
+sub GL_COMPRESSED_RGBA_ARB {0x84EE}
+sub GL_COMPRESSED_RGBA_S3TC_DXT1_EXT {0x83F1}
+sub GL_COMPRESSED_RGBA_S3TC_DXT3_EXT {0x83F2}
+sub GL_COMPRESSED_RGBA_S3TC_DXT5_EXT {0x83F3}
+sub GL_COMPRESSED_RGB_ARB {0x84ED}
+sub GL_COMPRESSED_RGB_S3TC_DXT1_EXT {0x83F0}
+sub GL_COMPRESSED_TEXTURE_FORMATS {0x86A3}
+sub GL_COMPRESSED_TEXTURE_FORMATS_ARB {0x86A3}
+sub GL_CONSTANT {0x8576}
+sub GL_CONSTANT_ALPHA {0x8003}
+sub GL_CONSTANT_ALPHA_EXT {0x8003}
+sub GL_CONSTANT_ARB {0x8576}
+sub GL_CONSTANT_ATTENUATION {0x1207}
+sub GL_CONSTANT_BORDER {0x8151}
+sub GL_CONSTANT_COLOR {0x8001}
+sub GL_CONSTANT_COLOR0_NV {0x852A}
+sub GL_CONSTANT_COLOR1_NV {0x852B}
+sub GL_CONSTANT_COLOR_EXT {0x8001}
+sub GL_CONSTANT_EXT {0x8576}
+sub GL_CONST_EYE_NV {0x86E5}
+sub GL_CONVOLUTION_1D {0x8010}
+sub GL_CONVOLUTION_2D {0x8011}
+sub GL_CONVOLUTION_BORDER_COLOR {0x8154}
+sub GL_CONVOLUTION_BORDER_MODE {0x8013}
+sub GL_CONVOLUTION_FILTER_BIAS {0x8015}
+sub GL_CONVOLUTION_FILTER_SCALE {0x8014}
+sub GL_CONVOLUTION_FORMAT {0x8017}
+sub GL_CONVOLUTION_HEIGHT {0x8019}
+sub GL_CONVOLUTION_WIDTH {0x8018}
+sub GL_COORD_REPLACE_NV {0x8862}
+sub GL_COPY {0x1503}
+sub GL_COPY_INVERTED {0x150C}
+sub GL_COPY_PIXEL_TOKEN {0x0706}
+sub GL_CRYCBY_422_NVX {0x600A}
+sub GL_CULL_FACE {0x0B44}
+sub GL_CULL_FACE_MODE {0x0B45}
+sub GL_CULL_FRAGMENT_NV {0x86E7}
+sub GL_CULL_MODES_NV {0x86E0}
+sub GL_CURRENT_ATTRIB_NV {0x8626}
+sub GL_CURRENT_BIT {0x00000001}
+sub GL_CURRENT_COLOR {0x0B00}
+sub GL_CURRENT_FLUSHHOLD_NVX {0x6008}
+sub GL_CURRENT_FOG_COORDINATE {0x8453}
+sub GL_CURRENT_FOG_COORDINATE_EXT {0x8453}
+sub GL_CURRENT_INDEX {0x0B01}
+sub GL_CURRENT_MATRIX_ARB {0x8641}
+sub GL_CURRENT_MATRIX_NV {0x8641}
+sub GL_CURRENT_MATRIX_STACK_DEPTH_ARB {0x8640}
+sub GL_CURRENT_MATRIX_STACK_DEPTH_NV {0x8640}
+sub GL_CURRENT_NORMAL {0x0B02}
+sub GL_CURRENT_OCCLUSION_QUERY_ID_NV {0x8865}
+sub GL_CURRENT_RASTER_COLOR {0x0B04}
+sub GL_CURRENT_RASTER_DISTANCE {0x0B09}
+sub GL_CURRENT_RASTER_INDEX {0x0B05}
+sub GL_CURRENT_RASTER_POSITION {0x0B07}
+sub GL_CURRENT_RASTER_POSITION_VALID {0x0B08}
+sub GL_CURRENT_RASTER_TEXTURE_COORDS {0x0B06}
+sub GL_CURRENT_SECONDARY_COLOR {0x8459}
+sub GL_CURRENT_SECONDARY_COLOR_EXT {0x8459}
+sub GL_CURRENT_TEXTURE_COORDS {0x0B03}
+sub GL_CURRENT_VERTEX_ATTRIB_ARB {0x8626}
+sub GL_CURRENT_VERTEX_WEIGHT_EXT {0x850B}
+sub GL_CW {0x0900}
+sub GL_DECAL {0x2101}
+sub GL_DECR {0x1E03}
+sub GL_DECR_WRAP {0x8508}
+sub GL_DECR_WRAP_EXT {0x8508}
+sub GL_DEPENDENT_AR_TEXTURE_2D_NV {0x86E9}
+sub GL_DEPENDENT_GB_TEXTURE_2D_NV {0x86EA}
+sub GL_DEPENDENT_HILO_TEXTURE_2D_NV {0x8858}
+sub GL_DEPENDENT_RGB_TEXTURE_3D_NV {0x8859}
+sub GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV {0x885A}
+sub GL_DEPTH {0x1801}
+sub GL_DEPTH_BIAS {0x0D1F}
+sub GL_DEPTH_BITS {0x0D56}
+sub GL_DEPTH_BOUNDS_NV {0x8891}
+sub GL_DEPTH_BOUNDS_TEST_NV {0x8890}
+sub GL_DEPTH_BUFFER_BIT {0x00000100}
+sub GL_DEPTH_CLAMP_NV {0x864F}
+sub GL_DEPTH_CLEAR_VALUE {0x0B73}
+sub GL_DEPTH_COMPONENT {0x1902}
+sub GL_DEPTH_COMPONENT16 {0x81A5}
+sub GL_DEPTH_COMPONENT16_ARB {0x81A5}
+sub GL_DEPTH_COMPONENT16_SGIX {0x81A5}
+sub GL_DEPTH_COMPONENT24 {0x81A6}
+sub GL_DEPTH_COMPONENT24_ARB {0x81A6}
+sub GL_DEPTH_COMPONENT24_SGIX {0x81A6}
+sub GL_DEPTH_COMPONENT32 {0x81A7}
+sub GL_DEPTH_COMPONENT32_ARB {0x81A7}
+sub GL_DEPTH_COMPONENT32_SGIX {0x81A7}
+sub GL_DEPTH_FUNC {0x0B74}
+sub GL_DEPTH_RANGE {0x0B70}
+sub GL_DEPTH_SCALE {0x0D1E}
+sub GL_DEPTH_STENCIL_NV {0x84F9}
+sub GL_DEPTH_STENCIL_TO_BGRA_NV {0x886F}
+sub GL_DEPTH_STENCIL_TO_RGBA_NV {0x886E}
+sub GL_DEPTH_TEST {0x0B71}
+sub GL_DEPTH_TEXTURE_MODE {0x884B}
+sub GL_DEPTH_TEXTURE_MODE_ARB {0x884B}
+sub GL_DEPTH_WRITEMASK {0x0B72}
+sub GL_DIFFUSE {0x1201}
+sub GL_DISCARD_NV {0x8530}
+sub GL_DISTANCE_ATTENUATION_EXT {0x8129}
+sub GL_DITHER {0x0BD0}
+sub GL_DOMAIN {0x0A02}
+sub GL_DONT_CARE {0x1100}
+sub GL_DOT3_RGB {0x86AE}
+sub GL_DOT3_RGBA {0x86AF}
+sub GL_DOT3_RGBA_ARB {0x86AF}
+sub GL_DOT3_RGBA_EXT {0x8741}
+sub GL_DOT3_RGB_ARB {0x86AE}
+sub GL_DOT3_RGB_EXT {0x8740}
+sub GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV {0x885D}
+sub GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV {0x86F3}
+sub GL_DOT_PRODUCT_DEPTH_REPLACE_NV {0x86ED}
+sub GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV {0x86F1}
+sub GL_DOT_PRODUCT_NV {0x86EC}
+sub GL_DOT_PRODUCT_PASS_THROUGH_NV {0x885B}
+sub GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV {0x86F2}
+sub GL_DOT_PRODUCT_TEXTURE_1D_NV {0x885C}
+sub GL_DOT_PRODUCT_TEXTURE_2D_NV {0x86EE}
+sub GL_DOT_PRODUCT_TEXTURE_3D_NV {0x86EF}
+sub GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV {0x86F0}
+sub GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV {0x864E}
+sub GL_DOUBLE {0x140A}
+sub GL_DOUBLEBUFFER {0x0C32}
+sub GL_DOUBLE_EXT {0x140A}
+sub GL_DRAW_BUFFER {0x0C01}
+sub GL_DRAW_PIXEL_TOKEN {0x0705}
+sub GL_DSDT8_MAG8_INTENSITY8_NV {0x870B}
+sub GL_DSDT8_MAG8_NV {0x870A}
+sub GL_DSDT8_NV {0x8709}
+sub GL_DSDT_MAG_INTENSITY_NV {0x86DC}
+sub GL_DSDT_MAG_NV {0x86F6}
+sub GL_DSDT_MAG_VIB_NV {0x86F7}
+sub GL_DSDT_NV {0x86F5}
+sub GL_DST_ALPHA {0x0304}
+sub GL_DST_COLOR {0x0306}
+sub GL_DS_BIAS_NV {0x8716}
+sub GL_DS_SCALE_NV {0x8710}
+sub GL_DT_BIAS_NV {0x8717}
+sub GL_DT_SCALE_NV {0x8711}
+sub GL_DYNAMIC_COPY_ARB {0x88EA}
+sub GL_DYNAMIC_DRAW_ARB {0x88E8}
+sub GL_DYNAMIC_READ_ARB {0x88E9}
+sub GL_EDGE_FLAG {0x0B43}
+sub GL_EDGE_FLAG_ARRAY {0x8079}
+sub GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB {0x889B}
+sub GL_EDGE_FLAG_ARRAY_COUNT_EXT {0x808D}
+sub GL_EDGE_FLAG_ARRAY_EXT {0x8079}
+sub GL_EDGE_FLAG_ARRAY_POINTER {0x8093}
+sub GL_EDGE_FLAG_ARRAY_POINTER_EXT {0x8093}
+sub GL_EDGE_FLAG_ARRAY_STRIDE {0x808C}
+sub GL_EDGE_FLAG_ARRAY_STRIDE_EXT {0x808C}
+sub GL_ELEMENT_ARRAY_BUFFER_ARB {0x8893}
+sub GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB {0x8895}
+sub GL_EMISSION {0x1600}
+sub GL_ENABLE_BIT {0x00002000}
+sub GL_EQUAL {0x0202}
+sub GL_EQUIV {0x1509}
+sub GL_EVAL_BIT {0x00010000}
+sub GL_EXP {0x0800}
+sub GL_EXP2 {0x0801}
+sub GL_EXPAND_NEGATE_NV {0x8539}
+sub GL_EXPAND_NORMAL_NV {0x8538}
+sub GL_EXTENSIONS {0x1F03}
+sub GL_EYE_LINEAR {0x2400}
+sub GL_EYE_PLANE {0x2502}
+sub GL_EYE_PLANE_ABSOLUTE_NV {0x855C}
+sub GL_EYE_RADIAL_NV {0x855B}
+sub GL_E_TIMES_F_NV {0x8531}
+sub GL_FALSE {0}
+sub GL_FASTEST {0x1101}
+sub GL_FEEDBACK {0x1C01}
+sub GL_FEEDBACK_BUFFER_POINTER {0x0DF0}
+sub GL_FEEDBACK_BUFFER_SIZE {0x0DF1}
+sub GL_FEEDBACK_BUFFER_TYPE {0x0DF2}
+sub GL_FENCE_CONDITION_NV {0x84F4}
+sub GL_FENCE_STATUS_NV {0x84F3}
+sub GL_FILL {0x1B02}
+sub GL_FLAT {0x1D00}
+sub GL_FLOAT {0x1406}
+sub GL_FLOAT_CLEAR_COLOR_VALUE_NV {0x888D}
+sub GL_FLOAT_R16_NV {0x8884}
+sub GL_FLOAT_R32_NV {0x8885}
+sub GL_FLOAT_RG16_NV {0x8886}
+sub GL_FLOAT_RG32_NV {0x8887}
+sub GL_FLOAT_RGB16_NV {0x8888}
+sub GL_FLOAT_RGB32_NV {0x8889}
+sub GL_FLOAT_RGBA16_NV {0x888A}
+sub GL_FLOAT_RGBA32_NV {0x888B}
+sub GL_FLOAT_RGBA_MODE_NV {0x888E}
+sub GL_FLOAT_RGBA_NV {0x8883}
+sub GL_FLOAT_RGB_NV {0x8882}
+sub GL_FLOAT_RG_NV {0x8881}
+sub GL_FLOAT_R_NV {0x8880}
+sub GL_FOG {0x0B60}
+sub GL_FOG_BIT {0x00000080}
+sub GL_FOG_COLOR {0x0B66}
+sub GL_FOG_COORDINATE {0x8451}
+sub GL_FOG_COORDINATE_ARRAY {0x8457}
+sub GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB {0x889D}
+sub GL_FOG_COORDINATE_ARRAY_EXT {0x8457}
+sub GL_FOG_COORDINATE_ARRAY_POINTER {0x8456}
+sub GL_FOG_COORDINATE_ARRAY_POINTER_EXT {0x8456}
+sub GL_FOG_COORDINATE_ARRAY_STRIDE {0x8455}
+sub GL_FOG_COORDINATE_ARRAY_STRIDE_EXT {0x8455}
+sub GL_FOG_COORDINATE_ARRAY_TYPE {0x8454}
+sub GL_FOG_COORDINATE_ARRAY_TYPE_EXT {0x8454}
+sub GL_FOG_COORDINATE_EXT {0x8451}
+sub GL_FOG_COORDINATE_SOURCE {0x8450}
+sub GL_FOG_COORDINATE_SOURCE_EXT {0x8450}
+sub GL_FOG_DENSITY {0x0B62}
+sub GL_FOG_DISTANCE_MODE_NV {0x855A}
+sub GL_FOG_END {0x0B64}
+sub GL_FOG_HINT {0x0C54}
+sub GL_FOG_INDEX {0x0B61}
+sub GL_FOG_MODE {0x0B65}
+sub GL_FOG_START {0x0B63}
+sub GL_FORCE_BLUE_TO_ONE_NV {0x8860}
+sub GL_FORCE_SOFTWARE_NV {0x6007}
+sub GL_FRAGMENT_DEPTH {0x8452}
+sub GL_FRAGMENT_DEPTH_EXT {0x8452}
+sub GL_FRAGMENT_PROGRAM_ARB {0x8804}
+sub GL_FRAGMENT_PROGRAM_BINDING_NV {0x8873}
+sub GL_FRAGMENT_PROGRAM_NV {0x8870}
+sub GL_FRONT {0x0404}
+sub GL_FRONT_AND_BACK {0x0408}
+sub GL_FRONT_FACE {0x0B46}
+sub GL_FRONT_LEFT {0x0400}
+sub GL_FRONT_RIGHT {0x0401}
+sub GL_FUNC_ADD {0x8006}
+sub GL_FUNC_ADD_EXT {0x8006}
+sub GL_FUNC_REVERSE_SUBTRACT {0x800B}
+sub GL_FUNC_REVERSE_SUBTRACT_EXT {0x800B}
+sub GL_FUNC_SUBTRACT {0x800A}
+sub GL_FUNC_SUBTRACT_EXT {0x800A}
+sub GL_GENERATE_MIPMAP {0x8191}
+sub GL_GENERATE_MIPMAP_HINT {0x8192}
+sub GL_GENERATE_MIPMAP_HINT_SGIS {0x8192}
+sub GL_GENERATE_MIPMAP_SGIS {0x8191}
+sub GL_GEQUAL {0x0206}
+sub GL_GREATER {0x0204}
+sub GL_GREEN {0x1904}
+sub GL_GREEN_BIAS {0x0D19}
+sub GL_GREEN_BITS {0x0D53}
+sub GL_GREEN_SCALE {0x0D18}
+sub GL_HALF_BIAS_NEGATE_NV {0x853B}
+sub GL_HALF_BIAS_NORMAL_NV {0x853A}
+sub GL_HALF_FLOAT_NV {0x140B}
+sub GL_HILO16_NV {0x86F8}
+sub GL_HILO8_NV {0x885E}
+sub GL_HILO_NV {0x86F4}
+sub GL_HINT_BIT {0x00008000}
+sub GL_HISTOGRAM {0x8024}
+sub GL_HISTOGRAM_ALPHA_SIZE {0x802B}
+sub GL_HISTOGRAM_BLUE_SIZE {0x802A}
+sub GL_HISTOGRAM_FORMAT {0x8027}
+sub GL_HISTOGRAM_GREEN_SIZE {0x8029}
+sub GL_HISTOGRAM_LUMINANCE_SIZE {0x802C}
+sub GL_HISTOGRAM_RED_SIZE {0x8028}
+sub GL_HISTOGRAM_SINK {0x802D}
+sub GL_HISTOGRAM_WIDTH {0x8026}
+sub GL_HI_BIAS_NV {0x8714}
+sub GL_HI_SCALE_NV {0x870E}
+sub GL_IDENTITY_NV {0x862A}
+sub GL_IGNORE_BORDER {0x8150}
+sub GL_INCR {0x1E02}
+sub GL_INCR_WRAP {0x8507}
+sub GL_INCR_WRAP_EXT {0x8507}
+sub GL_INDEX_ARRAY {0x8077}
+sub GL_INDEX_ARRAY_BUFFER_BINDING_ARB {0x8899}
+sub GL_INDEX_ARRAY_COUNT_EXT {0x8087}
+sub GL_INDEX_ARRAY_EXT {0x8077}
+sub GL_INDEX_ARRAY_POINTER {0x8091}
+sub GL_INDEX_ARRAY_POINTER_EXT {0x8091}
+sub GL_INDEX_ARRAY_STRIDE {0x8086}
+sub GL_INDEX_ARRAY_STRIDE_EXT {0x8086}
+sub GL_INDEX_ARRAY_TYPE {0x8085}
+sub GL_INDEX_ARRAY_TYPE_EXT {0x8085}
+sub GL_INDEX_BITS {0x0D51}
+sub GL_INDEX_CLEAR_VALUE {0x0C20}
+sub GL_INDEX_LOGIC_OP {0x0BF1}
+sub GL_INDEX_MODE {0x0C30}
+sub GL_INDEX_OFFSET {0x0D13}
+sub GL_INDEX_SHIFT {0x0D12}
+sub GL_INDEX_WRITEMASK {0x0C21}
+sub GL_INT {0x1404}
+sub GL_INTENSITY {0x8049}
+sub GL_INTENSITY12 {0x804C}
+sub GL_INTENSITY16 {0x804D}
+sub GL_INTENSITY4 {0x804A}
+sub GL_INTENSITY8 {0x804B}
+sub GL_INTERPOLATE {0x8575}
+sub GL_INTERPOLATE_ARB {0x8575}
+sub GL_INTERPOLATE_EXT {0x8575}
+sub GL_INVALID_ENUM {0x0500}
+sub GL_INVALID_OPERATION {0x0502}
+sub GL_INVALID_VALUE {0x0501}
+sub GL_INVERSE_NV {0x862B}
+sub GL_INVERSE_TRANSPOSE_NV {0x862D}
+sub GL_INVERT {0x150A}
+sub GL_KEEP {0x1E00}
+sub GL_LEFT {0x0406}
+sub GL_LEQUAL {0x0203}
+sub GL_LESS {0x0201}
+sub GL_LIGHT0 {0x4000}
+sub GL_LIGHT1 {0x4001}
+sub GL_LIGHT2 {0x4002}
+sub GL_LIGHT3 {0x4003}
+sub GL_LIGHT4 {0x4004}
+sub GL_LIGHT5 {0x4005}
+sub GL_LIGHT6 {0x4006}
+sub GL_LIGHT7 {0x4007}
+sub GL_LIGHTING {0x0B50}
+sub GL_LIGHTING_BIT {0x00000040}
+sub GL_LIGHT_MODEL_AMBIENT {0x0B53}
+sub GL_LIGHT_MODEL_COLOR_CONTROL {0x81F8}
+sub GL_LIGHT_MODEL_COLOR_CONTROL_EXT {0x81F8}
+sub GL_LIGHT_MODEL_LOCAL_VIEWER {0x0B51}
+sub GL_LIGHT_MODEL_TWO_SIDE {0x0B52}
+sub GL_LINE {0x1B01}
+sub GL_LINEAR {0x2601}
+sub GL_LINEAR_ATTENUATION {0x1208}
+sub GL_LINEAR_MIPMAP_LINEAR {0x2703}
+sub GL_LINEAR_MIPMAP_NEAREST {0x2701}
+sub GL_LINES {0x0001}
+sub GL_LINE_BIT {0x00000004}
+sub GL_LINE_LOOP {0x0002}
+sub GL_LINE_RESET_TOKEN {0x0707}
+sub GL_LINE_SMOOTH {0x0B20}
+sub GL_LINE_SMOOTH_HINT {0x0C52}
+sub GL_LINE_STIPPLE {0x0B24}
+sub GL_LINE_STIPPLE_PATTERN {0x0B25}
+sub GL_LINE_STIPPLE_REPEAT {0x0B26}
+sub GL_LINE_STRIP {0x0003}
+sub GL_LINE_TOKEN {0x0702}
+sub GL_LINE_WIDTH {0x0B21}
+sub GL_LINE_WIDTH_GRANULARITY {0x0B23}
+sub GL_LINE_WIDTH_RANGE {0x0B22}
+sub GL_LIST_BASE {0x0B32}
+sub GL_LIST_BIT {0x00020000}
+sub GL_LIST_INDEX {0x0B33}
+sub GL_LIST_MODE {0x0B30}
+sub GL_LOAD {0x0101}
+sub GL_LOGIC_OP {0x0BF1}
+sub GL_LOGIC_OP_MODE {0x0BF0}
+sub GL_LO_BIAS_NV {0x8715}
+sub GL_LO_SCALE_NV {0x870F}
+sub GL_LUMINANCE {0x1909}
+sub GL_LUMINANCE12 {0x8041}
+sub GL_LUMINANCE12_ALPHA12 {0x8047}
+sub GL_LUMINANCE12_ALPHA4 {0x8046}
+sub GL_LUMINANCE16 {0x8042}
+sub GL_LUMINANCE16_ALPHA16 {0x8048}
+sub GL_LUMINANCE4 {0x803F}
+sub GL_LUMINANCE4_ALPHA4 {0x8043}
+sub GL_LUMINANCE6_ALPHA2 {0x8044}
+sub GL_LUMINANCE8 {0x8040}
+sub GL_LUMINANCE8_ALPHA8 {0x8045}
+sub GL_LUMINANCE_ALPHA {0x190A}
+sub GL_MAC_GET_PROC_ADDRESS_NV {0x84FC}
+sub GL_MAGNITUDE_BIAS_NV {0x8718}
+sub GL_MAGNITUDE_SCALE_NV {0x8712}
+sub GL_MAP1_COLOR_4 {0x0D90}
+sub GL_MAP1_GRID_DOMAIN {0x0DD0}
+sub GL_MAP1_GRID_SEGMENTS {0x0DD1}
+sub GL_MAP1_INDEX {0x0D91}
+sub GL_MAP1_NORMAL {0x0D92}
+sub GL_MAP1_TEXTURE_COORD_1 {0x0D93}
+sub GL_MAP1_TEXTURE_COORD_2 {0x0D94}
+sub GL_MAP1_TEXTURE_COORD_3 {0x0D95}
+sub GL_MAP1_TEXTURE_COORD_4 {0x0D96}
+sub GL_MAP1_VERTEX_3 {0x0D97}
+sub GL_MAP1_VERTEX_4 {0x0D98}
+sub GL_MAP1_VERTEX_ATTRIB0_4_NV {0x8660}
+sub GL_MAP1_VERTEX_ATTRIB10_4_NV {0x866A}
+sub GL_MAP1_VERTEX_ATTRIB11_4_NV {0x866B}
+sub GL_MAP1_VERTEX_ATTRIB12_4_NV {0x866C}
+sub GL_MAP1_VERTEX_ATTRIB13_4_NV {0x866D}
+sub GL_MAP1_VERTEX_ATTRIB14_4_NV {0x866E}
+sub GL_MAP1_VERTEX_ATTRIB15_4_NV {0x866F}
+sub GL_MAP1_VERTEX_ATTRIB1_4_NV {0x8661}
+sub GL_MAP1_VERTEX_ATTRIB2_4_NV {0x8662}
+sub GL_MAP1_VERTEX_ATTRIB3_4_NV {0x8663}
+sub GL_MAP1_VERTEX_ATTRIB4_4_NV {0x8664}
+sub GL_MAP1_VERTEX_ATTRIB5_4_NV {0x8665}
+sub GL_MAP1_VERTEX_ATTRIB6_4_NV {0x8666}
+sub GL_MAP1_VERTEX_ATTRIB7_4_NV {0x8667}
+sub GL_MAP1_VERTEX_ATTRIB8_4_NV {0x8668}
+sub GL_MAP1_VERTEX_ATTRIB9_4_NV {0x8669}
+sub GL_MAP2_COLOR_4 {0x0DB0}
+sub GL_MAP2_GRID_DOMAIN {0x0DD2}
+sub GL_MAP2_GRID_SEGMENTS {0x0DD3}
+sub GL_MAP2_INDEX {0x0DB1}
+sub GL_MAP2_NORMAL {0x0DB2}
+sub GL_MAP2_TEXTURE_COORD_1 {0x0DB3}
+sub GL_MAP2_TEXTURE_COORD_2 {0x0DB4}
+sub GL_MAP2_TEXTURE_COORD_3 {0x0DB5}
+sub GL_MAP2_TEXTURE_COORD_4 {0x0DB6}
+sub GL_MAP2_VERTEX_3 {0x0DB7}
+sub GL_MAP2_VERTEX_4 {0x0DB8}
+sub GL_MAP2_VERTEX_ATTRIB0_4_NV {0x8670}
+sub GL_MAP2_VERTEX_ATTRIB10_4_NV {0x867A}
+sub GL_MAP2_VERTEX_ATTRIB11_4_NV {0x867B}
+sub GL_MAP2_VERTEX_ATTRIB12_4_NV {0x867C}
+sub GL_MAP2_VERTEX_ATTRIB13_4_NV {0x867D}
+sub GL_MAP2_VERTEX_ATTRIB14_4_NV {0x867E}
+sub GL_MAP2_VERTEX_ATTRIB15_4_NV {0x867F}
+sub GL_MAP2_VERTEX_ATTRIB1_4_NV {0x8671}
+sub GL_MAP2_VERTEX_ATTRIB2_4_NV {0x8672}
+sub GL_MAP2_VERTEX_ATTRIB3_4_NV {0x8673}
+sub GL_MAP2_VERTEX_ATTRIB4_4_NV {0x8674}
+sub GL_MAP2_VERTEX_ATTRIB5_4_NV {0x8675}
+sub GL_MAP2_VERTEX_ATTRIB6_4_NV {0x8676}
+sub GL_MAP2_VERTEX_ATTRIB7_4_NV {0x8677}
+sub GL_MAP2_VERTEX_ATTRIB8_4_NV {0x8678}
+sub GL_MAP2_VERTEX_ATTRIB9_4_NV {0x8679}
+sub GL_MAP_COLOR {0x0D10}
+sub GL_MAP_STENCIL {0x0D11}
+sub GL_MATRIX0_ARB {0x88C0}
+sub GL_MATRIX0_NV {0x8630}
+sub GL_MATRIX10_ARB {0x88CA}
+sub GL_MATRIX11_ARB {0x88CB}
+sub GL_MATRIX12_ARB {0x88CC}
+sub GL_MATRIX13_ARB {0x88CD}
+sub GL_MATRIX14_ARB {0x88CE}
+sub GL_MATRIX15_ARB {0x88CF}
+sub GL_MATRIX16_ARB {0x88D0}
+sub GL_MATRIX17_ARB {0x88D1}
+sub GL_MATRIX18_ARB {0x88D2}
+sub GL_MATRIX19_ARB {0x88D3}
+sub GL_MATRIX1_ARB {0x88C1}
+sub GL_MATRIX1_NV {0x8631}
+sub GL_MATRIX20_ARB {0x88D4}
+sub GL_MATRIX21_ARB {0x88D5}
+sub GL_MATRIX22_ARB {0x88D6}
+sub GL_MATRIX23_ARB {0x88D7}
+sub GL_MATRIX24_ARB {0x88D8}
+sub GL_MATRIX25_ARB {0x88D9}
+sub GL_MATRIX26_ARB {0x88DA}
+sub GL_MATRIX27_ARB {0x88DB}
+sub GL_MATRIX28_ARB {0x88DC}
+sub GL_MATRIX29_ARB {0x88DD}
+sub GL_MATRIX2_ARB {0x88C2}
+sub GL_MATRIX2_NV {0x8632}
+sub GL_MATRIX30_ARB {0x88DE}
+sub GL_MATRIX31_ARB {0x88DF}
+sub GL_MATRIX3_ARB {0x88C3}
+sub GL_MATRIX3_NV {0x8633}
+sub GL_MATRIX4_ARB {0x88C4}
+sub GL_MATRIX4_NV {0x8634}
+sub GL_MATRIX5_ARB {0x88C5}
+sub GL_MATRIX5_NV {0x8635}
+sub GL_MATRIX6_ARB {0x88C6}
+sub GL_MATRIX6_NV {0x8636}
+sub GL_MATRIX7_ARB {0x88C7}
+sub GL_MATRIX7_NV {0x8637}
+sub GL_MATRIX8_ARB {0x88C8}
+sub GL_MATRIX9_ARB {0x88C9}
+sub GL_MATRIX_MODE {0x0BA0}
+sub GL_MAX {0x8008}
+sub GL_MAX_3D_TEXTURE_SIZE {0x8073}
+sub GL_MAX_3D_TEXTURE_SIZE_EXT {0x8073}
+sub GL_MAX_ATTRIB_STACK_DEPTH {0x0D35}
+sub GL_MAX_CLIENT_ATTRIB_STACK_DEPTH {0x0D3B}
+sub GL_MAX_CLIP_PLANES {0x0D32}
+sub GL_MAX_COLOR_MATRIX_STACK_DEPTH {0x80B3}
+sub GL_MAX_CONVOLUTION_HEIGHT {0x801B}
+sub GL_MAX_CONVOLUTION_WIDTH {0x801A}
+sub GL_MAX_CUBE_MAP_TEXTURE_SIZE {0x851C}
+sub GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB {0x851C}
+sub GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT {0x851C}
+sub GL_MAX_ELEMENTS_INDICES {0x80E9}
+sub GL_MAX_ELEMENTS_INDICES_EXT {0x80E9}
+sub GL_MAX_ELEMENTS_VERTICES {0x80E8}
+sub GL_MAX_ELEMENTS_VERTICES_EXT {0x80E8}
+sub GL_MAX_EVAL_ORDER {0x0D30}
+sub GL_MAX_EXT {0x8008}
+sub GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV {0x8868}
+sub GL_MAX_GENERAL_COMBINERS_NV {0x854D}
+sub GL_MAX_LIGHTS {0x0D31}
+sub GL_MAX_LIST_NESTING {0x0B31}
+sub GL_MAX_MODELVIEW_STACK_DEPTH {0x0D36}
+sub GL_MAX_NAME_STACK_DEPTH {0x0D37}
+sub GL_MAX_PENDING_FLUSHHOLD_NVX {0x6009}
+sub GL_MAX_PIXEL_MAP_TABLE {0x0D34}
+sub GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB {0x88B1}
+sub GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB {0x880B}
+sub GL_MAX_PROGRAM_ATTRIBS_ARB {0x88AD}
+sub GL_MAX_PROGRAM_ENV_PARAMETERS_ARB {0x88B5}
+sub GL_MAX_PROGRAM_INSTRUCTIONS_ARB {0x88A1}
+sub GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB {0x88B4}
+sub GL_MAX_PROGRAM_MATRICES_ARB {0x862F}
+sub GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB {0x862E}
+sub GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB {0x88B3}
+sub GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB {0x880E}
+sub GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB {0x88AF}
+sub GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB {0x88A3}
+sub GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB {0x88AB}
+sub GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB {0x88A7}
+sub GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB {0x8810}
+sub GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB {0x880F}
+sub GL_MAX_PROGRAM_PARAMETERS_ARB {0x88A9}
+sub GL_MAX_PROGRAM_TEMPORARIES_ARB {0x88A5}
+sub GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB {0x880D}
+sub GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB {0x880C}
+sub GL_MAX_PROJECTION_STACK_DEPTH {0x0D38}
+sub GL_MAX_RECTANGLE_TEXTURE_SIZE_NV {0x84F8}
+sub GL_MAX_SHININESS_NV {0x8504}
+sub GL_MAX_SPOT_EXPONENT_NV {0x8505}
+sub GL_MAX_TEXTURES_SGIS {0x835D}
+sub GL_MAX_TEXTURE_COORDS_ARB {0x8871}
+sub GL_MAX_TEXTURE_COORDS_NV {0x8871}
+sub GL_MAX_TEXTURE_IMAGE_UNITS_ARB {0x8872}
+sub GL_MAX_TEXTURE_IMAGE_UNITS_NV {0x8872}
+sub GL_MAX_TEXTURE_LOD_BIAS {0x84FD}
+sub GL_MAX_TEXTURE_LOD_BIAS_EXT {0x84FD}
+sub GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT {0x84FF}
+sub GL_MAX_TEXTURE_SIZE {0x0D33}
+sub GL_MAX_TEXTURE_STACK_DEPTH {0x0D39}
+sub GL_MAX_TEXTURE_UNITS {0x84E2}
+sub GL_MAX_TEXTURE_UNITS_ARB {0x84E2}
+sub GL_MAX_TRACK_MATRICES_NV {0x862F}
+sub GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV {0x862E}
+sub GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV {0x8520}
+sub GL_MAX_VERTEX_ATTRIBS_ARB {0x8869}
+sub GL_MAX_VIEWPORT_DIMS {0x0D3A}
+sub GL_MIN {0x8007}
+sub GL_MINMAX {0x802E}
+sub GL_MINMAX_FORMAT {0x802F}
+sub GL_MINMAX_SINK {0x8030}
+sub GL_MIN_EXT {0x8007}
+sub GL_MIRRORED_REPEAT {0x8370}
+sub GL_MIRRORED_REPEAT_ARB {0x8370}
+sub GL_MIRRORED_REPEAT_IBM {0x8370}
+sub GL_MODELVIEW {0x1700}
+sub GL_MODELVIEW0_EXT {0x1700}
+sub GL_MODELVIEW0_MATRIX_EXT {0x0BA6}
+sub GL_MODELVIEW0_STACK_DEPTH_EXT {0x0BA3}
+sub GL_MODELVIEW1_EXT {0x850A}
+sub GL_MODELVIEW1_MATRIX_EXT {0x8506}
+sub GL_MODELVIEW1_STACK_DEPTH_EXT {0x8502}
+sub GL_MODELVIEW_MATRIX {0x0BA6}
+sub GL_MODELVIEW_PROJECTION_NV {0x8629}
+sub GL_MODELVIEW_STACK_DEPTH {0x0BA3}
+sub GL_MODULATE {0x2100}
+sub GL_MULT {0x0103}
+sub GL_MULTISAMPLE {0x809D}
+sub GL_MULTISAMPLE_ARB {0x809D}
+sub GL_MULTISAMPLE_BIT {0x20000000}
+sub GL_MULTISAMPLE_BIT_ARB {0x20000000}
+sub GL_MULTISAMPLE_FILTER_HINT_NV {0x8534}
+sub GL_N3F_V3F {0x2A25}
+sub GL_NAME_STACK_DEPTH {0x0D70}
+sub GL_NAND {0x150E}
+sub GL_NEAREST {0x2600}
+sub GL_NEAREST_MIPMAP_LINEAR {0x2702}
+sub GL_NEAREST_MIPMAP_NEAREST {0x2700}
+sub GL_NEVER {0x0200}
+sub GL_NICEST {0x1102}
+sub GL_NONE {0}
+sub GL_NOOP {0x1505}
+sub GL_NOR {0x1508}
+sub GL_NORMALIZE {0x0BA1}
+sub GL_NORMAL_ARRAY {0x8075}
+sub GL_NORMAL_ARRAY_BUFFER_BINDING_ARB {0x8897}
+sub GL_NORMAL_ARRAY_COUNT_EXT {0x8080}
+sub GL_NORMAL_ARRAY_EXT {0x8075}
+sub GL_NORMAL_ARRAY_POINTER {0x808F}
+sub GL_NORMAL_ARRAY_POINTER_EXT {0x808F}
+sub GL_NORMAL_ARRAY_STRIDE {0x807F}
+sub GL_NORMAL_ARRAY_STRIDE_EXT {0x807F}
+sub GL_NORMAL_ARRAY_TYPE {0x807E}
+sub GL_NORMAL_ARRAY_TYPE_EXT {0x807E}
+sub GL_NORMAL_MAP {0x8511}
+sub GL_NORMAL_MAP_ARB {0x8511}
+sub GL_NORMAL_MAP_EXT {0x8511}
+sub GL_NORMAL_MAP_NV {0x8511}
+sub GL_NOTEQUAL {0x0205}
+sub GL_NO_ERROR {0}
+sub GL_NUM_COMPRESSED_TEXTURE_FORMATS {0x86A2}
+sub GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB {0x86A2}
+sub GL_NUM_GENERAL_COMBINERS_NV {0x854E}
+sub GL_OBJECT_LINEAR {0x2401}
+sub GL_OBJECT_PLANE {0x2501}
+sub GL_OCCLUSION_TEST_HP {0x8165}
+sub GL_OCCLUSION_TEST_RESULT_HP {0x8166}
+sub GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV {0x8856}
+sub GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV {0x8857}
+sub GL_OFFSET_HILO_TEXTURE_2D_NV {0x8854}
+sub GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV {0x8855}
+sub GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV {0x8850}
+sub GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV {0x8851}
+sub GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV {0x8852}
+sub GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV {0x8853}
+sub GL_OFFSET_TEXTURE_2D_BIAS_NV {0x86E3}
+sub GL_OFFSET_TEXTURE_2D_MATRIX_NV {0x86E1}
+sub GL_OFFSET_TEXTURE_2D_NV {0x86E8}
+sub GL_OFFSET_TEXTURE_2D_SCALE_NV {0x86E2}
+sub GL_OFFSET_TEXTURE_BIAS_NV {0x86E3}
+sub GL_OFFSET_TEXTURE_MATRIX_NV {0x86E1}
+sub GL_OFFSET_TEXTURE_RECTANGLE_NV {0x864C}
+sub GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV {0x864D}
+sub GL_OFFSET_TEXTURE_SCALE_NV {0x86E2}
+sub GL_ONE {1}
+sub GL_ONE_MINUS_CONSTANT_ALPHA {0x8004}
+sub GL_ONE_MINUS_CONSTANT_ALPHA_EXT {0x8004}
+sub GL_ONE_MINUS_CONSTANT_COLOR {0x8002}
+sub GL_ONE_MINUS_CONSTANT_COLOR_EXT {0x8002}
+sub GL_ONE_MINUS_DST_ALPHA {0x0305}
+sub GL_ONE_MINUS_DST_COLOR {0x0307}
+sub GL_ONE_MINUS_SRC_ALPHA {0x0303}
+sub GL_ONE_MINUS_SRC_COLOR {0x0301}
+sub GL_OPERAND0_ALPHA {0x8598}
+sub GL_OPERAND0_ALPHA_ARB {0x8598}
+sub GL_OPERAND0_ALPHA_EXT {0x8598}
+sub GL_OPERAND0_RGB {0x8590}
+sub GL_OPERAND0_RGB_ARB {0x8590}
+sub GL_OPERAND0_RGB_EXT {0x8590}
+sub GL_OPERAND1_ALPHA {0x8599}
+sub GL_OPERAND1_ALPHA_ARB {0x8599}
+sub GL_OPERAND1_ALPHA_EXT {0x8599}
+sub GL_OPERAND1_RGB {0x8591}
+sub GL_OPERAND1_RGB_ARB {0x8591}
+sub GL_OPERAND1_RGB_EXT {0x8591}
+sub GL_OPERAND2_ALPHA {0x859A}
+sub GL_OPERAND2_ALPHA_ARB {0x859A}
+sub GL_OPERAND2_ALPHA_EXT {0x859A}
+sub GL_OPERAND2_RGB {0x8592}
+sub GL_OPERAND2_RGB_ARB {0x8592}
+sub GL_OPERAND2_RGB_EXT {0x8592}
+sub GL_OPERAND3_ALPHA_NV {0x859B}
+sub GL_OPERAND3_RGB_NV {0x8593}
+sub GL_OR {0x1507}
+sub GL_ORDER {0x0A01}
+sub GL_OR_INVERTED {0x150D}
+sub GL_OR_REVERSE {0x150B}
+sub GL_OUT_OF_MEMORY {0x0505}
+sub GL_PACK_ALIGNMENT {0x0D05}
+sub GL_PACK_IMAGE_HEIGHT {0x806C}
+sub GL_PACK_IMAGE_HEIGHT_EXT {0x806C}
+sub GL_PACK_LSB_FIRST {0x0D01}
+sub GL_PACK_ROW_LENGTH {0x0D02}
+sub GL_PACK_SKIP_IMAGES {0x806B}
+sub GL_PACK_SKIP_IMAGES_EXT {0x806B}
+sub GL_PACK_SKIP_PIXELS {0x0D04}
+sub GL_PACK_SKIP_ROWS {0x0D03}
+sub GL_PACK_SWAP_BYTES {0x0D00}
+sub GL_PASS_THROUGH_NV {0x86E6}
+sub GL_PASS_THROUGH_TOKEN {0x0700}
+sub GL_PERSPECTIVE_CORRECTION_HINT {0x0C50}
+sub GL_PER_STAGE_CONSTANTS_NV {0x8535}
+sub GL_PIXEL_COUNTER_BITS_NV {0x8864}
+sub GL_PIXEL_COUNT_AVAILABLE_NV {0x8867}
+sub GL_PIXEL_COUNT_NV {0x8866}
+sub GL_PIXEL_MAP_A_TO_A {0x0C79}
+sub GL_PIXEL_MAP_A_TO_A_SIZE {0x0CB9}
+sub GL_PIXEL_MAP_B_TO_B {0x0C78}
+sub GL_PIXEL_MAP_B_TO_B_SIZE {0x0CB8}
+sub GL_PIXEL_MAP_G_TO_G {0x0C77}
+sub GL_PIXEL_MAP_G_TO_G_SIZE {0x0CB7}
+sub GL_PIXEL_MAP_I_TO_A {0x0C75}
+sub GL_PIXEL_MAP_I_TO_A_SIZE {0x0CB5}
+sub GL_PIXEL_MAP_I_TO_B {0x0C74}
+sub GL_PIXEL_MAP_I_TO_B_SIZE {0x0CB4}
+sub GL_PIXEL_MAP_I_TO_G {0x0C73}
+sub GL_PIXEL_MAP_I_TO_G_SIZE {0x0CB3}
+sub GL_PIXEL_MAP_I_TO_I {0x0C70}
+sub GL_PIXEL_MAP_I_TO_I_SIZE {0x0CB0}
+sub GL_PIXEL_MAP_I_TO_R {0x0C72}
+sub GL_PIXEL_MAP_I_TO_R_SIZE {0x0CB2}
+sub GL_PIXEL_MAP_R_TO_R {0x0C76}
+sub GL_PIXEL_MAP_R_TO_R_SIZE {0x0CB6}
+sub GL_PIXEL_MAP_S_TO_S {0x0C71}
+sub GL_PIXEL_MAP_S_TO_S_SIZE {0x0CB1}
+sub GL_PIXEL_MODE_BIT {0x00000020}
+sub GL_POINT {0x1B00}
+sub GL_POINTS {0x0000}
+sub GL_POINT_BIT {0x00000002}
+sub GL_POINT_DISTANCE_ATTENUATION {0x8129}
+sub GL_POINT_DISTANCE_ATTENUATION_ARB {0x8129}
+sub GL_POINT_FADE_THRESHOLD_SIZE {0x8128}
+sub GL_POINT_FADE_THRESHOLD_SIZE_ARB {0x8128}
+sub GL_POINT_FADE_THRESHOLD_SIZE_EXT {0x8128}
+sub GL_POINT_SIZE {0x0B11}
+sub GL_POINT_SIZE_GRANULARITY {0x0B13}
+sub GL_POINT_SIZE_MAX {0x8127}
+sub GL_POINT_SIZE_MAX_ARB {0x8127}
+sub GL_POINT_SIZE_MAX_EXT {0x8127}
+sub GL_POINT_SIZE_MIN {0x8126}
+sub GL_POINT_SIZE_MIN_ARB {0x8126}
+sub GL_POINT_SIZE_MIN_EXT {0x8126}
+sub GL_POINT_SIZE_RANGE {0x0B12}
+sub GL_POINT_SMOOTH {0x0B10}
+sub GL_POINT_SMOOTH_HINT {0x0C51}
+sub GL_POINT_SPRITE_NV {0x8861}
+sub GL_POINT_SPRITE_R_MODE_NV {0x8863}
+sub GL_POINT_TOKEN {0x0701}
+sub GL_POLYGON {0x0009}
+sub GL_POLYGON_BIT {0x00000008}
+sub GL_POLYGON_MODE {0x0B40}
+sub GL_POLYGON_OFFSET_FACTOR {0x8038}
+sub GL_POLYGON_OFFSET_FILL {0x8037}
+sub GL_POLYGON_OFFSET_LINE {0x2A02}
+sub GL_POLYGON_OFFSET_POINT {0x2A01}
+sub GL_POLYGON_OFFSET_UNITS {0x2A00}
+sub GL_POLYGON_SMOOTH {0x0B41}
+sub GL_POLYGON_SMOOTH_HINT {0x0C53}
+sub GL_POLYGON_STIPPLE {0x0B42}
+sub GL_POLYGON_STIPPLE_BIT {0x00000010}
+sub GL_POLYGON_TOKEN {0x0703}
+sub GL_POSITION {0x1203}
+sub GL_POST_COLOR_MATRIX_ALPHA_BIAS {0x80BB}
+sub GL_POST_COLOR_MATRIX_ALPHA_SCALE {0x80B7}
+sub GL_POST_COLOR_MATRIX_BLUE_BIAS {0x80BA}
+sub GL_POST_COLOR_MATRIX_BLUE_SCALE {0x80B6}
+sub GL_POST_COLOR_MATRIX_COLOR_TABLE {0x80D2}
+sub GL_POST_COLOR_MATRIX_GREEN_BIAS {0x80B9}
+sub GL_POST_COLOR_MATRIX_GREEN_SCALE {0x80B5}
+sub GL_POST_COLOR_MATRIX_RED_BIAS {0x80B8}
+sub GL_POST_COLOR_MATRIX_RED_SCALE {0x80B4}
+sub GL_POST_CONVOLUTION_ALPHA_BIAS {0x8023}
+sub GL_POST_CONVOLUTION_ALPHA_SCALE {0x801F}
+sub GL_POST_CONVOLUTION_BLUE_BIAS {0x8022}
+sub GL_POST_CONVOLUTION_BLUE_SCALE {0x801E}
+sub GL_POST_CONVOLUTION_COLOR_TABLE {0x80D1}
+sub GL_POST_CONVOLUTION_GREEN_BIAS {0x8021}
+sub GL_POST_CONVOLUTION_GREEN_SCALE {0x801D}
+sub GL_POST_CONVOLUTION_RED_BIAS {0x8020}
+sub GL_POST_CONVOLUTION_RED_SCALE {0x801C}
+sub GL_PREVIOUS {0x8578}
+sub GL_PREVIOUS_ARB {0x8578}
+sub GL_PREVIOUS_EXT {0x8578}
+sub GL_PREVIOUS_TEXTURE_INPUT_NV {0x86E4}
+sub GL_PRIMARY_COLOR {0x8577}
+sub GL_PRIMARY_COLOR_ARB {0x8577}
+sub GL_PRIMARY_COLOR_EXT {0x8577}
+sub GL_PRIMARY_COLOR_NV {0x852C}
+sub GL_PRIMITIVE_RESTART_INDEX_NV {0x8559}
+sub GL_PRIMITIVE_RESTART_NV {0x8558}
+sub GL_PROGRAM_ADDRESS_REGISTERS_ARB {0x88B0}
+sub GL_PROGRAM_ALU_INSTRUCTIONS_ARB {0x8805}
+sub GL_PROGRAM_ATTRIBS_ARB {0x88AC}
+sub GL_PROGRAM_BINDING_ARB {0x8677}
+sub GL_PROGRAM_ERROR_POSITION_ARB {0x864B}
+sub GL_PROGRAM_ERROR_POSITION_NV {0x864B}
+sub GL_PROGRAM_ERROR_STRING_ARB {0x8874}
+sub GL_PROGRAM_ERROR_STRING_NV {0x8874}
+sub GL_PROGRAM_FORMAT_ARB {0x8876}
+sub GL_PROGRAM_FORMAT_ASCII_ARB {0x8875}
+sub GL_PROGRAM_INSTRUCTIONS_ARB {0x88A0}
+sub GL_PROGRAM_LENGTH_ARB {0x8627}
+sub GL_PROGRAM_LENGTH_NV {0x8627}
+sub GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB {0x88B2}
+sub GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB {0x8808}
+sub GL_PROGRAM_NATIVE_ATTRIBS_ARB {0x88AE}
+sub GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB {0x88A2}
+sub GL_PROGRAM_NATIVE_PARAMETERS_ARB {0x88AA}
+sub GL_PROGRAM_NATIVE_TEMPORARIES_ARB {0x88A6}
+sub GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB {0x880A}
+sub GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB {0x8809}
+sub GL_PROGRAM_PARAMETERS_ARB {0x88A8}
+sub GL_PROGRAM_PARAMETER_NV {0x8644}
+sub GL_PROGRAM_RESIDENT_NV {0x8647}
+sub GL_PROGRAM_STRING_ARB {0x8628}
+sub GL_PROGRAM_STRING_NV {0x8628}
+sub GL_PROGRAM_TARGET_NV {0x8646}
+sub GL_PROGRAM_TEMPORARIES_ARB {0x88A4}
+sub GL_PROGRAM_TEX_INDIRECTIONS_ARB {0x8807}
+sub GL_PROGRAM_TEX_INSTRUCTIONS_ARB {0x8806}
+sub GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB {0x88B6}
+sub GL_PROJECTION {0x1701}
+sub GL_PROJECTION_MATRIX {0x0BA7}
+sub GL_PROJECTION_STACK_DEPTH {0x0BA4}
+sub GL_PROXY_COLOR_TABLE {0x80D3}
+sub GL_PROXY_HISTOGRAM {0x8025}
+sub GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE {0x80D5}
+sub GL_PROXY_POST_CONVOLUTION_COLOR_TABLE {0x80D4}
+sub GL_PROXY_TEXTURE_1D {0x8063}
+sub GL_PROXY_TEXTURE_2D {0x8064}
+sub GL_PROXY_TEXTURE_3D {0x8070}
+sub GL_PROXY_TEXTURE_3D_EXT {0x8070}
+sub GL_PROXY_TEXTURE_CUBE_MAP {0x851B}
+sub GL_PROXY_TEXTURE_CUBE_MAP_ARB {0x851B}
+sub GL_PROXY_TEXTURE_CUBE_MAP_EXT {0x851B}
+sub GL_PROXY_TEXTURE_RECTANGLE_NV {0x84F7}
+sub GL_Q {0x2003}
+sub GL_QUADRATIC_ATTENUATION {0x1209}
+sub GL_QUADS {0x0007}
+sub GL_QUAD_STRIP {0x0008}
+sub GL_R {0x2002}
+sub GL_R3_G3_B2 {0x2A10}
+sub GL_READ_BUFFER {0x0C02}
+sub GL_READ_ONLY_ARB {0x88B8}
+sub GL_READ_PIXEL_DATA_RANGE_LENGTH_NV {0x887B}
+sub GL_READ_PIXEL_DATA_RANGE_NV {0x8879}
+sub GL_READ_PIXEL_DATA_RANGE_POINTER_NV {0x887D}
+sub GL_READ_WRITE_ARB {0x88BA}
+sub GL_RED {0x1903}
+sub GL_REDUCE {0x8016}
+sub GL_RED_BIAS {0x0D15}
+sub GL_RED_BITS {0x0D52}
+sub GL_RED_SCALE {0x0D14}
+sub GL_REFLECTION_MAP {0x8512}
+sub GL_REFLECTION_MAP_ARB {0x8512}
+sub GL_REFLECTION_MAP_EXT {0x8512}
+sub GL_REFLECTION_MAP_NV {0x8512}
+sub GL_REGISTER_COMBINERS_NV {0x8522}
+sub GL_RENDER {0x1C00}
+sub GL_RENDERER {0x1F01}
+sub GL_RENDER_MODE {0x0C40}
+sub GL_REPEAT {0x2901}
+sub GL_REPLACE {0x1E01}
+sub GL_REPLICATE_BORDER {0x8153}
+sub GL_RESCALE_NORMAL {0x803A}
+sub GL_RESCALE_NORMAL_EXT {0x803A}
+sub GL_RETURN {0x0102}
+sub GL_RGB {0x1907}
+sub GL_RGB10 {0x8052}
+sub GL_RGB10_A2 {0x8059}
+sub GL_RGB12 {0x8053}
+sub GL_RGB16 {0x8054}
+sub GL_RGB4 {0x804F}
+sub GL_RGB4_S3TC {0x83A1}
+sub GL_RGB5 {0x8050}
+sub GL_RGB5_A1 {0x8057}
+sub GL_RGB8 {0x8051}
+sub GL_RGBA {0x1908}
+sub GL_RGBA12 {0x805A}
+sub GL_RGBA16 {0x805B}
+sub GL_RGBA2 {0x8055}
+sub GL_RGBA4 {0x8056}
+sub GL_RGBA4_DXT5_S3TC {0x83A5}
+sub GL_RGBA4_S3TC {0x83A3}
+sub GL_RGBA8 {0x8058}
+sub GL_RGBA_DXT5_S3TC {0x83A4}
+sub GL_RGBA_MODE {0x0C31}
+sub GL_RGBA_S3TC {0x83A2}
+sub GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV {0x86D9}
+sub GL_RGB_S3TC {0x83A0}
+sub GL_RGB_SCALE {0x8573}
+sub GL_RGB_SCALE_ARB {0x8573}
+sub GL_RGB_SCALE_EXT {0x8573}
+sub GL_RIGHT {0x0407}
+sub GL_S {0x2000}
+sub GL_SAMPLES {0x80A9}
+sub GL_SAMPLES_ARB {0x80A9}
+sub GL_SAMPLE_ALPHA_TO_COVERAGE {0x809E}
+sub GL_SAMPLE_ALPHA_TO_COVERAGE_ARB {0x809E}
+sub GL_SAMPLE_ALPHA_TO_ONE {0x809F}
+sub GL_SAMPLE_ALPHA_TO_ONE_ARB {0x809F}
+sub GL_SAMPLE_BUFFERS {0x80A8}
+sub GL_SAMPLE_BUFFERS_ARB {0x80A8}
+sub GL_SAMPLE_COVERAGE {0x80A0}
+sub GL_SAMPLE_COVERAGE_ARB {0x80A0}
+sub GL_SAMPLE_COVERAGE_INVERT {0x80AB}
+sub GL_SAMPLE_COVERAGE_INVERT_ARB {0x80AB}
+sub GL_SAMPLE_COVERAGE_VALUE {0x80AA}
+sub GL_SAMPLE_COVERAGE_VALUE_ARB {0x80AA}
+sub GL_SCALE_BY_FOUR_NV {0x853F}
+sub GL_SCALE_BY_ONE_HALF_NV {0x8540}
+sub GL_SCALE_BY_TWO_NV {0x853E}
+sub GL_SCISSOR_BIT {0x00080000}
+sub GL_SCISSOR_BOX {0x0C10}
+sub GL_SCISSOR_TEST {0x0C11}
+sub GL_SECONDARY_COLOR_ARRAY {0x845E}
+sub GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB {0x889C}
+sub GL_SECONDARY_COLOR_ARRAY_EXT {0x845E}
+sub GL_SECONDARY_COLOR_ARRAY_POINTER {0x845D}
+sub GL_SECONDARY_COLOR_ARRAY_POINTER_EXT {0x845D}
+sub GL_SECONDARY_COLOR_ARRAY_SIZE {0x845A}
+sub GL_SECONDARY_COLOR_ARRAY_SIZE_EXT {0x845A}
+sub GL_SECONDARY_COLOR_ARRAY_STRIDE {0x845C}
+sub GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT {0x845C}
+sub GL_SECONDARY_COLOR_ARRAY_TYPE {0x845B}
+sub GL_SECONDARY_COLOR_ARRAY_TYPE_EXT {0x845B}
+sub GL_SECONDARY_COLOR_NV {0x852D}
+sub GL_SELECT {0x1C02}
+sub GL_SELECTED_TEXTURE_SGIS {0x835C}
+sub GL_SELECTION_BUFFER_POINTER {0x0DF3}
+sub GL_SELECTION_BUFFER_SIZE {0x0DF4}
+sub GL_SEPARABLE_2D {0x8012}
+sub GL_SEPARATE_SPECULAR_COLOR {0x81FA}
+sub GL_SEPARATE_SPECULAR_COLOR_EXT {0x81FA}
+sub GL_SET {0x150F}
+sub GL_SHADER_CONSISTENT_NV {0x86DD}
+sub GL_SHADER_OPERATION_NV {0x86DF}
+sub GL_SHADE_MODEL {0x0B54}
+sub GL_SHARED_TEXTURE_PALETTE_EXT {0x81FB}
+sub GL_SHININESS {0x1601}
+sub GL_SHORT {0x1402}
+sub GL_SIGNED_ALPHA8_NV {0x8706}
+sub GL_SIGNED_ALPHA_NV {0x8705}
+sub GL_SIGNED_HILO16_NV {0x86FA}
+sub GL_SIGNED_HILO8_NV {0x885F}
+sub GL_SIGNED_HILO_NV {0x86F9}
+sub GL_SIGNED_IDENTITY_NV {0x853C}
+sub GL_SIGNED_INTENSITY8_NV {0x8708}
+sub GL_SIGNED_INTENSITY_NV {0x8707}
+sub GL_SIGNED_LUMINANCE8_ALPHA8_NV {0x8704}
+sub GL_SIGNED_LUMINANCE8_NV {0x8702}
+sub GL_SIGNED_LUMINANCE_ALPHA_NV {0x8703}
+sub GL_SIGNED_LUMINANCE_NV {0x8701}
+sub GL_SIGNED_NEGATE_NV {0x853D}
+sub GL_SIGNED_RGB8_NV {0x86FF}
+sub GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV {0x870D}
+sub GL_SIGNED_RGBA8_NV {0x86FC}
+sub GL_SIGNED_RGBA_NV {0x86FB}
+sub GL_SIGNED_RGB_NV {0x86FE}
+sub GL_SIGNED_RGB_UNSIGNED_ALPHA_NV {0x870C}
+sub GL_SINGLE_COLOR {0x81F9}
+sub GL_SINGLE_COLOR_EXT {0x81F9}
+sub GL_SMOOTH {0x1D01}
+sub GL_SMOOTH_LINE_WIDTH_GRANULARITY {0x0B23}
+sub GL_SMOOTH_LINE_WIDTH_RANGE {0x0B22}
+sub GL_SMOOTH_POINT_SIZE_GRANULARITY {0x0B13}
+sub GL_SMOOTH_POINT_SIZE_RANGE {0x0B12}
+sub GL_SOURCE0_ALPHA {0x8588}
+sub GL_SOURCE0_ALPHA_ARB {0x8588}
+sub GL_SOURCE0_ALPHA_EXT {0x8588}
+sub GL_SOURCE0_RGB {0x8580}
+sub GL_SOURCE0_RGB_ARB {0x8580}
+sub GL_SOURCE0_RGB_EXT {0x8580}
+sub GL_SOURCE1_ALPHA {0x8589}
+sub GL_SOURCE1_ALPHA_ARB {0x8589}
+sub GL_SOURCE1_ALPHA_EXT {0x8589}
+sub GL_SOURCE1_RGB {0x8581}
+sub GL_SOURCE1_RGB_ARB {0x8581}
+sub GL_SOURCE1_RGB_EXT {0x8581}
+sub GL_SOURCE2_ALPHA {0x858A}
+sub GL_SOURCE2_ALPHA_ARB {0x858A}
+sub GL_SOURCE2_ALPHA_EXT {0x858A}
+sub GL_SOURCE2_RGB {0x8582}
+sub GL_SOURCE2_RGB_ARB {0x8582}
+sub GL_SOURCE2_RGB_EXT {0x8582}
+sub GL_SOURCE3_ALPHA_NV {0x858B}
+sub GL_SOURCE3_RGB_NV {0x8583}
+sub GL_SPARE0_NV {0x852E}
+sub GL_SPARE0_PLUS_SECONDARY_COLOR_NV {0x8532}
+sub GL_SPARE1_NV {0x852F}
+sub GL_SPECULAR {0x1202}
+sub GL_SPHERE_MAP {0x2402}
+sub GL_SPOT_CUTOFF {0x1206}
+sub GL_SPOT_DIRECTION {0x1204}
+sub GL_SPOT_EXPONENT {0x1205}
+sub GL_SRC_ALPHA {0x0302}
+sub GL_SRC_ALPHA_SATURATE {0x0308}
+sub GL_SRC_COLOR {0x0300}
+sub GL_STACK_OVERFLOW {0x0503}
+sub GL_STACK_UNDERFLOW {0x0504}
+sub GL_STATIC_COPY_ARB {0x88E6}
+sub GL_STATIC_DRAW_ARB {0x88E4}
+sub GL_STATIC_READ_ARB {0x88E5}
+sub GL_STENCIL {0x1802}
+sub GL_STENCIL_BITS {0x0D57}
+sub GL_STENCIL_BUFFER_BIT {0x00000400}
+sub GL_STENCIL_CLEAR_VALUE {0x0B91}
+sub GL_STENCIL_FAIL {0x0B94}
+sub GL_STENCIL_FUNC {0x0B92}
+sub GL_STENCIL_INDEX {0x1901}
+sub GL_STENCIL_PASS_DEPTH_FAIL {0x0B95}
+sub GL_STENCIL_PASS_DEPTH_PASS {0x0B96}
+sub GL_STENCIL_REF {0x0B97}
+sub GL_STENCIL_TEST {0x0B90}
+sub GL_STENCIL_TEST_TWO_SIDE_EXT {0x8910}
+sub GL_STENCIL_VALUE_MASK {0x0B93}
+sub GL_STENCIL_WRITEMASK {0x0B98}
+sub GL_STEREO {0x0C33}
+sub GL_STREAM_COPY_ARB {0x88E2}
+sub GL_STREAM_DRAW_ARB {0x88E0}
+sub GL_STREAM_READ_ARB {0x88E1}
+sub GL_SUBPIXEL_BITS {0x0D50}
+sub GL_SUBTRACT {0x84E7}
+sub GL_SUBTRACT_ARB {0x84E7}
+sub GL_T {0x2001}
+sub GL_T2F_C3F_V3F {0x2A2A}
+sub GL_T2F_C4F_N3F_V3F {0x2A2C}
+sub GL_T2F_C4UB_V3F {0x2A29}
+sub GL_T2F_N3F_V3F {0x2A2B}
+sub GL_T2F_V3F {0x2A27}
+sub GL_T4F_C4F_N3F_V4F {0x2A2D}
+sub GL_T4F_V4F {0x2A28}
+sub GL_TABLE_TOO_LARGE {0x8031}
+sub GL_TABLE_TOO_LARGE_EXT {0x8031}
+sub GL_TBUFFER_WRITE_MASK_3DFX {0x86D8}
+sub GL_TEXTURE {0x1702}
+sub GL_TEXTURE0 {0x84C0}
+sub GL_TEXTURE0_ARB {0x84C0}
+sub GL_TEXTURE0_SGIS {0x835E}
+sub GL_TEXTURE1 {0x84C1}
+sub GL_TEXTURE10 {0x84CA}
+sub GL_TEXTURE10_ARB {0x84CA}
+sub GL_TEXTURE11 {0x84CB}
+sub GL_TEXTURE11_ARB {0x84CB}
+sub GL_TEXTURE12 {0x84CC}
+sub GL_TEXTURE12_ARB {0x84CC}
+sub GL_TEXTURE13 {0x84CD}
+sub GL_TEXTURE13_ARB {0x84CD}
+sub GL_TEXTURE14 {0x84CE}
+sub GL_TEXTURE14_ARB {0x84CE}
+sub GL_TEXTURE15 {0x84CF}
+sub GL_TEXTURE15_ARB {0x84CF}
+sub GL_TEXTURE16 {0x84D0}
+sub GL_TEXTURE16_ARB {0x84D0}
+sub GL_TEXTURE17 {0x84D1}
+sub GL_TEXTURE17_ARB {0x84D1}
+sub GL_TEXTURE18 {0x84D2}
+sub GL_TEXTURE18_ARB {0x84D2}
+sub GL_TEXTURE19 {0x84D3}
+sub GL_TEXTURE19_ARB {0x84D3}
+sub GL_TEXTURE1_ARB {0x84C1}
+sub GL_TEXTURE1_SGIS {0x835F}
+sub GL_TEXTURE2 {0x84C2}
+sub GL_TEXTURE20 {0x84D4}
+sub GL_TEXTURE20_ARB {0x84D4}
+sub GL_TEXTURE21 {0x84D5}
+sub GL_TEXTURE21_ARB {0x84D5}
+sub GL_TEXTURE22 {0x84D6}
+sub GL_TEXTURE22_ARB {0x84D6}
+sub GL_TEXTURE23 {0x84D7}
+sub GL_TEXTURE23_ARB {0x84D7}
+sub GL_TEXTURE24 {0x84D8}
+sub GL_TEXTURE24_ARB {0x84D8}
+sub GL_TEXTURE25 {0x84D9}
+sub GL_TEXTURE25_ARB {0x84D9}
+sub GL_TEXTURE26 {0x84DA}
+sub GL_TEXTURE26_ARB {0x84DA}
+sub GL_TEXTURE27 {0x84DB}
+sub GL_TEXTURE27_ARB {0x84DB}
+sub GL_TEXTURE28 {0x84DC}
+sub GL_TEXTURE28_ARB {0x84DC}
+sub GL_TEXTURE29 {0x84DD}
+sub GL_TEXTURE29_ARB {0x84DD}
+sub GL_TEXTURE2_ARB {0x84C2}
+sub GL_TEXTURE2_SGIS {0x8360}
+sub GL_TEXTURE3 {0x84C3}
+sub GL_TEXTURE30 {0x84DE}
+sub GL_TEXTURE30_ARB {0x84DE}
+sub GL_TEXTURE31 {0x84DF}
+sub GL_TEXTURE31_ARB {0x84DF}
+sub GL_TEXTURE3_ARB {0x84C3}
+sub GL_TEXTURE3_SGIS {0x8361}
+sub GL_TEXTURE4 {0x84C4}
+sub GL_TEXTURE4_ARB {0x84C4}
+sub GL_TEXTURE5 {0x84C5}
+sub GL_TEXTURE5_ARB {0x84C5}
+sub GL_TEXTURE6 {0x84C6}
+sub GL_TEXTURE6_ARB {0x84C6}
+sub GL_TEXTURE7 {0x84C7}
+sub GL_TEXTURE7_ARB {0x84C7}
+sub GL_TEXTURE8 {0x84C8}
+sub GL_TEXTURE8_ARB {0x84C8}
+sub GL_TEXTURE9 {0x84C9}
+sub GL_TEXTURE9_ARB {0x84C9}
+sub GL_TEXTURE_1D {0x0DE0}
+sub GL_TEXTURE_2D {0x0DE1}
+sub GL_TEXTURE_3D {0x806F}
+sub GL_TEXTURE_3D_EXT {0x806F}
+sub GL_TEXTURE_ALPHA_SIZE {0x805F}
+sub GL_TEXTURE_BASE_LEVEL {0x813C}
+sub GL_TEXTURE_BASE_LEVEL_SGIS {0x813C}
+sub GL_TEXTURE_BINDING_1D {0x8068}
+sub GL_TEXTURE_BINDING_2D {0x8069}
+sub GL_TEXTURE_BINDING_3D {0x806A}
+sub GL_TEXTURE_BINDING_CUBE_MAP {0x8514}
+sub GL_TEXTURE_BINDING_CUBE_MAP_ARB {0x8514}
+sub GL_TEXTURE_BINDING_CUBE_MAP_EXT {0x8514}
+sub GL_TEXTURE_BINDING_RECTANGLE_NV {0x84F6}
+sub GL_TEXTURE_BIT {0x00040000}
+sub GL_TEXTURE_BLUE_SIZE {0x805E}
+sub GL_TEXTURE_BORDER {0x1005}
+sub GL_TEXTURE_BORDER_COLOR {0x1004}
+sub GL_TEXTURE_BORDER_VALUES_NV {0x871A}
+sub GL_TEXTURE_COLOR_WRITEMASK_SGIS {0x81EF}
+sub GL_TEXTURE_COMPARE_FAIL_VALUE_ARB {0x80BF}
+sub GL_TEXTURE_COMPARE_FUNC {0x884D}
+sub GL_TEXTURE_COMPARE_FUNC_ARB {0x884D}
+sub GL_TEXTURE_COMPARE_MODE {0x884C}
+sub GL_TEXTURE_COMPARE_MODE_ARB {0x884C}
+sub GL_TEXTURE_COMPARE_OPERATOR_SGIX {0x819B}
+sub GL_TEXTURE_COMPARE_SGIX {0x819A}
+sub GL_TEXTURE_COMPONENTS {0x1003}
+sub GL_TEXTURE_COMPRESSED {0x86A1}
+sub GL_TEXTURE_COMPRESSED_ARB {0x86A1}
+sub GL_TEXTURE_COMPRESSED_IMAGE_SIZE {0x86A0}
+sub GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB {0x86A0}
+sub GL_TEXTURE_COMPRESSION_HINT {0x84EF}
+sub GL_TEXTURE_COMPRESSION_HINT_ARB {0x84EF}
+sub GL_TEXTURE_COORD_ARRAY {0x8078}
+sub GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB {0x889A}
+sub GL_TEXTURE_COORD_ARRAY_COUNT_EXT {0x808B}
+sub GL_TEXTURE_COORD_ARRAY_EXT {0x8078}
+sub GL_TEXTURE_COORD_ARRAY_POINTER {0x8092}
+sub GL_TEXTURE_COORD_ARRAY_POINTER_EXT {0x8092}
+sub GL_TEXTURE_COORD_ARRAY_SIZE {0x8088}
+sub GL_TEXTURE_COORD_ARRAY_SIZE_EXT {0x8088}
+sub GL_TEXTURE_COORD_ARRAY_STRIDE {0x808A}
+sub GL_TEXTURE_COORD_ARRAY_STRIDE_EXT {0x808A}
+sub GL_TEXTURE_COORD_ARRAY_TYPE {0x8089}
+sub GL_TEXTURE_COORD_ARRAY_TYPE_EXT {0x8089}
+sub GL_TEXTURE_CUBE_MAP {0x8513}
+sub GL_TEXTURE_CUBE_MAP_ARB {0x8513}
+sub GL_TEXTURE_CUBE_MAP_EXT {0x8513}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_X {0x8516}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB {0x8516}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT {0x8516}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_Y {0x8518}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB {0x8518}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT {0x8518}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_Z {0x851A}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB {0x851A}
+sub GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT {0x851A}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_X {0x8515}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB {0x8515}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT {0x8515}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_Y {0x8517}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB {0x8517}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT {0x8517}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_Z {0x8519}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB {0x8519}
+sub GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT {0x8519}
+sub GL_TEXTURE_DEPTH {0x8071}
+sub GL_TEXTURE_DEPTH_EXT {0x8071}
+sub GL_TEXTURE_DEPTH_SIZE {0x884A}
+sub GL_TEXTURE_DEPTH_SIZE_ARB {0x884A}
+sub GL_TEXTURE_DS_SIZE_NV {0x871D}
+sub GL_TEXTURE_DT_SIZE_NV {0x871E}
+sub GL_TEXTURE_ENV {0x2300}
+sub GL_TEXTURE_ENV_COLOR {0x2201}
+sub GL_TEXTURE_ENV_MODE {0x2200}
+sub GL_TEXTURE_FILTER_CONTROL {0x8500}
+sub GL_TEXTURE_FILTER_CONTROL_EXT {0x8500}
+sub GL_TEXTURE_FLOAT_COMPONENTS_NV {0x888C}
+sub GL_TEXTURE_GEN_MODE {0x2500}
+sub GL_TEXTURE_GEN_Q {0x0C63}
+sub GL_TEXTURE_GEN_R {0x0C62}
+sub GL_TEXTURE_GEN_S {0x0C60}
+sub GL_TEXTURE_GEN_T {0x0C61}
+sub GL_TEXTURE_GEQUAL_R_SGIX {0x819D}
+sub GL_TEXTURE_GREEN_SIZE {0x805D}
+sub GL_TEXTURE_HEIGHT {0x1001}
+sub GL_TEXTURE_HI_SIZE_NV {0x871B}
+sub GL_TEXTURE_INDEX_SIZE_EXT {0x80ED}
+sub GL_TEXTURE_INTENSITY_SIZE {0x8061}
+sub GL_TEXTURE_INTERNAL_FORMAT {0x1003}
+sub GL_TEXTURE_LEQUAL_R_SGIX {0x819C}
+sub GL_TEXTURE_LOD_BIAS {0x8501}
+sub GL_TEXTURE_LOD_BIAS_EXT {0x8501}
+sub GL_TEXTURE_LO_SIZE_NV {0x871C}
+sub GL_TEXTURE_LUMINANCE_SIZE {0x8060}
+sub GL_TEXTURE_MAG_FILTER {0x2800}
+sub GL_TEXTURE_MAG_SIZE_NV {0x871F}
+sub GL_TEXTURE_MATRIX {0x0BA8}
+sub GL_TEXTURE_MAX_ANISOTROPY_EXT {0x84FE}
+sub GL_TEXTURE_MAX_LEVEL {0x813D}
+sub GL_TEXTURE_MAX_LEVEL_SGIS {0x813D}
+sub GL_TEXTURE_MAX_LOD {0x813B}
+sub GL_TEXTURE_MAX_LOD_SGIS {0x813B}
+sub GL_TEXTURE_MIN_FILTER {0x2801}
+sub GL_TEXTURE_MIN_LOD {0x813A}
+sub GL_TEXTURE_MIN_LOD_SGIS {0x813A}
+sub GL_TEXTURE_PRIORITY {0x8066}
+sub GL_TEXTURE_RECTANGLE_NV {0x84F5}
+sub GL_TEXTURE_RED_SIZE {0x805C}
+sub GL_TEXTURE_RESIDENT {0x8067}
+sub GL_TEXTURE_SHADER_NV {0x86DE}
+sub GL_TEXTURE_STACK_DEPTH {0x0BA5}
+sub GL_TEXTURE_UNSIGNED_REMAP_MODE_NV {0x888F}
+sub GL_TEXTURE_WIDTH {0x1000}
+sub GL_TEXTURE_WRAP_R {0x8072}
+sub GL_TEXTURE_WRAP_R_EXT {0x8072}
+sub GL_TEXTURE_WRAP_S {0x2802}
+sub GL_TEXTURE_WRAP_T {0x2803}
+sub GL_TRACK_MATRIX_NV {0x8648}
+sub GL_TRACK_MATRIX_TRANSFORM_NV {0x8649}
+sub GL_TRANSFORM_BIT {0x00001000}
+sub GL_TRANSFORM_HINT_APPLE {0x85B1}
+sub GL_TRANSPOSE_COLOR_MATRIX {0x84E6}
+sub GL_TRANSPOSE_COLOR_MATRIX_ARB {0x84E6}
+sub GL_TRANSPOSE_CURRENT_MATRIX_ARB {0x88B7}
+sub GL_TRANSPOSE_MODELVIEW_MATRIX {0x84E3}
+sub GL_TRANSPOSE_MODELVIEW_MATRIX_ARB {0x84E3}
+sub GL_TRANSPOSE_NV {0x862C}
+sub GL_TRANSPOSE_PROJECTION_MATRIX {0x84E4}
+sub GL_TRANSPOSE_PROJECTION_MATRIX_ARB {0x84E4}
+sub GL_TRANSPOSE_TEXTURE_MATRIX {0x84E5}
+sub GL_TRANSPOSE_TEXTURE_MATRIX_ARB {0x84E5}
+sub GL_TRIANGLES {0x0004}
+sub GL_TRIANGLE_FAN {0x0006}
+sub GL_TRIANGLE_STRIP {0x0005}
+sub GL_TRUE {1}
+sub GL_UNPACK_ALIGNMENT {0x0CF5}
+sub GL_UNPACK_IMAGE_HEIGHT {0x806E}
+sub GL_UNPACK_IMAGE_HEIGHT_EXT {0x806E}
+sub GL_UNPACK_LSB_FIRST {0x0CF1}
+sub GL_UNPACK_ROW_LENGTH {0x0CF2}
+sub GL_UNPACK_SKIP_IMAGES {0x806D}
+sub GL_UNPACK_SKIP_IMAGES_EXT {0x806D}
+sub GL_UNPACK_SKIP_PIXELS {0x0CF4}
+sub GL_UNPACK_SKIP_ROWS {0x0CF3}
+sub GL_UNPACK_SWAP_BYTES {0x0CF0}
+sub GL_UNSIGNED_BYTE {0x1401}
+sub GL_UNSIGNED_BYTE_2_3_3_REV {0x8362}
+sub GL_UNSIGNED_BYTE_3_3_2 {0x8032}
+sub GL_UNSIGNED_BYTE_3_3_2_EXT {0x8032}
+sub GL_UNSIGNED_IDENTITY_NV {0x8536}
+sub GL_UNSIGNED_INT {0x1405}
+sub GL_UNSIGNED_INT_10_10_10_2 {0x8036}
+sub GL_UNSIGNED_INT_10_10_10_2_EXT {0x8036}
+sub GL_UNSIGNED_INT_24_8_NV {0x84FA}
+sub GL_UNSIGNED_INT_2_10_10_10_REV {0x8368}
+sub GL_UNSIGNED_INT_8_8_8_8 {0x8035}
+sub GL_UNSIGNED_INT_8_8_8_8_EXT {0x8035}
+sub GL_UNSIGNED_INT_8_8_8_8_REV {0x8367}
+sub GL_UNSIGNED_INT_8_8_S8_S8_REV_NV {0x86DB}
+sub GL_UNSIGNED_INT_S10_S11_S11_REV_NV {0x886B}
+sub GL_UNSIGNED_INT_S8_S8_8_8_NV {0x86DA}
+sub GL_UNSIGNED_INVERT_NV {0x8537}
+sub GL_UNSIGNED_SHORT {0x1403}
+sub GL_UNSIGNED_SHORT_1_5_5_5_REV {0x8366}
+sub GL_UNSIGNED_SHORT_4_4_4_4 {0x8033}
+sub GL_UNSIGNED_SHORT_4_4_4_4_EXT {0x8033}
+sub GL_UNSIGNED_SHORT_4_4_4_4_REV {0x8365}
+sub GL_UNSIGNED_SHORT_5_5_5_1 {0x8034}
+sub GL_UNSIGNED_SHORT_5_5_5_1_EXT {0x8034}
+sub GL_UNSIGNED_SHORT_5_6_5 {0x8363}
+sub GL_UNSIGNED_SHORT_5_6_5_REV {0x8364}
+sub GL_V2F {0x2A20}
+sub GL_V3F {0x2A21}
+sub GL_VARIABLE_A_NV {0x8523}
+sub GL_VARIABLE_B_NV {0x8524}
+sub GL_VARIABLE_C_NV {0x8525}
+sub GL_VARIABLE_D_NV {0x8526}
+sub GL_VARIABLE_E_NV {0x8527}
+sub GL_VARIABLE_F_NV {0x8528}
+sub GL_VARIABLE_G_NV {0x8529}
+sub GL_VENDOR {0x1F00}
+sub GL_VERSION {0x1F02}
+sub GL_VERTEX_ARRAY {0x8074}
+sub GL_VERTEX_ARRAY_BUFFER_BINDING_ARB {0x8896}
+sub GL_VERTEX_ARRAY_COUNT_EXT {0x807D}
+sub GL_VERTEX_ARRAY_EXT {0x8074}
+sub GL_VERTEX_ARRAY_POINTER {0x808E}
+sub GL_VERTEX_ARRAY_POINTER_EXT {0x808E}
+sub GL_VERTEX_ARRAY_RANGE_LENGTH_NV {0x851E}
+sub GL_VERTEX_ARRAY_RANGE_NV {0x851D}
+sub GL_VERTEX_ARRAY_RANGE_POINTER_NV {0x8521}
+sub GL_VERTEX_ARRAY_RANGE_VALID_NV {0x851F}
+sub GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV {0x8533}
+sub GL_VERTEX_ARRAY_SIZE {0x807A}
+sub GL_VERTEX_ARRAY_SIZE_EXT {0x807A}
+sub GL_VERTEX_ARRAY_STRIDE {0x807C}
+sub GL_VERTEX_ARRAY_STRIDE_EXT {0x807C}
+sub GL_VERTEX_ARRAY_TYPE {0x807B}
+sub GL_VERTEX_ARRAY_TYPE_EXT {0x807B}
+sub GL_VERTEX_ATTRIB_ARRAY0_NV {0x8650}
+sub GL_VERTEX_ATTRIB_ARRAY10_NV {0x865A}
+sub GL_VERTEX_ATTRIB_ARRAY11_NV {0x865B}
+sub GL_VERTEX_ATTRIB_ARRAY12_NV {0x865C}
+sub GL_VERTEX_ATTRIB_ARRAY13_NV {0x865D}
+sub GL_VERTEX_ATTRIB_ARRAY14_NV {0x865E}
+sub GL_VERTEX_ATTRIB_ARRAY15_NV {0x865F}
+sub GL_VERTEX_ATTRIB_ARRAY1_NV {0x8651}
+sub GL_VERTEX_ATTRIB_ARRAY2_NV {0x8652}
+sub GL_VERTEX_ATTRIB_ARRAY3_NV {0x8653}
+sub GL_VERTEX_ATTRIB_ARRAY4_NV {0x8654}
+sub GL_VERTEX_ATTRIB_ARRAY5_NV {0x8655}
+sub GL_VERTEX_ATTRIB_ARRAY6_NV {0x8656}
+sub GL_VERTEX_ATTRIB_ARRAY7_NV {0x8657}
+sub GL_VERTEX_ATTRIB_ARRAY8_NV {0x8658}
+sub GL_VERTEX_ATTRIB_ARRAY9_NV {0x8659}
+sub GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB {0x889F}
+sub GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB {0x8622}
+sub GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB {0x886A}
+sub GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB {0x8645}
+sub GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB {0x8623}
+sub GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB {0x8624}
+sub GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB {0x8625}
+sub GL_VERTEX_PROGRAM_ARB {0x8620}
+sub GL_VERTEX_PROGRAM_BINDING_NV {0x864A}
+sub GL_VERTEX_PROGRAM_NV {0x8620}
+sub GL_VERTEX_PROGRAM_POINT_SIZE_ARB {0x8642}
+sub GL_VERTEX_PROGRAM_POINT_SIZE_NV {0x8642}
+sub GL_VERTEX_PROGRAM_TWO_SIDE_ARB {0x8643}
+sub GL_VERTEX_PROGRAM_TWO_SIDE_NV {0x8643}
+sub GL_VERTEX_STATE_PROGRAM_NV {0x8621}
+sub GL_VERTEX_WEIGHTING_EXT {0x8509}
+sub GL_VERTEX_WEIGHT_ARRAY_EXT {0x850C}
+sub GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT {0x8510}
+sub GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT {0x850D}
+sub GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT {0x850F}
+sub GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT {0x850E}
+sub GL_VIBRANCE_BIAS_NV {0x8719}
+sub GL_VIBRANCE_SCALE_NV {0x8713}
+sub GL_VIEWPORT {0x0BA2}
+sub GL_VIEWPORT_BIT {0x00000800}
+sub GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB {0x889E}
+sub GL_WRITE_ONLY_ARB {0x88B9}
+sub GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV {0x887A}
+sub GL_WRITE_PIXEL_DATA_RANGE_NV {0x8878}
+sub GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV {0x887C}
+sub GL_XOR {0x1506}
+sub GL_YCRYCB_422_NVX {0x600B}
+sub GL_ZERO {0}
+sub GL_ZOOM_X {0x0D16}
+sub GL_ZOOM_Y {0x0D17}
--- /dev/null
+#
+# Palette.pm
+#
+# a module for manipulating SDL_Palette *
+#
+# Copyright (C) 2000,2002 David J. Goehrig
+
+package SDL::Palette;
+use strict;
+
+# NB: there is no palette destructor because most of the time the
+# palette will be owned by a surface, so any palettes you create
+# with new, won't be destroyed until the program ends!
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $image;
+ my $self;
+ if (@_) {
+ $image = shift;
+ $self = \$image->palette();
+ } else {
+ $self = \SDL::NewPalette(256);
+ }
+ bless $self, $class;
+ return $self;
+}
+
+sub size {
+ my $self = shift;
+ return SDL::PaletteNColors($$self);
+}
+
+sub color {
+ my $self = shift;
+ my $index = shift;
+ my ($r,$g,$b);
+ if (@_) {
+ $r = shift; $g = shift; $b = shift;
+ return SDL::PaletteColors($$self,$index,$r,$g,$b);
+ } else {
+ return SDL::PaletteColors($$self,$index);
+ }
+}
+
+sub red {
+ my $self = shift;
+ my $index = shift;
+ my $c;
+ if (@_) {
+ $c = shift;
+ return SDL::ColorR(
+ SDL::PaletteColors($$self,$index),$c);
+ } else {
+ return SDL::ColorR(
+ SDL::PaletteColors($$self,$index));
+ }
+}
+
+sub green {
+ my $self = shift;
+ my $index = shift;
+ my $c;
+ if (@_) {
+ $c = shift;
+ return SDL::ColorG(
+ SDL::PaletteColors($$self,$index),$c);
+ } else {
+ return SDL::ColorG(
+ SDL::PaletteColors($$self,$index));
+ }
+}
+
+sub blue {
+ my $self = shift;
+ my $index = shift;
+ my $c;
+ if (@_) {
+ $c = shift;
+ return SDL::ColorB(
+ SDL::PaletteColors($$self,$index),$c);
+ } else {
+ return SDL::ColorB(
+ SDL::PaletteColors($$self,$index));
+ }
+}
+
+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
--- /dev/null
+#
+# Rect.pm
+#
+# A package for manipulating SDL_Rect *
+#
+# Copyright (C) 2003 David J. Goehrig
+
+package SDL::Rect;
+use strict;
+use SDL;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my %options = @_;
+
+ verify (%options, qw/ -x -y -width -height -w -h / ) if $SDL::DEBUG;
+
+ my $x = $options{-x} || 0;
+ my $y = $options{-y} || 0;
+ my $w = $options{-width} || $options{-w} || 0;
+ my $h = $options{-height} || $options{-h} || 0;
+
+ my $self = \SDL::NewRect($x,$y,$w,$h);
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ SDL::FreeRect(${$_[0]});
+}
+
+sub x {
+ my $self = shift;
+ SDL::RectX($$self,@_);
+}
+
+sub y {
+ my $self = shift;
+ SDL::RectY($$self,@_);
+}
+
+sub width {
+ my $self = shift;
+ SDL::RectW($$self,@_);
+}
+
+sub height {
+ my $self = shift;
+ SDL::RectH($$self,@_);
+}
+
+1;
+
+__END__;
+
+=pod
+
+
+=head1 NAME
+
+SDL::Rect - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $rect = new SDL::Rect ( -height => 4, -width => 40 );
+
+=head1 DESCRIPTION
+
+C<SDL::Rect::new> creates a SDL_Rect structure which is
+used for specifying regions for filling, blitting, and updating.
+These objects make it easy to cut and backfill.
+By default, x, y, h, w are 0.
+
+=head2 METHODS
+
+The four fields of a rectangle can be set simply
+by passing a value to the applicable method. These are:
+
+=over 4
+
+=item *
+
+C<SDL::Rect::x> sets and fetches the x position.
+
+=item *
+
+C<SDL::Rect::y> sets and fetches the y position.
+
+=item *
+
+C<SDL::Rect::width> sets and fetched the width.
+
+=item *
+
+C<SDL::Rect::height> sets and fetched the height.
+
+=back
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+perl(1) SDL::Surface(3)
+
+
+=cut
+
--- /dev/null
+# SDL::OpenGL.pm
+#
+# SFont bitmat font support
+#
+# Copyright (C) 2004 David J. Goehrig
+
+package SDL::SFont;
+
+require Exporter;
+require DynaLoader;
+use vars qw(
+ @EXPORT
+ @ISA
+);
+@ISA=qw(Exporter DynaLoader);
+
+use SDL;
+
+BEGIN {
+
+};
+
+sub SDL_TEXTWIDTH {
+ return SDL::SFont::TextWidth(join('',@_));
+}
+
+
+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
--- /dev/null
+#
+# Sound.pm
+#
+# a SDL_mixer data module
+#
+# Copyright (C) 2000,2002 David J. Goehrig
+
+package SDL::Sound;
+use strict;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $filename = shift;
+ my $self = \SDL::MixLoadWAV($filename);
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ SDL::MixFreeChunk($$self);
+}
+
+sub volume {
+ my $self = shift;
+ my $volume = shift;
+ return SDL::MixVolumeChunk($$self,$volume);
+}
+
+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
--- /dev/null
+#
+# Surface.pm
+#
+# A package for manipulating SDL_Surface *
+#
+# Copyright (C) 2003 David J. Goehrig
+
+package SDL::Surface;
+
+use strict;
+use SDL;
+use SDL::SFont;
+use SDL::Color;
+use SDL::Rect;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my %options = @_;
+ my $self;
+
+ verify (%options, qw/ -name -n -flags -fl -width -w -height -h -depth -d
+ -pitch -p -Rmask -r -Gmask -g -Bmask -b -Amask -a
+ -from -f /) if $SDL::DEBUG;
+
+ if ( defined($options{-name}) && $options{-name} ne "" && exists $SDL::{IMGLoad} ) {
+ $self = \SDL::IMGLoad($options{-name});
+ } else {
+ my $f = $options{-flags} || $options{-fl} || SDL::SDL_ANYFORMAT();
+ my $w = $options{-width} || $options{-w} || 1;
+ my $h = $options{-height} || $options{-h} || 1;
+ my $d = $options{-depth} || $options{-d} || 8;
+ my $p = $options{-pitch} || $options{-p} || $w*$d;
+ my $r = $options{-Rmask} || $options{-r}
+ || ( SDL::BigEndian() ? 0xff000000 : 0x000000ff );
+ my $g = $options{-Gmask} || $options{-g}
+ || ( SDL::BigEndian() ? 0x00ff0000 : 0x0000ff00 );
+ my $b = $options{-Bmask} || $options{-b}
+ || ( SDL::BigEndian() ? 0x0000ff00 : 0x00ff0000 );
+ my $a = $options{-Amask} || $options{-a}
+ || ( SDL::BigEndian() ? 0x000000ff : 0xff000000 );
+
+ if ( $options{-from}|| $options{-f} ) {
+ my $src = $options{-from}|| $options{-f};
+ $self = \SDL::CreateRGBSurfaceFrom($src,$w,$h,$d,$p,$r,$g,$b,$a);
+ } else {
+ $self = \SDL::CreateRGBSurface($f,$w,$h,$d,$r,$g,$b,$a);
+ }
+ }
+ die "SDL::Surface::new failed. ", SDL::GetError()
+ unless ( $$self);
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ SDL::FreeSurface(${$_[0]});
+}
+
+sub flags {
+ SDL::SurfaceFlags(${$_[0]});
+}
+
+sub palette {
+ SDL::SurfacePalette(${$_[0]});
+}
+
+sub bpp {
+ SDL::SurfaceBitsPerPixel(${$_[0]});
+}
+
+sub bytes_per_pixel {
+ SDL::SurfaceBytesPerPixel(${$_[0]});
+}
+
+sub Rshift {
+ SDL::SurfaceRshift(${$_[0]});
+}
+
+sub Gshift {
+ SDL::SurfaceGshift(${$_[0]});
+}
+
+sub Bshift {
+ SDL::SurfaceBshift(${$_[0]});
+}
+
+sub Ashift {
+ SDL::SurfaceAshift(${$_[0]});
+}
+
+sub Rmask {
+ SDL::SurfaceRmask(${$_[0]});
+}
+
+sub Gmask {
+ SDL::SurfaceGmask(${$_[0]});
+}
+
+sub Bmask {
+ SDL::SurfaceBmask(${$_[0]});
+}
+
+sub Amask {
+ SDL::SurfaceAmask(${$_[0]});
+}
+
+sub color_key {
+ SDL::SurfaceColorKey(${$_[0]});
+}
+
+sub alpha {
+ SDL::SurfaceAlpha(${$_[0]});
+}
+
+sub width {
+ SDL::SurfaceW(${$_[0]});
+}
+
+sub height {
+ SDL::SurfaceH(${$_[0]});
+}
+
+sub pitch {
+ SDL::SurfacePitch(${$_[0]});
+}
+
+sub pixels {
+ SDL::SurfacePixels(${$_[0]});
+}
+
+sub pixel {
+ die "SDL::Surface::pixel requires a SDL::Color"
+ if $_[3] && $SDL::DEBUG && !$_[3]->isa("SDL::Color");
+ $_[3] ?
+ new SDL::Color -color => SDL::SurfacePixel(${$_[0]},$_[1],$_[2],${$_[3]}) :
+ new SDL::Color -color => SDL::SurfacePixel(${$_[0]},$_[1],$_[2]);
+}
+
+sub fill {
+ die "SDL::Surface::fill requires a SDL::Rect object"
+ unless !$SDL::DEBUG || $_[1] == 0 || $_[1]->isa('SDL::Rect');
+ die "SDL::Surface::fill requires a SDL::Color object"
+ unless !$SDL::DEBUG || $_[2]->isa('SDL::Color');
+ if ($_[1] == 0 ) {
+ SDL::FillRect(${$_[0]},0,${$_[2]});
+ } else {
+ SDL::FillRect(${$_[0]},${$_[1]},${$_[2]});
+ }
+}
+
+sub lockp {
+ SDL::MUSTLOCK(${$_[0]});
+}
+
+sub lock {
+ SDL::SurfaceLock(${$_[0]});
+}
+
+sub unlock {
+ SDL::SurfaceUnlock(${$_[0]});
+}
+
+sub update {
+ my $self = shift;;
+ if ($SDL::DEBUG) {
+ for (@_) {
+ die "SDL::Surface::update requires SDL::Rect objects"
+ unless $_->isa('SDL::Rect');
+ }
+ }
+ SDL::UpdateRects($$self, map { ${$_} } @_ );
+}
+
+sub flip {
+ SDL::Flip(${$_[0]});
+}
+
+sub blit {
+ if ($SDL::DEBUG) {
+ die "SDL::Surface::blit requires SDL::Rect objects"
+ unless ($_[1] == 0 || $_[1]->isa('SDL::Rect'))
+ && ($_[3] == 0 || $_[3]->isa('SDL::Rect'));
+ die "SDL::Surface::blit requires SDL::Surface objects"
+ unless $_[2]->isa('SDL::Surface');
+ }
+ SDL::BlitSurface(map { $_ != 0 ? ${$_} : $_ } @_);
+}
+
+sub set_colors {
+ my $self = shift;
+ my $start = shift;
+ for (@_) {
+ die "SDL::Surface::set_colors requires SDL::Color objects"
+ unless !$SDL::DEBUG || $_->isa('SDL::Color');
+ }
+ return SDL::SetColors($$self, $start, map { ${$_} } @_);
+}
+
+sub set_color_key {
+ die "SDL::Surface::set_color_key requires a SDL::Color object"
+ unless !$SDL::DEBUG || (ref($_[2]) && $_[2]->isa('SDL::Color'));
+ SDL::SetColorKey(${$_[0]},$_[1],${$_[2]});
+}
+
+sub set_alpha {
+ SDL::SetAlpha(${$_[0]},$_[1],$_[2]);
+}
+
+sub display_format {
+ my $self = shift;
+ my $tmp = SDL::DisplayFormat($$self);
+ SDL::FreeSurface ($$self);
+ $$self = $tmp;
+ $self;
+}
+
+sub rgb {
+ my $self = shift;
+ my $tmp = SDL::ConvertRGB($$self);
+ SDL::FreeSurface($$self);
+ $$self = $tmp;
+ $self;
+}
+
+sub rgba {
+ my $self = shift;
+ my $tmp = SDL::ConvertRGBA($$self);
+ SDL::FreeSurface($$self);
+ $$self = $tmp;
+ $self;
+}
+
+sub rect {
+ my $self = shift;
+ new SDL::Rect -width => $self->width(), -height => $self->height(),
+ -x => $_[0] || 0, -y => $_[1] || 0;
+}
+
+sub print {
+ my ($self,$x,$y,@text) = @_;
+ SDL::SFont::PutString( $$self, $x, $y, join('',@text));
+}
+
+sub save_bmp {
+ SDL::SaveBMP( ${$_[0]},$_[1]);
+}
+
+sub video_info {
+ shift;
+ SDL::VideoInfo();
+}
+
+1;
+
+__END__;
+
+=pod
+
+=head1 NAME
+
+SDL::Surface - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ use SDL::Surface;
+ $image = new SDL::Surface(-name=>"yomama.jpg");
+
+=head1 DESCRIPTION
+
+The C<SDL::Surface> module encapsulates the SDL_Surface* structure, and
+many of its ancillatory functions. Not only is it a workhorse of the
+OO Layer, it is the base class for the C<SDL::App> class.
+
+=head1 EXPORTS
+
+ SDL_SWSURFACE SDL_HWSURFACE
+ SDL_ASYNCBLIT SDL_ANYFORMAT
+ SDL_HWPALETTE SDL_DOUBLEBUF
+ SDL_FULLSCREEN SDL_OPENGL
+ SDL_OPENGLBLIT SDL_RESIZEABLE
+ SDL_NOFRAME SDL_SRCCOLORKEY
+ SDL_RLEACCEL SDL_SRCALPHA
+ SDL_PREALLOC
+
+=head1 METHODS
+
+=head2 new (-name => 'foo.png')
+
+The C<SDL::Surface> class can be instantiated in a number of different ways.
+If support for the SDL_image library was included when SDL_perl was compiled,
+the easiest way to create a new surface is to use the C<SDL::Surface::new>
+method with the C<-name> option. This will load the image from the file
+and return an object encapsulating the SDL_Surface*.
+
+=head2 new (-from => $buffer, ... )
+
+If the contents of the new Surface is already in memory, C<SDL::Surface::new>
+may be called with the C<-from> option to create an image from that section
+of memory. This method takes the following additional parameters:
+
+=over 4
+
+=item *
+
+-width the width of the image in pixels
+
+=item *
+
+-height the height of the image in pixels
+
+=item *
+
+-depth the number of bits per pixel
+
+=item *
+
+-pitch the number of bytes per line
+
+=item *
+
+-Rmask an optional bitmask for red
+
+=item *
+
+-Gmask an optional bitmask for green
+
+=item *
+
+-Bmask an optional bitmask for green
+
+=item *
+
+-Amask an optional bitmask for alpha
+
+=back
+
+=head2 new ( -flags => SDL_SWSURFACE, ... )
+
+Finally, C<SDL::Suface::new> may be invoked with the C<-flags> option, in a
+similar fashion to the C<-from> directive. This invocation takes the same
+additional options as C<-from> with the exception of C<-pitch> which is ignored.
+This method returns a new, blank, SDL::Surface option with any of the following
+flags turned on:
+
+=over 4
+
+=item *
+
+SWSURFACE() a non-accelerated surface
+
+=item *
+
+HWSURFACE() a hardware accelerated surface
+
+=item *
+
+SRCCOLORKEY() a surface with a transperant color
+
+=item *
+
+SRCALPHA() an alpha blended, translucent surface
+
+=back
+
+=head2 flags ()
+
+C<SDL::Surface::flags> returns the flags with which the surface was initialized.
+
+=head2 palette ()
+
+C<SDL::Surface::palette> currently returns a SDL_Palette*, this may change in
+future revisions.
+
+=head2 bpp ()
+
+C<SDL::Surface::bpp> returns the bits per pixel of the surface
+
+=head2 bytes_per_pixel ()
+
+C<SDL::Surface::bytes_per_pixel> returns the bytes per pixel of the surface
+
+=head2 Rshift ()
+
+C<SDL::Surface::Rshift> returns the bit index of the red field for the surface's pixel format
+
+=head2 Gshift ()
+
+C<SDL::Surface::Gshift> returns the bit index of the green field for the surface's pixel format
+
+=head2 Bshift ()
+
+C<SDL::Surface::Bshift> returns the bit index of the blue field for the surface's pixel format
+
+=head2 Ashift ()
+
+C<SDL::Surface::Ashift> returns the bit index of the alpha field for the surface's pixel format
+
+=head2 Rmask ()
+
+C<SDL::Surface::Rmask> returns the bit mask for the red field for teh surface's pixel format
+
+=head2 Gmask ()
+
+C<SDL::Surface::Gmask> returns the bit mask for the green field for teh surface's pixel format
+
+=head2 Bmask ()
+
+C<SDL::Surface::Bmask> returns the bit mask for the blue field for teh surface's pixel format
+
+=head2 Amask ()
+
+C<SDL::Surface::Amask> returns the bit mask for the alpha field for teh surface's pixel format
+
+=head2 color_key ()
+
+C<SDL::Surface::color_key> returns the current color key for the image, which can be set with
+the C<SDL::Surface::set_color_key> method. Before calling C<SDL::Surface::color_key> on
+a image, you should fist call C<SDL::Surface::display_format> to convert it to the same
+format as the display. Failure to do so will result in failure to apply the correct color_key.
+
+=head2 alpha ()
+
+C<SDL::Surface::alpha> returns the current alpha value for the image, which can be set with
+the C<SDL::Surface::set_alpha> method.
+
+=head2 width ()
+
+C<SDL::Surface::width> returns the width in pixels of the surface
+
+=head2 height ()
+
+C<SDL::Surface::height> returns the height in pixels of the surface
+
+=head2 pitch ()
+
+C<SDL::Surface::pitch> returns the width of a surface's scanline in bytes
+
+=head2 pixels ()
+
+C<SDL::Surface::pixels> returns a Uint8* to the image's pixel data. This is not
+inherently useful within perl, though may be used to pass image data to user provided
+C functions.
+
+=head2 pixel (x,y,[color])
+
+C<SDL::Surface::pixel> will set the color value of the pixel at (x,y) to the given
+color if provided. C<SDL::Surface::pixel> returns a SDL::Color object for the
+color value of the pixel at (x,y) after any possible modifications.
+
+=head2 fill (rect,color)
+
+C<SDL::Surface::fill> will fill the given SDL::Rect rectangle with the specified SDL::Color
+This function optionally takes a SDL_Rect* and a SDL_Color*
+
+=head2 lockp ()
+
+C<SDL::Surface::lockp> returns true if the surface must be locked
+
+=head2 lock ()
+
+C<SDL::Surface::lock> places a hardware lock if necessary, preventing access to
+the surface's memory
+
+=head2 unlock ()
+
+C<SDL::Surface::unlock> removes any hardware locks, enabling blits
+
+=head2 update ( rects...)
+
+C<SDL::Surface::update> takes one or more SDL::Rect's which determine which sections
+of the image are to be updated. This option is only useful on the appliaction surface.
+
+=head2 flip ()
+
+C<SDL::Surface::flip> updates the full surface, using a double buffer if available
+
+=head2 blit (srect,dest,drect)
+
+C<SDL::Surface::blit> blits the current surface onto the destination surface,
+according to the provided rectangles. If a rectangle is 0, then the full surface is used.
+
+=head2 set_colors (start,colors...)
+
+C<SDL::Surface::set_colors> updates the palette starting at index C<start> with the
+supplied colors. The colors may either be SDL::Color objects or SDL_Color* from the
+low level C-style API.
+
+=head2 set_color_key (flag,pixel) or (flag,x,y)
+
+C<SDL::Surface::set_color_key> sets the blit flag, usually SDL_SRCCOLORKEY,
+to the specified L<SDL::Color> object. Optional a SDL_Color* may be passed.
+
+=head2 set_alpha (flag,alpha)
+
+C<SDL::Surface::set_alpha> sets the opacity of the image for alpha blits.
+C<alpha> takes a value from 0x00 to 0xff.
+
+=head2 display_format ()
+
+C<SDL::Surface::display_format> converts the surface to the same format as the
+current screen.
+
+=head2 rgb ()
+C<SDL::Surface::rgb> converts the surface to a 24 bit rgb format regardless of the
+initial format.
+
+=head2 rgba ()
+C<SDL::Surface::rgba> converts the surface to a 32 bit rgba format regarless of the
+initial format.
+
+=head2 print (x,y,text...)
+
+C<SDL::Surface::print> renders the text using the current font onto the image.
+This option is only supported for with SDL_image and SFont.
+
+=head2 save_bmp (filename)
+
+C<SDL::Surface::save_bmp> saves the surface to filename in Windows BMP format.
+
+=head2 video_info ()
+
+C<SDL::Surface::video_info> returns a hash describing the current state of the
+video hardware.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::App> L<SDL::Color> L<SDL::Palette> L<SDL::Rect>
+
+=cut
--- /dev/null
+# TTFont.pm
+#
+# a SDL perl extension for SDL_ttf support
+#
+# Copyright (C) David J. Goehrig 2002
+#
+
+package SDL::TTFont;
+
+use strict;
+use SDL;
+use SDL::Surface;
+
+use vars qw/ @ISA /;
+
+@ISA = qw(SDL::Surface);
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ my %options;
+ (%options) = @_;
+ $self->{-mode} = $options{-mode} || $options{-m} || TEXT_SHADED();
+ $self->{-name} = $options{-name} || $options{-n};
+ $self->{-size} = $options{-size} || $options{-s};
+ $self->{-fg} = $options{-foreground} || $options{-fg} || $SDL::Color::black;
+ $self->{-bg} = $options{-background} || $options{-bg} || $SDL::Color::white;
+
+ die "SDL::TTFont::new requires a -name\n"
+ unless ($$self{-name});
+
+ die "SDL::TTFont::new requires a -size\n"
+ unless ($$self{-size});
+
+ $self->{-font} = SDL::TTFOpenFont($self->{-name},$self->{-size});
+
+ die "Could not open font $$self{-name}, ", SDL::GetError(), "\n"
+ unless ($self->{-font});
+
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ SDL::FreeSurface($self->{-surface});
+ SDL::TTFCloseFont($self->{-font});
+}
+
+sub print {
+ my ($self,$surface,$x,$y,@text) = @_;
+
+ die "Print requies an SDL::Surface"
+ unless( ref($surface) && $surface->isa("SDL::Surface") );
+
+ SDL::FreeSurface($self->{-surface}) if ($$self{-surface});
+
+ $$self{-surface} = SDL::TTFPutString($$self{-font},$$self{-mode},
+ $$surface,$x,$y,${$$self{-fg}},${$$self{-bg}},join("",@text));
+
+ die "Could not print \"", join("",@text), "\" to surface, ",
+ SDL::GetError(), "\n" unless ($$self{-surface});
+}
+
+sub width {
+ my ($self,@text) = @_;
+ my $aref = SDL::TTFSizeText($$self{-font},join(" ",@text));
+ $$aref[0];
+}
+
+sub height {
+ my ($self) = @_;
+ SDL::TTFFontHeight($$self{-font});
+}
+
+sub ascent {
+ my ($self) = @_;
+ SDL::TTFFontAscent($$self{-font});
+}
+
+sub descent {
+ my ($self) = @_;
+ SDL::TTFFontDescent($$self{-font});
+}
+
+sub normal {
+ my ($self) = @_;
+ SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_NORMAL());
+}
+
+sub bold {
+ my ($self) = @_;
+ SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_BOLD());
+}
+
+sub italic {
+ my ($self) = @_;
+ SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_ITALIC());
+
+}
+
+sub underline {
+ my ($self) = @_;
+ SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_UNDERLINE());
+}
+
+sub text_shaded {
+ my ($self) = @_;
+ $$self{-mode} = TEXT_SHADED();
+}
+
+sub text_solid {
+ my ($self) = @_;
+ $$self{-mode} = TEXT_SOLID();
+}
+
+sub text_blended {
+ my ($self) = @_;
+ $$self{-mode} = TEXT_BLENDED();
+}
+
+sub utf8_shaded {
+ my ($self) = @_;
+ $$self{-mode} = UTF8_SHADED();
+}
+
+sub utf8_solid {
+ my ($self) = @_;
+ $$self{-mode} = UTF8_SOLID();
+}
+
+sub utf8_blended {
+ my ($self) = @_;
+ $$self{-mode} = UTF8_BLENDED();
+}
+
+sub unicode_shaded {
+ my ($self) = @_;
+ $$self{-mode} = UNICODE_SHADED();
+}
+
+sub unicode_solid {
+ my ($self) = @_;
+ $$self{-mode} = UNICODE_SOLID();
+}
+
+sub unicode_blended {
+ my ($self) = @_;
+ $$self{-mode} = UNICODE_BLENDED();
+}
+
+die "Could not initialize True Type Fonts\n"
+ if ( SDL::TTFInit() < 0);
+
+1;
+
+__END__;
+
+=pod
+
+=head1 NAME
+
+SDL::TTFont - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $font = new TTFont -name => "Utopia.ttf", -size => 18;
+
+=head1 DESCRIPTION
+
+L<SDL::TTFont> is a module for applying true type fonts to L<SDL::Surface>.
+
+=head1 AUTHOR
+
+David J. Goehrig
+
+=head1 SEE ALSO
+
+L<perl> L<SDL::Surface>
+
+=cut
--- /dev/null
+# Timer.pm
+#
+# A package for manipulating SDL_Timer *
+#
+# Copyright (C) 2002 David J. Goehrig
+
+package SDL::Timer;
+use strict;
+use SDL;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ my $func = shift;
+ my (%options) = @_;
+
+ verify(%options,qw/ -delay -times -d -t /);
+
+ die "SDL::Timer::new no delay specified\n"
+ unless ($options{-delay});
+ $$self{-delay} = $options{-delay} || $options{-d} || 0;
+ $$self{-times} = $options{-times} || $options{-t} || 0;
+ if ($$self{-times}) {
+ $$self{-routine} = sub { &$func($self); $$self{-delay} if(--$$self{-times}) };
+ } else {
+ $$self{-routine} = sub { &$func; $$self{-delay}};
+ }
+ $$self{-timer} = SDL::NewTimer($$self{-delay},$$self{-routine});
+ die "Could not create timer, ", SDL::GetError(), "\n"
+ unless ($self->{-timer});
+ bless $self,$class;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ SDL::RemoveTimer($$self{-timer}) if ($$self{-timer});
+ $$self{-timer} = 0;
+}
+
+sub run {
+ my ($self,$delay,$times) = @_;
+ $$self{-delay} = $delay;
+ $$self{-times} = $times;
+ SDL::RemoveTimer($$self{-timer}) if ($$self{-timer});
+ $$self{-timer} = SDL::AddTimer($$self{-delay},SDL::PerlTimerCallback,$$self{-routine});
+}
+
+sub stop {
+ my ($self) = @_;
+ SDL::RemoveTimer($$self{-timer}) if ($$self{-timer});
+ $$self{-timer} = 0;
+}
+
+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
--- /dev/null
+#
+# SDL::Tool::Font - format agnostic font tool
+#
+# Copyright (C) 2002 David J. Goehrig
+
+package SDL::Tool::Font;
+
+use SDL;
+use SDL::Font;
+use SDL::TTFont;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ $self = {};
+ my %option = @_;
+
+ verify (%option, qw/ -sfont -ttfont -size -fg -bg -foreground -background
+ -normal -bold -italic -underline / ) if $SDL::DEBUG;
+
+ if ($option{-sfont}) {
+ $$self{-font} = new SDL::Font $option{-sfont};
+ } elsif ($option{-ttfont} || $option{-t}) {
+ $option{-size} ||= 12;
+ $$self{-font} = new SDL::TTFont
+ -name => $option{-ttfont} || $option{-t},
+ -size => $option{-size} || $option{-s},
+ -fg => $option{-foreground} || $option{-fg} ,
+ -bg => $option{-background} || $option{-bg};
+ for (qw/ normal bold italic underline / ) {
+ if ($option{"-$_"}) {
+ &{"SDL::TTFont::$_"}($$self{-font});
+ }
+ }
+ } else {
+ die "SDL::Tool::Font requires either a -sfont or -ttfont";
+ }
+ bless $self,$class;
+ $self;
+}
+
+sub DESTROY {
+
+}
+
+sub print {
+ my ($self,$surface,$x,$y,@text) = @_;
+ die "Tool::Font::print requires a SDL::Surface\n"
+ unless ($SDL::DEBUG && $surface->isa('SDL::Surface'));
+ if ($$self{-font}->isa('SDL::Font')) {
+ $$self{-font}->use();
+ SDL::SFont::PutString( $$surface, $x, $y, join('',@text));
+ } else {
+ $$self{-font}->print($surface,$x,$y,@text);
+ }
+}
+
+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
--- /dev/null
+#
+# SDL::GraphicTool - zooming and rotating graphic tool
+#
+# Copyright (C) 2002 Russell E. Valentine
+# Copyright (C) 2002 David J. Goehrig
+
+package SDL::Tool::Graphic;
+
+use SDL;
+use SDL::Config;
+require SDL::Surface;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ $self = {};
+ bless $self, $class;
+ $self;
+}
+
+
+sub DESTROY {
+ # nothing to do
+}
+
+
+sub zoom {
+ my ( $self, $surface, $zoomx, $zoomy, $smooth) = @_;
+ die "SDL::Tool::Graphic::zoom requires an SDL::Surface\n"
+ unless ( ref($surface) && $surface->isa('SDL::Surface'));
+ my $tmp = $$surface;
+ $$surface = SDL::GFXZoom($$surface, $zoomx, $zoomy, $smooth);
+ SDL::FreeSurface($tmp);
+ $surface;
+}
+
+sub rotoZoom {
+ my ( $self, $surface, $angle, $zoom, $smooth) = @_;
+ die "SDL::Tool::Graphic::rotoZoom requires an SDL::Surface\n"
+ unless ( ref($surface) && $surface->isa('SDL::Surface'));
+ my $tmp = $$surface;
+ $$surface = SDL::GFXRotoZoom($$surface, $angle, $zoom, $smooth);
+ SDL::FreeSurface($tmp);
+ $surface;
+}
+
+sub grayScale {
+ my ( $self, $surface ) = @_;
+ if($surface->isa('SDL::Surface')) {
+ $workingSurface = $$surface;
+ } else {
+ $workingSurface = $surface;
+ }
+ my $color;
+ my $width = SDL::SurfaceW($workingSurface);
+ my $height = SDL::SurfaceH($workingSurface);
+ for(my $x = 0; $x < $width; $x++){
+ for(my $y = 0; $y < $height; $y++){
+ my $origValue = SDL::SurfacePixel($workingSurface, $x, $y);
+ my $newValue = int(0.3*SDL::ColorR($origValue) + 0.59 * SDL::ColorG($origValue) + 0.11*SDL::ColorB($origValue));
+ SDL::SurfacePixel($workingSurface, $x, $y, SDL::NewColor($newValue, $newValue, $newValue));
+ }
+ }
+
+ if($surface->isa('SDL::Surface')) {
+ $surface = \$workingSurface;
+ } else {
+ $surface = $workingSurface;
+ }
+}
+
+sub invertColor {
+ my ( $self, $surface ) = @_;
+ if($surface->isa('SDL::Surface')) {
+ $workingSurface = $$surface;
+ } else {
+ $workingSurface = $surface;
+ }
+ my $width = SDL::SurfaceW($workingSurface);
+ my $height = SDL::SurfaceH($workingSurface);
+ for(my $x = 0; $x < $width; $x++){
+ for(my $y = 0; $y < $height; $y++){
+ my $origValue = SDL::SurfacePixel($workingSurface, $x, $y);
+ my $newValue = int(0.3*SDL::ColorR($origValue) + 0.59 * SDL::ColorG($origValue) + 0.11*SDL::ColorB($origValue));
+ SDL::SurfacePixel($workingSurface, $x, $y, SDL::NewColor(255-SDL::ColorR($origValue), 255 - SDL::ColorG($origValue), 255 - SDL::ColorB($origValue)));
+ }
+ }
+
+ if($surface->isa('SDL::Surface')) {
+ $$surface = $workingSurface;
+ } else {
+ $surface = $workingSurface;
+ }
+}
+
+die "SDL::Tool::Graphic requires SDL_gfx support\n"
+ unless SDL::Config->has('SDL_gfx');
+
+
+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
--- /dev/null
+package SDL::Tutorial;
+
+use Pod::ToDemo <<'END_HERE';
+use SDL::App;
+
+# change these values as necessary
+my $title = 'My SDL App';
+my ($width, $height, $depth) = ( 640, 480, 16 );
+
+my $app = SDL::App->new(
+ -width => $width,
+ -height => $height,
+ -depth => $depth,
+ -title => $title,
+);
+
+# your code here; remove the next line
+sleep 2;
+END_HERE
+
+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=basic_app.pl -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
+package SDL::Tutorial::Animation;
+
+use Pod::ToDemo <<'END_HERE';
+use SDL::App;
+use SDL::Rect;
+use SDL::Color;
+
+# change these values as necessary
+my $title = 'My SDL Animation';
+my ($width, $height, $depth) = ( 640, 480, 16 );
+my ($bg_r, $bg_g, $bg_b) = ( 0x00, 0x00, 0x00 );
+my ($rect_r, $rect_g, $rect_b) = ( 0x00, 0x00, 0xff );
+my ($rect_width, $rect_height, $rect_y) = ( 100, 100, 190 );
+
+my $app = SDL::App->new(
+ -width => $width,
+ -height => $height,
+ -depth => $depth,
+);
+
+my $color = SDL::Color->new(
+ -r => $rect_r,
+ -g => $rect_g,
+ -b => $rect_b,
+);
+
+my $bg_color = SDL::Color->new(
+ -r => $bg_r,
+ -g => $bg_g,
+ -b => $bg_b,
+);
+
+my $background = SDL::Rect->new(
+ -width => $width,
+ -height => $height,
+);
+
+my $rect = create_rect();
+
+# your code here, perhaps
+for my $x (0 .. 640)
+{
+ $rect->x( $x );
+ draw_frame( $app,
+ bg => $background, bg_color => $bg_color,
+ rect => $rect, rect_color => $color,
+ );
+}
+
+# remove this line
+sleep 2;
+
+# XXX - if you know why I need to create a new rect here, please tell me!
+$rect = create_rect();
+my $old_rect = create_rect();
+
+# your code also here, perhaps
+for my $x (0 .. 640)
+{
+ $rect->x( $x );
+ draw_undraw_rect( $app,
+ rect => $rect, old_rect => $old_rect,
+ rect_color => $color, bg_color => $bg_color,
+ );
+ $old_rect->x( $x );
+}
+
+# your code almost certainly follows; remove this line
+sleep 2;
+
+sub create_rect
+{
+ return SDL::Rect->new(
+ -height => $rect_height,
+ -width => $rect_width,
+ -x => 0,
+ -y => $rect_y,
+ );
+}
+
+sub draw_frame
+{
+ my ($app, %args) = @_;
+
+ $app->fill( $args{bg}, $args{bg_color} );
+ $app->fill( $args{rect}, $args{rect_color} );
+ $app->update( $args{bg} );
+}
+
+sub draw_undraw_rect
+{
+ my ($app, %args) = @_;
+
+ $app->fill( $args{old_rect}, $args{bg_color} );
+ $app->fill( $args{rect}, $args{rect_color} );
+ $app->update( $args{old_rect} );
+ $app->update( $args{rect} );
+}
+END_HERE
+
+1;
+__END__
+
+=head1 NAME
+
+SDL::Tutorial::Animation
+
+=head1 SYNOPSIS
+
+ # to read this tutorial
+ $ perldoc SDL::Tutorial::Animation
+
+ # to create a demo animation program based on this tutorial
+ $ perl -MSDL::Tutorial::Animation=sdl_anim.pl -e 1
+
+=head1 ANIMATING A RECTANGLE
+
+Now that you can display a rectangle on the screen, the next step is to animate
+that rectangle. As with movies, there's no actual motion. Computer animations are just very very fast slideshows. The hard work is creating nearly identical images in every slide (or frame, in graphics terms).
+
+Okay, it's not that difficult.
+
+There is one small difficulty to address, however. Once you blit one surface
+onto another, the destination is changed permanently. There's no concept of
+layers here unless you write it yourself. If you fail to take this into
+account (and just about everyone does at first), you'll end up with blurry
+graphics moving around on the screen.
+
+There are two approaches to solve this problem, redrawing the screen on every
+frame and saving and restoring the background for every object drawn.
+
+=head2 Redrawing the Screen
+
+Since you have to draw the screen in the right order once to start with it's
+pretty easy to make this into a loop and redraw things in the right order for
+every frame. Given a L<SDL::App> object C<$app>, a L<SDL::Rect> C<$rect>, and
+a L<SDL::Color> C<$color>, you only have to create a new SDL::Rect C<$bg>,
+representing the whole of the background surface and a new SDL::Color
+C<$bg_color>, representing the background color. You can write a
+C<draw_frame()> function as follows:
+
+ sub draw_frame
+ {
+ my ($app, %args) = @_;
+
+ $app->fill( $args{ bg }, $args{ bg_color } );
+ $app->fill( $args{rect}, $args{rect_color} );
+ $app->update( $args{bg} );
+ }
+
+Since you can change the C<x> and C<y> coordinates of a rect with the C<x()>
+and C<y()> methods, you can move a rectangle across the screen with a loop like
+this:
+
+ for my $x (0 .. 640)
+ {
+ $rect->x( $x );
+ draw_frame( $app,
+ bg => $bg, bg_color => $bg_color,
+ rect => $rect, rect_color => $color,
+ );
+ }
+
+If C<$rect>'s starting y position is 190 and its height and width are 100, the
+rectangle (er, square) will move across the middle of the screen.
+
+Provided you can keep track of the proper order in which to redraw rectangles
+and provided you don't need the optimal speed necessary (since blitting every
+object takes more work than just blitting the portions you need), this works
+quite well.
+
+=head2 Undrawing the Updated Rectangle
+
+If you need more speed or want to make a different complexity tradeoff, you can
+take a snapshot of the destination rectangle I<before> you blit onto it. That
+way, when you need to redraw, you can blit the old snapshot back before
+blitting to the new position.
+
+B<Note:> I have no idea how this will work in the face of alpha blending,
+which, admittedly, I haven't even mentioned yet. If you don't know what this
+means, forget it. If you do know what this means and know why I'm waving my
+hands here, feel free to explain what should and what does happen and why. :)
+
+With this technique, the frame-drawing subroutine has to be a little more
+complicated. Instead of the background rect, it needs a rect for the previous
+position. It also needs to do two updates (or must perform some scary math to
+figure out the rectangle of the correct size to C<update()>. No thanks!).
+
+ sub undraw_redraw_rect
+ {
+ my ($app, %args) = @_;
+
+ $app->fill( $args{old_rect}, $args{bg_color} );
+ $app->fill( $args{rect], $args{rect_color} );
+ $app->update( $args{old_rect}, $args{rect} );
+ }
+
+We'll need to create a new SDL::Rect, C<$old_rect>, that is a duplicate of
+C<$rect>, at the same position at first. You should already know how to do
+this.
+
+As before, the loop to call C<undraw_redraw_rect()> would look something like:
+
+ for my $x (0 .. 640)
+ {
+ $rect->x( $x );
+
+ undraw_redraw_rect( $app,
+ rect => $rect, old_rect => $old_rect,
+ rect_color => $color, bg_color => $bgcolor,
+ );
+
+ $old_rect->x( $x );
+ }
+
+If you run this code, you'll probably notice that it's tremendously faster than
+the previous version. It may be too fast, where the alternate technique was
+just fast enough. There are a couple of good ways to set a fixed animation
+speed regardless of the speed of the processor and graphics hardware (provided
+they're good enough, which is increasingly often the case), and we'll get to
+them soon.
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<SDL::Tutorial::Drawing>
+
+basic drawing with SDL Perl
+
+=item L<SDL::Tutorial::Images>
+
+animating images
+
+=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 BUGS
+
+No known bugs.
+
+=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
+package SDL::Tutorial::Drawing;
+
+use Pod::ToDemo <<'END_HERE';
+use SDL::App;
+use SDL::Rect;
+use SDL::Color;
+
+# change these values as necessary
+my $title = 'My SDL Rectangle-Drawing App';
+my ($width, $height, $depth) = ( 640, 480, 16 );
+my ($red, $green, $blue) = ( 0x00, 0x00, 0xff );
+my ($rect_width, $rect_height) = ( 100, 100 );
+my ($rect_x, $rect_y) = ( 270, 190 );
+
+my $app = SDL::App->new(
+ -width => $width,
+ -height => $height,
+ -depth => $depth,
+);
+
+my $rect = SDL::Rect->new(
+ -height => $rect_height,
+ -width => $rect_width,
+ -x => $rect_x,
+ -y => $rect_y,
+);
+
+my $color = SDL::Color->new(
+ -r => $red,
+ -g => $green,
+ -b => $blue,
+);
+
+$app->fill( $rect, $color );
+$app->update( $rect );
+
+# your code here; remove the next line
+sleep 2;
+END_HERE
+
+1;
+__END__
+
+=head1 NAME
+
+SDL::Tutorial::Drawing - basic drawing with Perl SDL
+
+=head1 SYNOPSIS
+
+ # to read this tutorial
+ $ perldoc SDL::Tutorial::Drawing
+
+ # to create a bare-bones SDL app based on this tutorial
+ $ perl -MSDL::Tutorial::Drawing=basic_app.pl -e 1
+
+=head1 DRAWING BASICS
+
+As explained in L<SDL::Tutorial>, all graphics in SDL live on a surface.
+Consequently, all drawing operations operate on a surface, whether drawing on
+it directly or blitting from another surface. The important modules for this
+exercise are L<SDL::Rect> and L<SDL::Color>.
+
+As usual, we'll start by creating a L<SDL::App> object:
+
+ use SDL::App;
+
+ my $app = SDL::App->new(
+ -width => 640,
+ -height => 480,
+ -depth => 16,
+ );
+
+=head2 Creating a New Surface with SDL::Rect
+
+A SDL::Rect object is an SDL surface, just as an SDL::App object is. As you'd
+expect, you need to specify the size of this object as you create it. You can
+also specify its coordinates relative to the origin.
+
+B<Note:> The origin, or coordinates 0, 0, is at the upper left of the screen.
+
+Here's how to create a square 100 pixels by 100 pixels centered in the window:
+
+ use SDL::Rect;
+
+ my $rect = SDL::Rect->new(
+ -height => 100,
+ -width => 100,
+ -x => 270,
+ -y => 390,
+ );
+
+This won't actually display anything yet, it just creates a rectangular
+surface. Of course, even if it did display, you wouldn't see anything, as it
+defaults to the background color just as C<$app> does. That's where SDL::Color
+comes in.
+
+=head2 A Bit About Color
+
+SDL::Color objects represent colors in the SDL world. These colors are
+additive, so they're represented as mixtures of Red, Green, and Blue
+components. The color values are traditionally given in hexadecimal numbers.
+If you're exceedingly clever or really like the math, you can figure out which
+values are possible by comparing them to your current bit depth. SDL does a
+lot of autoconversion for you, though, so unless extreme speed or pedantic
+detail are important, you can get by without worrying too much.
+
+Creating a color object is reasonably easy. As the color scheme is additive,
+the lower the number for a color component, the less of that color. The higher
+the number, the higher the component. Experimentation may be your best bet, as
+these aren't exactly the primary colors you learned as a child (since that's a
+subtractive scheme).
+
+Let's create a nice, full blue:
+
+ use SDL::Color;
+
+ my $color = SDL::Color->new(
+ -r => 0x00,
+ -g => 0x00,
+ -b => 0xff,
+ );
+
+B<Note:> The numbers are in hex; if you've never used hex notation in Perl
+before, the leading C<0x> just signifies that the rest of the number is in
+base-16. In this case, the blue component has a value of 255 and the red and
+green are both zero.
+
+=head2 Filling Part of a Surface
+
+The C<fill()> method of SDL::Surface fills a given rectangular section of the
+surface with the given color. Since we already have a rect and a color, it's
+as easy as saying:
+
+ $app->fill( $rect, $color );
+
+That's a little subtle; it turns out that the SDL::Rect created earlier
+represents a destination within the surface of the main window. It's not
+attached to anything else. We could re-use it later, as necessary.
+
+=head2 Updating the Surface
+
+If you try the code so far, you'll notice that it still doesn't display. Don't
+fret. All that's left to do is to call C<update()> on the appropriate surface.
+As usual, C<update()> takes a Rect to control which part of the surface to
+update. In this case, that's:
+
+ $app->update( $rect );
+
+This may seem like a useless extra step, but it can be quite handy. While
+drawing to the screen directly seems like the fastest way to go, the
+intricacies of working with hardware with the appropriate timings is tricky.
+
+=head2 Working With The App
+
+You can, of course, create all sorts of Rects with different sizes and
+coordinates as well as varied colors and experiment to your heart's content
+drawing them to the window. It's more fun when you can animate them smoothly,
+though.
+
+That, as usual, is another tutorial.
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<SDL::Tutorial>
+
+the basics of Perl SDL.
+
+=item L<SDL::Tutorial::Animation>
+
+basic animation techniques
+
+=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 BUGS
+
+No known bugs.
+
+=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
+package SDL::Tutorial::Images;
+
+use strict;
+use warnings;
+
+my %images;
+BEGIN
+{
+ %images = (
+ left => [qw(
+ 47 49 46 38 37 61 10 00 10 00 E7 00 00 00 00 00 01 01 01 02 02 02 03 03
+ 03 04 04 04 05 05 05 06 06 06 07 07 07 08 08 08 09 09 09 0A 0A 0A 0B 0B
+ 0B 0C 0C 0C 0D 0D 0D 0E 0E 0E 0F 0F 0F 10 10 10 11 11 11 12 12 12 13 13
+ 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 1A 1A 1A 1B 1B
+ 1B 1C 1C 1C 1D 1D 1D 1E 1E 1E 1F 1F 1F 20 20 20 21 21 21 22 22 22 23 23
+ 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 29 29 29 2A 2A 2A 2B 2B
+ 2B 2C 2C 2C 2D 2D 2D 2E 2E 2E 2F 2F 2F 30 30 30 31 31 31 32 32 32 33 33
+ 33 34 34 34 35 35 35 36 36 36 37 37 37 38 38 38 39 39 39 3A 3A 3A 3B 3B
+ 3B 3C 3C 3C 3D 3D 3D 3E 3E 3E 3F 3F 3F 40 40 40 41 41 41 42 42 42 43 43
+ 43 44 44 44 45 45 45 46 46 46 47 47 47 48 48 48 49 49 49 4A 4A 4A 4B 4B
+ 4B 4C 4C 4C 4D 4D 4D 4E 4E 4E 4F 4F 4F 50 50 50 51 51 51 52 52 52 53 53
+ 53 54 54 54 55 55 55 56 56 56 57 57 57 58 58 58 59 59 59 5A 5A 5A 5B 5B
+ 5B 5C 5C 5C 5D 5D 5D 5E 5E 5E 5F 5F 5F 60 60 60 61 61 61 62 62 62 63 63
+ 63 64 64 64 65 65 65 66 66 66 67 67 67 68 68 68 69 69 69 6A 6A 6A 6B 6B
+ 6B 6C 6C 6C 6D 6D 6D 6E 6E 6E 6F 6F 6F 70 70 70 71 71 71 72 72 72 73 73
+ 73 74 74 74 75 75 75 76 76 76 77 77 77 78 78 78 79 79 79 7A 7A 7A 7B 7B
+ 7B 7C 7C 7C 7D 7D 7D 7E 7E 7E 7F 7F 7F 80 80 80 81 81 81 82 82 82 83 83
+ 83 84 84 84 85 85 85 86 86 86 87 87 87 88 88 88 89 89 89 8A 8A 8A 8B 8B
+ 8B 8C 8C 8C 8D 8D 8D 8E 8E 8E 8F 8F 8F 90 90 90 91 91 91 92 92 92 93 93
+ 93 94 94 94 95 95 95 96 96 96 97 97 97 98 98 98 99 99 99 9A 9A 9A 9B 9B
+ 9B 9C 9C 9C 9D 9D 9D 9E 9E 9E 9F 9F 9F A0 A0 A0 A1 A1 A1 A2 A2 A2 A3 A3
+ A3 A4 A4 A4 A5 A5 A5 A6 A6 A6 A7 A7 A7 A8 A8 A8 A9 A9 A9 AA AA AA AB AB
+ AB AC AC AC AD AD AD AE AE AE AF AF AF B0 B0 B0 B1 B1 B1 B2 B2 B2 B3 B3
+ B3 B4 B4 B4 B5 B5 B5 B6 B6 B6 B7 B7 B7 B8 B8 B8 B9 B9 B9 BA BA BA BB BB
+ BB BC BC BC BD BD BD BE BE BE BF BF BF C0 C0 C0 C1 C1 C1 C2 C2 C2 C3 C3
+ C3 C4 C4 C4 C5 C5 C5 C6 C6 C6 C7 C7 C7 C8 C8 C8 C9 C9 C9 CA CA CA CB CB
+ CB CC CC CC CD CD CD CE CE CE CF CF CF D0 D0 D0 D1 D1 D1 D2 D2 D2 D3 D3
+ D3 D4 D4 D4 D5 D5 D5 D6 D6 D6 D7 D7 D7 D8 D8 D8 D9 D9 D9 DA DA DA DB DB
+ DB DC DC DC DD DD DD DE DE DE DF DF DF E0 E0 E0 E1 E1 E1 E2 E2 E2 E3 E3
+ E3 E4 E4 E4 E5 E5 E5 E6 E6 E6 E7 E7 E7 E8 E8 E8 E9 E9 E9 EA EA EA EB EB
+ EB EC EC EC ED ED ED EE EE EE EF EF EF F0 F0 F0 F1 F1 F1 F2 F2 F2 F3 F3
+ F3 F4 F4 F4 F5 F5 F5 F6 F6 F6 F7 F7 F7 F8 F8 F8 F9 F9 F9 FA FA FA FB FB
+ FB FC FC FC FD FD FD FE FE FE FF FF FF 2C 00 00 00 00 10 00 10 00 00 08
+ 36 00 FF 09 1C 48 B0 A0 C1 83 08 13 22 04 C0 10 80 C2 7F 0C 05 46 4C E8
+ 70 60 C5 85 15 27 52 6C A8 30 E3 45 8C 0D 39 76 FC 38 F2 A1 44 91 1B 4F
+ 82 24 88 D2 64 C1 80 00 3B
+ )],
+ center => [qw(
+ 47 49 46 38 37 61 10 00 10 00 E7 00 00 00 00 00 01 01 01 02 02 02 03 03
+ 03 04 04 04 05 05 05 06 06 06 07 07 07 08 08 08 09 09 09 0A 0A 0A 0B 0B
+ 0B 0C 0C 0C 0D 0D 0D 0E 0E 0E 0F 0F 0F 10 10 10 11 11 11 12 12 12 13 13
+ 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 1A 1A 1A 1B 1B
+ 1B 1C 1C 1C 1D 1D 1D 1E 1E 1E 1F 1F 1F 20 20 20 21 21 21 22 22 22 23 23
+ 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 29 29 29 2A 2A 2A 2B 2B
+ 2B 2C 2C 2C 2D 2D 2D 2E 2E 2E 2F 2F 2F 30 30 30 31 31 31 32 32 32 33 33
+ 33 34 34 34 35 35 35 36 36 36 37 37 37 38 38 38 39 39 39 3A 3A 3A 3B 3B
+ 3B 3C 3C 3C 3D 3D 3D 3E 3E 3E 3F 3F 3F 40 40 40 41 41 41 42 42 42 43 43
+ 43 44 44 44 45 45 45 46 46 46 47 47 47 48 48 48 49 49 49 4A 4A 4A 4B 4B
+ 4B 4C 4C 4C 4D 4D 4D 4E 4E 4E 4F 4F 4F 50 50 50 51 51 51 52 52 52 53 53
+ 53 54 54 54 55 55 55 56 56 56 57 57 57 58 58 58 59 59 59 5A 5A 5A 5B 5B
+ 5B 5C 5C 5C 5D 5D 5D 5E 5E 5E 5F 5F 5F 60 60 60 61 61 61 62 62 62 63 63
+ 63 64 64 64 65 65 65 66 66 66 67 67 67 68 68 68 69 69 69 6A 6A 6A 6B 6B
+ 6B 6C 6C 6C 6D 6D 6D 6E 6E 6E 6F 6F 6F 70 70 70 71 71 71 72 72 72 73 73
+ 73 74 74 74 75 75 75 76 76 76 77 77 77 78 78 78 79 79 79 7A 7A 7A 7B 7B
+ 7B 7C 7C 7C 7D 7D 7D 7E 7E 7E 7F 7F 7F 80 80 80 81 81 81 82 82 82 83 83
+ 83 84 84 84 85 85 85 86 86 86 87 87 87 88 88 88 89 89 89 8A 8A 8A 8B 8B
+ 8B 8C 8C 8C 8D 8D 8D 8E 8E 8E 8F 8F 8F 90 90 90 91 91 91 92 92 92 93 93
+ 93 94 94 94 95 95 95 96 96 96 97 97 97 98 98 98 99 99 99 9A 9A 9A 9B 9B
+ 9B 9C 9C 9C 9D 9D 9D 9E 9E 9E 9F 9F 9F A0 A0 A0 A1 A1 A1 A2 A2 A2 A3 A3
+ A3 A4 A4 A4 A5 A5 A5 A6 A6 A6 A7 A7 A7 A8 A8 A8 A9 A9 A9 AA AA AA AB AB
+ AB AC AC AC AD AD AD AE AE AE AF AF AF B0 B0 B0 B1 B1 B1 B2 B2 B2 B3 B3
+ B3 B4 B4 B4 B5 B5 B5 B6 B6 B6 B7 B7 B7 B8 B8 B8 B9 B9 B9 BA BA BA BB BB
+ BB BC BC BC BD BD BD BE BE BE BF BF BF C0 C0 C0 C1 C1 C1 C2 C2 C2 C3 C3
+ C3 C4 C4 C4 C5 C5 C5 C6 C6 C6 C7 C7 C7 C8 C8 C8 C9 C9 C9 CA CA CA CB CB
+ CB CC CC CC CD CD CD CE CE CE CF CF CF D0 D0 D0 D1 D1 D1 D2 D2 D2 D3 D3
+ D3 D4 D4 D4 D5 D5 D5 D6 D6 D6 D7 D7 D7 D8 D8 D8 D9 D9 D9 DA DA DA DB DB
+ DB DC DC DC DD DD DD DE DE DE DF DF DF E0 E0 E0 E1 E1 E1 E2 E2 E2 E3 E3
+ E3 E4 E4 E4 E5 E5 E5 E6 E6 E6 E7 E7 E7 E8 E8 E8 E9 E9 E9 EA EA EA EB EB
+ EB EC EC EC ED ED ED EE EE EE EF EF EF F0 F0 F0 F1 F1 F1 F2 F2 F2 F3 F3
+ F3 F4 F4 F4 F5 F5 F5 F6 F6 F6 F7 F7 F7 F8 F8 F8 F9 F9 F9 FA FA FA FB FB
+ FB FC FC FC FD FD FD FE FE FE FF FF FF 2C 00 00 00 00 10 00 10 00 00 08
+ 36 00 FF 09 1C 48 B0 A0 C1 83 08 13 26 04 C0 10 80 C2 7F 0C 05 46 5C 48
+ D0 E1 42 8B 13 2F 66 54 B8 F1 60 C3 8F 16 2F 3E 1C D8 11 E1 C7 87 13 4B
+ 4A DC D8 70 E4 C1 80 00 3B
+ )],
+ right => [qw(
+ 47 49 46 38 37 61 10 00 10 00 E7 00 00 00 00 00 01 01 01 02 02 02 03 03
+ 03 04 04 04 05 05 05 06 06 06 07 07 07 08 08 08 09 09 09 0A 0A 0A 0B 0B
+ 0B 0C 0C 0C 0D 0D 0D 0E 0E 0E 0F 0F 0F 10 10 10 11 11 11 12 12 12 13 13
+ 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 1A 1A 1A 1B 1B
+ 1B 1C 1C 1C 1D 1D 1D 1E 1E 1E 1F 1F 1F 20 20 20 21 21 21 22 22 22 23 23
+ 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 29 29 29 2A 2A 2A 2B 2B
+ 2B 2C 2C 2C 2D 2D 2D 2E 2E 2E 2F 2F 2F 30 30 30 31 31 31 32 32 32 33 33
+ 33 34 34 34 35 35 35 36 36 36 37 37 37 38 38 38 39 39 39 3A 3A 3A 3B 3B
+ 3B 3C 3C 3C 3D 3D 3D 3E 3E 3E 3F 3F 3F 40 40 40 41 41 41 42 42 42 43 43
+ 43 44 44 44 45 45 45 46 46 46 47 47 47 48 48 48 49 49 49 4A 4A 4A 4B 4B
+ 4B 4C 4C 4C 4D 4D 4D 4E 4E 4E 4F 4F 4F 50 50 50 51 51 51 52 52 52 53 53
+ 53 54 54 54 55 55 55 56 56 56 57 57 57 58 58 58 59 59 59 5A 5A 5A 5B 5B
+ 5B 5C 5C 5C 5D 5D 5D 5E 5E 5E 5F 5F 5F 60 60 60 61 61 61 62 62 62 63 63
+ 63 64 64 64 65 65 65 66 66 66 67 67 67 68 68 68 69 69 69 6A 6A 6A 6B 6B
+ 6B 6C 6C 6C 6D 6D 6D 6E 6E 6E 6F 6F 6F 70 70 70 71 71 71 72 72 72 73 73
+ 73 74 74 74 75 75 75 76 76 76 77 77 77 78 78 78 79 79 79 7A 7A 7A 7B 7B
+ 7B 7C 7C 7C 7D 7D 7D 7E 7E 7E 7F 7F 7F 80 80 80 81 81 81 82 82 82 83 83
+ 83 84 84 84 85 85 85 86 86 86 87 87 87 88 88 88 89 89 89 8A 8A 8A 8B 8B
+ 8B 8C 8C 8C 8D 8D 8D 8E 8E 8E 8F 8F 8F 90 90 90 91 91 91 92 92 92 93 93
+ 93 94 94 94 95 95 95 96 96 96 97 97 97 98 98 98 99 99 99 9A 9A 9A 9B 9B
+ 9B 9C 9C 9C 9D 9D 9D 9E 9E 9E 9F 9F 9F A0 A0 A0 A1 A1 A1 A2 A2 A2 A3 A3
+ A3 A4 A4 A4 A5 A5 A5 A6 A6 A6 A7 A7 A7 A8 A8 A8 A9 A9 A9 AA AA AA AB AB
+ AB AC AC AC AD AD AD AE AE AE AF AF AF B0 B0 B0 B1 B1 B1 B2 B2 B2 B3 B3
+ B3 B4 B4 B4 B5 B5 B5 B6 B6 B6 B7 B7 B7 B8 B8 B8 B9 B9 B9 BA BA BA BB BB
+ BB BC BC BC BD BD BD BE BE BE BF BF BF C0 C0 C0 C1 C1 C1 C2 C2 C2 C3 C3
+ C3 C4 C4 C4 C5 C5 C5 C6 C6 C6 C7 C7 C7 C8 C8 C8 C9 C9 C9 CA CA CA CB CB
+ CB CC CC CC CD CD CD CE CE CE CF CF CF D0 D0 D0 D1 D1 D1 D2 D2 D2 D3 D3
+ D3 D4 D4 D4 D5 D5 D5 D6 D6 D6 D7 D7 D7 D8 D8 D8 D9 D9 D9 DA DA DA DB DB
+ DB DC DC DC DD DD DD DE DE DE DF DF DF E0 E0 E0 E1 E1 E1 E2 E2 E2 E3 E3
+ E3 E4 E4 E4 E5 E5 E5 E6 E6 E6 E7 E7 E7 E8 E8 E8 E9 E9 E9 EA EA EA EB EB
+ EB EC EC EC ED ED ED EE EE EE EF EF EF F0 F0 F0 F1 F1 F1 F2 F2 F2 F3 F3
+ F3 F4 F4 F4 F5 F5 F5 F6 F6 F6 F7 F7 F7 F8 F8 F8 F9 F9 F9 FA FA FA FB FB
+ FB FC FC FC FD FD FD FE FE FE FF FF FF 2C 00 00 00 00 10 00 10 00 00 08
+ 3A 00 FF 09 1C 48 B0 A0 C1 83 08 13 2A 04 C0 10 80 C2 7F 0C 05 46 4C E8
+ 70 60 45 84 13 27 52 6C F8 50 62 C5 8B 05 1B 8A 04 79 50 E3 43 93 1B 51
+ 1A CC 48 D2 A2 49 8E 1D 0B 06 04 00 3B
+ )],
+);
+}
+
+use Pod::ToDemo sub
+{
+ (undef, my $filename) = @_;
+ (my $imagebase = $filename) =~ s/\.\w+$//;
+ my @img_files = map { $imagebase . "_$_.gif" }
+ qw( left center right );
+ my $demo_source = <<'END_HERE';
+package Walker;
+
+sub new
+{
+ my ($class, @images) = @_;
+ my @frames = map { SDL::Surface->new( -name => $_ ) } @images;
+ my $frame_rect = SDL::Rect->new(
+ -height => $frames[0]->height(),
+ -width => $frames[0]->width(),
+ -x => 0,
+ -y => 0,
+ );
+ my $self =
+ {
+ frames => \@frames,
+ frame_rect => $frame_rect,
+ };
+ bless $self, $class;
+}
+
+sub frames
+{
+ my $self = shift;
+ $self->{frames} = shift if @_;
+ $self->{frames};
+}
+
+sub frame_rect
+{
+ my $self = shift;
+ $self->{frame_rect} = shift if @_;
+ $self->{frame_rect};
+}
+
+sub next_frame
+{
+ my $self = shift;
+ my $frames = $self->frames();
+ my $frame = shift @$frames;
+
+ push @$frames, $frame;
+ $self->frames( $frames );
+
+ return $frame;
+}
+
+package main;
+
+use strict;
+
+use SDL;
+use SDL::App;
+use SDL::Surface;
+use SDL::Color;
+
+# change these values as necessary
+my $title = 'My SDL Animation';
+my ($width, $height, $depth) = ( 640, 480, 16 );
+my ($bg_r, $bg_g, $bg_b) = ( 0xff, 0xff, 0xff );
+my ($start_x, $end_x) = ( 20, 600 );
+my $sleep_msec = 0.05;
+
+my $app = SDL::App->new(
+ -width => $width,
+ -height => $height,
+ -depth => $depth,
+);
+
+my $bg_color = SDL::Color->new(
+ -r => $bg_r,
+ -g => $bg_g,
+ -b => $bg_b,
+);
+
+my $background = SDL::Rect->new(
+ -width => $width,
+ -height => $height,
+);
+
+my $pos = SDL::Rect->new(
+ -width => 16,
+ -height => 16,
+ -x => 0,
+ -y => 240,
+);
+
+my $walker = Walker->new(qw(
+END_HERE
+
+$demo_source .= join( ' ', @img_files ) . "));" . <<'END_HERE';
+
+for my $x ( $start_x .. $end_x )
+{
+ draw_background( $app, $background, $bg_color );
+ $pos->x( $x );
+ draw_walker( $walker, $app, $pos );
+ $app->update( $background );
+ select( undef, undef, undef, $sleep_msec );
+}
+
+# you'll want to remove this
+sleep 2;
+
+sub draw_background
+{
+ my ($app, $background, $bg_color) = @_;
+ $app->fill( $background, $bg_color );
+}
+
+sub draw_walker
+{
+ my ($walker, $app, $pos) = @_;
+ my $frame = $walker->next_frame();
+ my $frame_rect = $walker->frame_rect();
+ $frame->blit( $frame_rect, $app, $pos );
+}
+END_HERE
+
+ Pod::ToDemo::write_demo( $filename, "#$^X\n$demo_source" );
+ write_files( $imagebase );
+};
+
+sub write_files
+{
+ my $imagebase = shift;
+
+ for my $image (qw( left center right ))
+ {
+ my $file = join('', map { chr( hex( $_ ) ) } @{ $images{ $image } });
+ write_file( $imagebase . "_$image" . '.gif', $file );
+ }
+}
+
+sub write_file
+{
+ my ($file, $contents) = @_;
+
+ die "Cowardly refusing to overwrite '$file'\n" if -e $file;
+ open my $out, '>', $file or die "Cannot write '$file': $!\n";
+ binmode $out;
+ print $out $contents;
+}
+
+__END__
+
+=head1 NAME
+
+SDL::Tutorial::Images
+
+=head1 SYNOPSIS
+
+ # to read this tutorial
+ $ perldoc SDL::Tutorial::Images
+
+ # to create a demo animation program based on this tutorial
+ $ perl -MSDL::Tutorial::Images=sdl_images.pl -e 1
+
+=head1 ANIMATING IMAGES
+
+Since you're already familiar with the concepts behind animation, it's time to
+learn how to work with images. As usual, the important point is that computer animation is just I<simulating> motion by painting several slightly different frames to the screen every second.
+
+There are two ways to vary an image on screen. One is to change its
+coordinates so it's at a slightly different position. This is very easy to do;
+it's just like animating a rectangle. The other way is to change the image
+itself so it's slightly different. This is a little more difficult, as you'll
+need to draw the alternate image beforehand somehow.
+
+=head2 Loading Images
+
+As usual, start with an L<SDL::App> object representing the image window. Then
+preload the image file. This is easy; just pass the C<name> parameter to the
+L<SDL::Surface> constructor:
+
+ use SDL::Surface;
+
+ my $frame = SDL::Surface->new( -name => 'frame1.png' );
+
+B<Note:> you'll need to have compiled SDL Perl (and probably SDL) to support
+JPEG and PNG files for this to work.
+
+That's it; now you have an SDL::Surface object containing the image. You can
+use the C<height()>, C<width()>, and C<bpp()> methods to retrieve its height,
+width, and bits per pixel, if you need them.
+
+=head2 Displaying Images
+
+Drawing an image onto the screen requires blitting it from one surface to
+another. (Remember, "blitting" means copying bits in memory.) The C<blit()>
+method of SDL::Surface objects comes in handy. Its arguments are a little odd,
+though. Assuming C<$app> is the SDL::App object, as usual:
+
+ use SDL::Rect;
+
+ my $frame_rect = SDL::Rect->new(
+ -height => $frame->height(),
+ -width => $frame->width(),
+ -x => 0,
+ -y => 0,
+ );
+
+ my $dest_rect = SDL::Rect->new(
+ -height => $frame->height(),
+ -width => $frame->width(),
+ -x => 0,
+ -y => 0,
+ );
+
+ $frame->blit( $frame_rect, $app, $dest_rect );
+ $app->update( $dest_rect );
+
+Here we have two L<SDL::Rect> objects which represent rectangular regions of a
+Surface. C<$frame_rect> represents the entire area of C<$frame>, while
+C<$dest_rect> represents the area of the main window in which to blit the
+frame. This may be clearer with more descriptive variable names:
+
+ $source_surface->blit(
+ $area_of_source_to_blit,
+ $destination_surface,
+ $destination_area
+ );
+
+As usual, call C<update()> on C<$app> to see the change.
+
+Requiring the source and destination Rect objects may seem tedious in this
+simple example, but it's highly useful for copying only part of surface to part
+of another. For example, animating this image is a matter of changing the C<x>
+and C<y> coordinates of C<$dest_rect>:
+
+ for my $x ( 1 .. 100 )
+ {
+ $dest_rect->x( $x );
+ $frame->blit( $frame_rect, $app, $dest_rect );
+ $app->update( $dest_rect );
+ }
+
+Of course, you'll have to redraw all or part of the screen to avoid artifacts,
+as discussed in the previous tutorial.
+
+=head2 Multi-Image Animation
+
+That covers moving a single image around the screen. What if you want
+something more? For example, what if you want to animate a stick figure
+walking?
+
+You'll need several frames, just as in a flip-book. Each frame should be slightly different than the one before it. It's probably handy to encapsulate all of this in a C<Walker> class:
+
+ package Walker;
+
+ use SDL::Surface;
+
+ sub new
+ {
+ my ($class, @images) = @_;
+ my $self = [ map { SDL::Surface->new( -name => $_ ) } @images ];
+
+ bless $self, $class;
+ }
+
+ sub next_frame
+ {
+ my $self = shift;
+ my $frame = shift @$self;
+
+ push @$self, $frame;
+ return $frame;
+ }
+
+To use this class, instantiate an object:
+
+ my $walker = Walker->new( 'frame1.png', 'frame2.png', 'frame3.png' );
+
+Then call C<next_frame()> within the loop:
+
+ for my $x ( 1 .. 100 )
+ {
+ my $frame = $walker->next_frame();
+
+ $dest_rect->x( $x );
+ $frame->blit( $frame_rect, $app, $dest_rect );
+ $app->update( $dest_rect );
+ }
+
+Again, the rest of the frame drawing is missing from this example so as not to
+distract from this technique. You'll probably want to abstract the undrawing
+and redrawing into a separate subroutine so you don't have to worry about it
+every time.
+
+It'd be easy to make C<next_frame()> much smarter, selecting an image
+appropriate to the direction of travel, using a bored animation when the
+character is no longer moving, or adding other characteristics to the
+character. As you can see, the hard part of this technique is generating the
+images beforehand. That can add up to a tremendous amount of art and that's
+one reason for the popularity of 3D models... but that's another tutorial much
+further down the road.
+
+More importantly, it's time to discuss how to make these animations run more
+smoothly. More on that next time.
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<SDL::Tutorial>
+
+basic SDL tutorial
+
+=item L<SDL::Tutorial::Animation>
+
+non-image 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 BUGS
+
+No known bugs.
+
+=head1 COPYRIGHT
+
+Copyright (c) 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
+#
+# Video.pm
+#
+# A package for manipulating MPEG video
+#
+# Copyright (C) 2004 David J. Goehrig
+
+package SDL::Video;
+
+use strict;
+use SDL;
+use SDL::Surface;
+use SDL::MPEG;
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my %options = @_;
+
+ verify (%options, qw/ -name -audio / ) if $SDL::DEBUG;
+
+ my $n = $options{-name} || die "SDL::Video must supply a filename to SDL::Video::new\n";
+ my $a = $options{'-audio'} ? 1 : 0;
+ my $info = new SDL::MPEG();
+
+ my $self = \SDL::NewSMPEG($n,$$info,$a);
+ bless $self,$class;
+ $self->audio(1);
+ $self->video(1);
+ return $self, $info;
+}
+
+sub DESTROY {
+ SDL::FreeSMPEG(${$_[0]});
+}
+
+sub error {
+ SDL::SMPEGError(${$_[0]});
+}
+
+sub audio {
+ SDL::SMPEGEnableAudio( ${$_[0]}, $_[1]);
+}
+
+sub video {
+ SDL::SMPEGEnableVideo( ${$_[0]}, $_[1]);
+}
+
+sub volume {
+ SDL::SMPEGSetVolume( ${$_[0]}, $_[1] );
+}
+
+sub display {
+ die "SDL::Video::Display requires a SDL::Surface\n" unless $_[1]->isa('SDL::Surface');
+ SDL::SMPEGSetDisplay( ${$_[0]}, ${$_[1]}, 0);
+}
+
+sub scale {
+ return SDL::SMPEGScaleXY(${$_[0]},$_[1],$_[2]) if (@_ == 3 );
+ return SDL::SMPEGScaleXY(${$_[0]},$_[1]->width(),$_[1]->height()) if $_[1]->isa('SDL::Surface');
+ SDL::SMPEGScale(${$_[0]},$_[1]);
+}
+
+sub play {
+ SDL::SMPEGPlay(${$_[0]});
+}
+
+sub pause {
+ SDL::SMPEGPause(${$_[0]});
+}
+
+sub stop {
+ SDL::SMPEGStop(${$_[0]});
+}
+
+sub rewind {
+ SDL::SMPEGRewind(${$_[0]});
+}
+
+sub seek {
+ SDL::SMPEGSeek(${$_[0]},$_[1]);
+}
+
+sub skip {
+ SDL::SMPEGSkip(${$_[0]},$_[1]);
+}
+
+sub loop {
+ SDL::SMPEGLoop(${$_[0]},$_[1]);
+}
+
+sub region {
+ die "SDL::Video::region requires a SDL::Rect\n" unless $_[1]->isa('SDL::Rect');
+ SDL::SMPEGDisplayRegion(${$_[0]},${$_[1]});
+}
+
+sub frame {
+ SDL::SMPEGRenderFrame(${$_[0]},$_[1]);
+}
+
+sub info {
+ new SDL::MPEG -from => $_[0];
+}
+
+sub status {
+ SDL::SMPEGStatus(${$_[0]});
+}
+
+1;
+
+__END__;
+
+=pod
+
+
+=head1 NAME
+
+SDL::Video - a SDL perl extension
+
+=head1 SYNOPSIS
+
+ $video = new SDL::Video ( -name => 'pr0n.mpg' );
+
+=head1 DESCRIPTION
+
+C<SDL::Video> adds support for MPEG video to your
+SDL Perl application. Videos are objects bound to
+surfaces, whose playback is controled through the
+object's interface.
+
+=head2 METHODS
+
+
+=over 4
+
+=item *
+
+C<SDL::Video::error()> returns any error messages associated with playback
+
+=item *
+
+C<SDL::Video::audio(bool)> enables or disables audio playback, (on by default)
+
+=item *
+
+C<SDL::Video::video(bool)> enables or disable video playback, (on by default)
+
+=item *
+
+C<SDL::Video::loop(bool)> enables or disable playback looping (off by default)
+
+=item *
+
+C<SDL::Video::volume(int)> set the volume as per the mixer volume
+
+=item *
+
+C<SDL::Video:display(surface)> binds the clip to a display surface
+
+=item *
+
+C<SDL::Video::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::Video::play()> plays the video clip, call C<SDL::Video::display()> before playing
+
+=item *
+
+C<SDL::Video::pause()> pauses video playback
+
+=item *
+
+C<SDL::Video::stop()> stops video playback
+
+=item *
+
+C<SDL::Video::rewind()> resets the clip to the beginning
+
+=item *
+
+C<SDL::Video::seek(offset)> seeks to a particular byte offset
+
+=item *
+
+C<SDL::Video::skip(time)> skips to a particular time
+
+=item *
+
+C<SDL::Video::region(rect)> takes a SDL::Rect and defines the display area
+
+=item *
+
+C<SDL::Video::frame(int)> renders a specific frame to the screen
+
+=item *
+
+C<SDL::Video::info()> returns a new C<SDL::MPEG> object reflecting the current status
+
+=item *
+
+C<SDL::Video::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
+#
+# Copyright (C) 2004 David J. Goehrig
+#
+
+package SDL_perl;
+
+require DynaLoader;
+
+@ISA = qw/ DynaLoader /;
+
+bootstrap SDL_perl;
+
+1;
--- /dev/null
+#
+# Copyright (C) 2004 chromatic
+# Copyright (C) 2004 David J. Goehrig
+#
+
+package SDL::Build;
+
+use strict;
+use base 'Module::Build';
+
+use File::Spec;
+use Data::Dumper;
+use Config;
+
+# Module::Build doesn't seem to have a way to use separate flags for separate
+# XS files, so here's the override that makes separate files build correctly:
+sub process_xs
+{
+ my ($self, $file) = @_;
+
+ my $properties = $self->{properties};
+ my $file_args = $self->notes( 'file_flags' )->{$file};
+ my @old_values = @$properties{ keys %$file_args };
+ @$properties{ keys %$file_args } = values %$file_args;
+
+ $self->SUPER::process_xs( $file );
+ @$properties{ keys %$file_args } = @old_values;
+}
+
+# every platform has slightly different library and header paths
+sub get_arch
+{
+ my ($self, $os) = @_;
+ my $modpath = File::Spec->catfile(
+ 'SDL', 'Build', ucfirst( $os ) . '.pm' );
+ my $module = 'SDL::Build::' . ucfirst( $os );
+
+ require $modpath or die "No module for $os platform\n";
+
+ return $module;
+}
+
+# which headers are installed?
+sub find_subsystems
+{
+ my ($self, $subsystems, $libraries) = @_;
+ my %includes_libs = $self->fetch_includes();
+ my %enabled;
+
+ while ( my ($name, $subsystem) = each %$subsystems )
+ {
+ for my $library (@{ $subsystem->{libraries} })
+ {
+ my $lib = $libraries->{$library}
+ or die "Unknown library '$library' for '$name'\n";
+
+ my ($inc_dir, $link_dir) =
+ $self->find_header( $lib->{header}, \%includes_libs );
+ $enabled{$name}{ $library } = $inc_dir ? [ $inc_dir, $link_dir ]
+ : 0;
+ }
+ }
+
+ return \%enabled;
+}
+
+# set the define flags for the libraries we have
+sub build_defines
+{
+ my ($self, $libraries, $build_systems) = @_;
+
+ my %defines;
+
+ while (my ($subsystem, $buildable) = each %$build_systems)
+ {
+ for my $build (grep { $buildable->{ $_ } } keys %$buildable)
+ {
+ push @{ $defines{ $subsystem } }, "-D$libraries->{$build}{define}";
+ }
+ }
+
+ return \%defines;
+}
+
+# set the include paths for the libraries we have
+sub build_includes
+{
+ my ($self, $libraries, $build_systems) = @_;
+
+ my %includes;
+
+ while (my ($subsystem, $buildable) = each %$build_systems)
+ {
+ my %sub_include;
+ for my $build (grep { $buildable->{ $_ } } keys %$buildable)
+ {
+ $sub_include{ $buildable->{ $build }[0] }++;
+ }
+
+ $includes{ $subsystem } = [ map { "-I$_" } keys %sub_include ];
+ }
+
+ return \%includes;
+}
+
+# set the linker paths and flags for the libraries we have
+sub build_links
+{
+ my ($self, $libraries, $build_systems) = @_;
+
+ my %links;
+
+ while (my ($subsystem, $buildable) = each %$build_systems)
+ {
+ my %sub_links;
+ for my $build (grep { $buildable->{ $_ } } keys %$buildable)
+ {
+ $sub_links{ $buildable->{ $build }[1] }++;
+ push @{ $links{ $subsystem }{libs} }, "-l$build";
+ }
+
+ $links{ $subsystem }{paths} = [ map { "-L$_" } keys %sub_links ];
+ }
+
+ return \%links;
+}
+
+# save this all in a format process_xs() can understand
+sub set_flags
+{
+ my ($self, $subsystems, $build, $defines, $includes, $links,
+ $sdl_compile, $sdl_link) = @_;
+
+ my %file_flags;
+
+ while (my ($subsystem, $buildable) = each %$build)
+ {
+ my $sub_file = $subsystems->{$subsystem}{file}{to};
+ my $sub_includes = join(' ', @{ $includes->{$subsystem} } );
+
+ $file_flags{ $sub_file } =
+ {
+ extra_compiler_flags =>
+ [
+ @{ $includes->{$subsystem} },
+ split(' ',$sdl_compile),
+ @{ $defines->{$subsystem} },
+ ( defined $Config{usethreads} ? ('-DUSE_THREADS', '-fPIC') : '-fPIC' ),
+ ],
+ extra_linker_flags =>
+ [
+ @{ $links->{$subsystem}{paths} },
+ split(' ',$sdl_link),
+ @{ $links->{$subsystem}{libs} },
+ ],
+ },
+ }
+
+ $self->notes( 'file_flags' => \%file_flags );
+}
+
+# look for a header somewhere on the system
+sub find_header
+{
+ my ($self, $header, $includes) = @_;
+
+ for my $inc_dir (keys %$includes)
+ {
+ next unless -e File::Spec->catfile( $inc_dir, $header );
+ return ($inc_dir, $includes->{$inc_dir});
+ }
+}
+
+sub write_sdl_config
+{
+ my ($self, $config) = @_;
+ my $path = File::Spec->catfile(qw( lib SDL Config.pm ));
+ my $dd = Data::Dumper->new( [ $config ], [ 'sdl_config' ] );
+ my $hash = $dd->Dump();
+ (my $text = <<' END_HEADER' . $hash . <<' END_FOOTER');
+ package SDL::Config;
+
+ my $sdl_config;
+ END_HEADER
+
+ sub has
+ {
+ my ($class, $define) = @_;
+ scalar grep { $$sdl_config{$_}{$define} } keys %$sdl_config;
+ }
+
+ 1;
+ END_FOOTER
+
+ $text =~ s/^\t//gm;
+
+ open my $file, '>', $path or die "Cannot write to '$path': $!\n";
+ print $file $text;
+}
+
+1;
--- /dev/null
+package SDL::Build::Cygwin;
+
+use base 'SDL::Build';
+
+sub opengl_headers
+{
+ return GL => 'SDL_opengl.h';
+}
+
+sub fetch_includes
+{
+ return (
+ '/usr/local/include' => '/usr/local/lib',
+ '/usr/local/include/gl' => '/usr/local/lib',
+ '/usr/local/include/GL' => '/usr/local/lib',
+ '/usr/local/include/SDL' => '/usr/local/lib',
+ '/usr/local/include/smpeg' => '/usr/local/lib',
+
+ '/usr/include' => '/usr/lib',
+ '/usr/include/gl' => '/usr/lib',
+ '/usr/include/GL' => '/usr/lib',
+ '/usr/include/SDL' => '/usr/lib',
+ '/usr/include/smpeg' => '/usr/lib',
+
+ '/usr/X11R6/include' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/gl' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/GL' => '/usr/X11R6/lib',
+ );
+}
+
+sub build_links
+{
+ my $self = shift;
+ my $links = $self->SUPER::build_links();
+
+ for my $subsystem (values %$links)
+ {
+ push @{ $subsystem{ libs } }, '-lpthreads';
+ }
+
+ return $links;
+}
+
+1;
--- /dev/null
+package SDL::Build::Darwin;
+
+use base 'SDL::Build';
+
+sub fetch_includes
+{
+ return (
+ '/usr/local/include/SDL' => '/usr/local/lib',
+ '/usr/local/include' => '/usr/local/lib',
+ '/usr/local/include/smpeg' => '/usr/local/lib',
+ '/usr/include/SDL' => '/usr/lib',
+ '/usr/include' => '/usr/lib',
+ '/usr/include/smpeg' => '/usr/lib',
+ '/usr/local/include/GL' => '/usr/local/lib',
+ '/usr/local/include/gl' => '/usr/local/lib',
+ '/usr/include/GL' => '/usr/lib',
+ '/usr/include/gl' => '/usr/lib',
+
+ '/System/Library/Frameworks/SDL_mixer.framework/Headers' => '../../lib',
+ '/System/Library/Frameworks/SDL_image.framework/Headers' => '../../lib',
+ '/System/Library/Frameworks/SDL_ttf.framework/Headers' => '../../lib',
+ '/System/Library/Frameworks/libogg.framework/Headers' => '../../lib',
+ '/System/Library/Frameworks/libvorbis.framework/Headers' => '../../lib',
+ '/System/Library/Frameworks/libvorbisfile.framework/Headers' => '../../lib',
+ '/System/Library/Frameworks/libvorbisenc.framework/Headers' => '../../lib',
+ '../../include' => '../../lib',
+ '/System/Library/Frameworks/OpenGL.framework/Headers' =>
+ '/System/Library/Frameworks/OpenGL.framework/Libraries',
+ );
+}
+
+1;
--- /dev/null
+package SDL::Build::Freebsd;
+
+use base 'SDL::Build';
+
+sub fetch_includes
+{
+ return (
+ '/usr/local/include/SDL11' => '/usr/local/lib',
+
+ '/usr/local/include' => '/usr/local/lib',
+ '/usr/local/include/gl' => '/usr/local/lib',
+ '/usr/local/include/GL' => '/usr/local/lib',
+ '/usr/local/include/SDL' => '/usr/local/lib',
+ '/usr/local/include/smpeg' => '/usr/local/lib',
+
+ '/usr/include' => '/usr/lib',
+ '/usr/include/gl' => '/usr/lib',
+ '/usr/include/GL' => '/usr/lib',
+ '/usr/include/SDL' => '/usr/lib',
+ '/usr/include/smpeg' => '/usr/lib',
+
+ '/usr/X11R6/include' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/gl' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/GL' => '/usr/X11R6/lib',
+
+ );
+}
+
+1;
--- /dev/null
+package SDL::Build::Linux;
+
+use base 'SDL::Build';
+
+sub fetch_includes
+{
+ return (
+ '/usr/local/include' => '/usr/local/lib',
+ '/usr/local/include/gl' => '/usr/local/lib',
+ '/usr/local/include/GL' => '/usr/local/lib',
+ '/usr/local/include/SDL' => '/usr/local/lib',
+ '/usr/local/include/smpeg' => '/usr/local/lib',
+
+ '/usr/include' => '/usr/lib',
+ '/usr/include/gl' => '/usr/lib',
+ '/usr/include/GL' => '/usr/lib',
+ '/usr/include/SDL' => '/usr/lib',
+ '/usr/include/smpeg' => '/usr/lib',
+
+ '/usr/X11R6/include' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/gl' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/GL' => '/usr/X11R6/lib',
+ );
+}
+
+1;
--- /dev/null
+package SDL::Build::MSWin32;
+
+use strict;
+
+use base 'SDL::Build';
+use File::Spec::Functions;
+
+sub fetch_includes
+{
+ die "Environment variable INCLUDE is empty\n" unless $ENV{INCLUDE};
+
+ return map { $_ => 1 } grep { $_ } split( ';', $ENV{INCLUDE} );
+}
+
+sub find_header
+{
+ for my $key (qw( LIBS PATH ))
+ {
+ die "Environment variable $key is empty\n" unless $ENV{$key};
+ }
+
+ my ( $self, $header, $includes ) = @_;
+ ( my $dll = $header ) =~ s/\.h/\.dll/;
+
+ my $include_dir;
+
+ for my $inc_dir ( keys %$includes )
+ {
+ next unless -e catfile( $inc_dir, $header );
+ $include_dir = $inc_dir;
+ }
+
+ return unless $include_dir;
+
+ for my $lib_path ( map { split(';', ( $ENV{$_} || '' )) }
+ qw( LIB LIBS PATH ) )
+ {
+ return ( $include_dir, $header ) if -e catfile( $lib_path, $dll );
+ }
+}
+
+sub link_flags
+{
+ return 'SDL.lib';
+}
+
+sub compile_flags
+{
+ return;
+}
+
+sub subsystems
+{
+ my $self = shift;
+ my $subsystems = $self->SUPER::subsystems();
+ my $gl_ss_method = $self->gl_vendor( $ENV{SDL_GL_VENDOR} ) . '_subsystems';
+
+ $subsystems->{OpenGL}{libraries} = $self->$gl_ss_method();
+ return $subsystems;
+}
+
+sub libraries
+{
+ my $self = shift;
+ my $libraries = $self->SUPER::libraries();
+ my $gl_lib_method = $self->gl_vendor( $ENV{SDL_GL_VENDOR} ) . '_libraries';
+
+ $libraries->{OpenGL}{define} .= ' -D' . $self->$gl_lib_method();
+ return $libraries;
+}
+
+sub gl_vendor
+{
+ my ( $self, $vendor ) = @_;
+
+ return 'ms_gl' unless defined $vendor;
+
+ return 'mesa_gl' if $vendor eq 'MESA';
+ return 'ms_gl' if $vendor eq 'MS';
+
+ die "Unrecognized GL vendor '$vendor'\n";
+}
+
+sub ms_gl_subsystems
+{
+ return [qw( OpenGL GLU )];
+}
+
+sub mesa_gl_subsystems
+{
+ return [qw( mesagl mesaglu osmesa )];
+}
+
+sub ms_gl_libraries
+{
+ define => 'OPENGL_VENDOR_MS';
+}
+
+sub mesa_gl_libraries
+{
+ define => 'OPENGL_VENDOR_MESA';
+}
+
+sub link_c
+{
+ my $self = shift;
+ my ( $blib, $rib ) = @_;
+
+ # until ExtUtils::ParseXS is patched, avoid warnings from cl.exe
+ $_[-1] =~ s{\\}{/}g;
+
+ $rib =~ s{^src[\\/]}{};
+ $rib =~ s{[\\/]}{::}g;
+
+ local $self->{properties}{module_name} = $rib;
+ $self->SUPER::link_c( @_ );
+}
+
+1;
--- /dev/null
+package SDL::Build::Netbsd;
+
+use base 'SDL::Build';
+
+sub fetch_includes
+{
+ return (
+ '/usr/pkg/include', => '/usr/local/lib',
+ '/usr/pkg/include/SDL' => '/usr/local/lib',
+ '/usr/pkg/include/smpeg' => '/usr/local/lib',
+
+ '/usr/local/include' => '/usr/local/lib',
+ '/usr/local/include/gl' => '/usr/local/lib',
+ '/usr/local/include/GL' => '/usr/local/lib',
+ '/usr/local/include/SDL' => '/usr/local/lib',
+ '/usr/local/include/smpeg' => '/usr/local/lib',
+
+ '/usr/include' => '/usr/lib',
+ '/usr/include/gl' => '/usr/lib',
+ '/usr/include/GL' => '/usr/lib',
+ '/usr/include/SDL' => '/usr/lib',
+ '/usr/include/smpeg' => '/usr/lib',
+
+ '/usr/X11R6/include' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/gl' => '/usr/X11R6/lib',
+ '/usr/X11R6/include/GL' => '/usr/X11R6/lib',
+ );
+}
+
+1;
--- /dev/null
+// SDL::OpenGL
+//
+// Copyright (C) 2002,2003,2004 David J. Goehrig
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+
+#include <gl.h>
+#include <glu.h>
+
+#ifdef USE_THREADS
+#define HAVE_TLS_CONTEXT
+#endif
+
+#ifndef GL_ALL_CLIENT_ATTRIB_BITS
+#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFF
+#endif /* GL_ALL_CLIENT_BITS */
+
+#include "../defines.h"
+
+SV* sdl_perl_nurbs_error_hook;
+void
+sdl_perl_nurbs_error_callback ( GLenum errorCode )
+{
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(errorCode)));
+ PUTBACK;
+
+ call_sv(sdl_perl_nurbs_error_hook,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_nurbs_being_callback ( GLenum type, void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(type)));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_nurbs_multi_callback ( GLfloat *vec, void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(PTR2IV(vec))));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_nurbs_end_callback ( void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_tess_end_callback ( void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(GLU_TESS_BEGIN)));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_tess_begin_callback ( GLenum type, void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(GLU_TESS_BEGIN)));
+ XPUSHs(sv_2mortal(newSViv(type)));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_tess_error_callback ( GLenum type, void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(GLU_TESS_ERROR)));
+ XPUSHs(sv_2mortal(newSViv(type)));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_tess_edge_flag_callback ( GLenum flag, void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(GLU_TESS_EDGE_FLAG)));
+ XPUSHs(sv_2mortal(newSViv(flag)));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_tess_vertex_callback ( double *vd, void *cb )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(GLU_TESS_VERTEX)));
+ XPUSHs(sv_2mortal(newSVnv(vd[0])));
+ XPUSHs(sv_2mortal(newSVnv(vd[1])));
+ XPUSHs(sv_2mortal(newSVnv(vd[2])));
+ XPUSHs(sv_2mortal(newSVnv(vd[3])));
+ XPUSHs(sv_2mortal(newSVnv(vd[4])));
+ XPUSHs(sv_2mortal(newSVnv(vd[5])));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_tess_combine_callback ( GLdouble coords[3], double *vd[4], GLfloat weight[4],
+ GLdouble **out, void *cb )
+{
+ SV *cmd;
+ double *data;
+ int width;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)cb;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(GLU_TESS_COMBINE)));
+ XPUSHs(sv_2mortal(newSVpvn((char*)coords,sizeof(GLdouble)*3)));
+ XPUSHs(sv_2mortal(newSVpvn((char*)vd,sizeof(GLdouble*)*4)));
+ XPUSHs(sv_2mortal(newSVpvn((char*)weight,sizeof(GLfloat)*4)));
+ PUTBACK;
+
+ if ( 1 != call_sv(cmd,G_SCALAR) ) {
+ Perl_croak(aTHX_ "sdl_perl_tess_combine_callback failed");
+ }
+
+ data = (double*)POPp;
+ width = (int)POPi;
+ *out = (double*)malloc(sizeof(double)*width);
+ memcpy(*out,data,sizeof(double)*width);
+
+ FREETMPS;
+ LEAVE;
+ LEAVE_TLS_CONTEXT
+}
+
+MODULE = SDL::OpenGL PACKAGE = SDL::OpenGL
+PROTOTYPES : DISABLE
+
+#ifdef HAVE_GL
+
+void
+glClearColor ( r, g, b, a)
+ double r
+ double g
+ double b
+ double a
+ CODE:
+ glClearColor((GLfloat)r,(GLfloat)g,(GLfloat)b,(GLfloat)a);
+
+void
+glClearIndex ( index )
+ double index
+ CODE:
+ glClearIndex(index);
+
+void
+glClearDepth ( depth )
+ double depth
+ CODE:
+ glClearDepth(depth);
+
+void
+glClearStencil ( s )
+ int s
+ CODE:
+ glClearStencil(s);
+
+void
+glClearAccum ( r, g, b, a )
+ double r
+ double g
+ double b
+ double a
+ CODE:
+ glClearAccum((GLfloat)r,(GLfloat)g,(GLfloat)b,(GLfloat)a);
+
+void
+glClear ( m )
+ GLbitfield m
+ CODE:
+ glClear(m);
+
+void
+glFlush ()
+ CODE:
+ glFlush();
+
+void
+glFinish ()
+ CODE:
+ glFinish();
+
+void
+glRect ( r )
+ SDL_Rect* r
+ CODE:
+ glRecti(r->x,r->y,r->x+r->w,r->y+r->h);
+
+void
+glVertex ( x, y, ... )
+ double x
+ double y
+ CODE:
+ double z,w;
+ if ( items == 4 ) {
+ w = SvNV(ST(3));
+ z = SvNV(ST(2));
+ glVertex4d(x,y,z,w);
+ } else if ( items == 3 ) {
+ z = SvNV(ST(2));
+ glVertex3d(x,y,z);
+ } else {
+ glVertex2d(x,y);
+ }
+
+void
+glBegin ( mode )
+ GLenum mode
+ CODE:
+ glBegin(mode);
+
+void
+glEnd ()
+ CODE:
+ glEnd();
+
+void
+glEnable ( cap )
+ GLenum cap
+ CODE:
+ glEnable(cap);
+
+void
+glDisable ( cap )
+ GLenum cap
+ CODE:
+ glDisable(cap);
+
+void
+glGet ( param )
+ GLenum param
+ PPCODE:
+ switch (param) {
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_MAP1_TEXTURE_COORD_1:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_INDEX_LOGIC_OP:
+ case GL_PACK_ALIGNMENT:
+ case GL_CLIP_PLANE4:
+ case GL_TEXTURE_GEN_S:
+ case GL_MAP1_VERTEX_3:
+ case GL_LIGHT6:
+ case GL_LIGHT0:
+ case GL_NORMAL_ARRAY:
+ case GL_EDGE_FLAG:
+ case GL_INDEX_ARRAY:
+ case GL_AUTO_NORMAL:
+ case GL_POLYGON_OFFSET_FILL:
+ case GL_MAP1_TEXTURE_COORD_4:
+ case GL_FOG:
+ case GL_LIGHT2:
+ case GL_UNPACK_SWAP_BYTES:
+ case GL_RGBA_MODE:
+ case GL_POLYGON_OFFSET_POINT:
+ case GL_POINT_SMOOTH:
+ case GL_ALPHA_TEST:
+ case GL_MAP2_TEXTURE_COORD_4:
+ case GL_COLOR_ARRAY:
+ case GL_POLYGON_OFFSET_LINE:
+ case GL_MAP2_NORMAL:
+ case GL_MAP1_INDEX:
+ case GL_PACK_LSB_FIRST:
+ case GL_MAP1_TEXTURE_COORD_2:
+ case GL_MAP2_VERTEX_3:
+ case GL_MAP2_TEXTURE_COORD_2:
+ case GL_CULL_FACE:
+ case GL_DOUBLEBUFFER:
+ case GL_UNPACK_LSB_FIRST:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_LIGHT1:
+ case GL_TEXTURE_GEN_Q:
+ case GL_MAP_STENCIL:
+ case GL_TEXTURE_1D:
+ case GL_LIGHT4:
+ case GL_LIGHTING:
+ case GL_LIGHT7:
+ case GL_MAP1_NORMAL:
+ case GL_CLIP_PLANE0:
+ case GL_TEXTURE_GEN_R:
+ case GL_PACK_SWAP_BYTES:
+ case GL_DEPTH_WRITEMASK:
+ case GL_COLOR_LOGIC_OP:
+ case GL_CLIP_PLANE5:
+ case GL_NORMALIZE:
+ case GL_TEXTURE_2D:
+ case GL_CLIP_PLANE3:
+ case GL_COLOR_MATERIAL:
+ case GL_BLEND:
+ case GL_CLIP_PLANE2:
+ case GL_MAP1_VERTEX_4:
+ case GL_DITHER:
+ case GL_CLIP_PLANE1:
+ case GL_MAP2_INDEX:
+ case GL_POLYGON_SMOOTH:
+ case GL_STEREO:
+ case GL_MAP2_COLOR_4:
+ case GL_LIGHT3:
+ case GL_VERTEX_ARRAY:
+ case GL_MAP1_TEXTURE_COORD_3:
+ case GL_STENCIL_TEST:
+ case GL_MAP2_TEXTURE_COORD_3:
+ case GL_TEXTURE_GEN_T:
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LINE_SMOOTH:
+ case GL_MAP1_COLOR_4:
+ case GL_MAP2_TEXTURE_COORD_1:
+ case GL_CURRENT_RASTER_POSITION_VALID:
+ case GL_INDEX_MODE:
+ case GL_SCISSOR_TEST:
+ case GL_MAP_COLOR:
+ case GL_POLYGON_STIPPLE:
+ case GL_LIGHT5:
+ case GL_DEPTH_TEST:
+ case GL_LINE_STIPPLE:
+ case GL_MAP2_VERTEX_4:
+ {
+ GLboolean ret[1];
+ int i;
+ glGetBooleanv(param, ret);
+
+ for (i = 0; i < 1; i++) {
+ XPUSHs(sv_2mortal(newSViv(ret[i])));
+ }
+ break;
+ }
+ case GL_COLOR_WRITEMASK:
+ {
+ GLboolean ret[4];
+ int i;
+ glGetBooleanv(param, ret);
+
+ for (i = 0; i < 4; i++) {
+ XPUSHs(sv_2mortal(newSViv(ret[i])));
+ }
+ break;
+ }
+ case GL_ZOOM_Y:
+ case GL_ALPHA_TEST_REF:
+ case GL_POINT_SIZE_GRANULARITY:
+ case GL_CURRENT_RASTER_DISTANCE:
+ case GL_ALPHA_SCALE:
+ case GL_RED_BIAS:
+ case GL_DEPTH_BIAS:
+ case GL_FOG_DENSITY:
+ case GL_GREEN_BIAS:
+ case GL_DEPTH_CLEAR_VALUE:
+ case GL_ALPHA_BIAS:
+ case GL_FOG_END:
+ case GL_GREEN_SCALE:
+ case GL_BLUE_BIAS:
+ case GL_DEPTH_SCALE:
+ case GL_POINT_SIZE:
+ case GL_POLYGON_OFFSET_FACTOR:
+ case GL_ZOOM_X:
+ case GL_FOG_START:
+ case GL_POLYGON_OFFSET_UNITS:
+ case GL_LINE_WIDTH:
+ case GL_LINE_WIDTH_GRANULARITY:
+ case GL_BLUE_SCALE:
+ case GL_RED_SCALE:
+ {
+ GLdouble ret[1];
+ int i;
+ glGetDoublev(param, ret);
+
+ for (i = 0; i < 1; i++) {
+ XPUSHs(sv_2mortal(newSVnv(ret[i])));
+ }
+ break;
+ }
+ case GL_MODELVIEW_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ {
+ GLdouble ret[16];
+ int i;
+ glGetDoublev(param, ret);
+
+ for (i = 0; i < 16; i++) {
+ XPUSHs(sv_2mortal(newSVnv(ret[i])));
+ }
+ break;
+ }
+ case GL_POINT_SIZE_RANGE:
+ case GL_LINE_WIDTH_RANGE:
+ case GL_MAP1_GRID_DOMAIN:
+ case GL_DEPTH_RANGE:
+ {
+ GLdouble ret[2];
+ int i;
+ glGetDoublev(param, ret);
+
+ for (i = 0; i < 2; i++) {
+ XPUSHs(sv_2mortal(newSVnv(ret[i])));
+ }
+ break;
+ }
+ case GL_CURRENT_NORMAL:
+ {
+ GLdouble ret[3];
+ int i;
+ glGetDoublev(param, ret);
+
+ for (i = 0; i < 3; i++) {
+ XPUSHs(sv_2mortal(newSVnv(ret[i])));
+ }
+ break;
+ }
+ case GL_FOG_COLOR:
+ case GL_MAP2_GRID_DOMAIN:
+ case GL_CURRENT_RASTER_POSITION:
+ case GL_CURRENT_COLOR:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_CURRENT_RASTER_TEXTURE_COORDS:
+ case GL_TEXTURE_ENV_COLOR:
+ case GL_CURRENT_RASTER_COLOR:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_ACCUM_CLEAR_VALUE:
+ {
+ GLdouble ret[4];
+ int i;
+ glGetDoublev(param, ret);
+
+ for (i = 0; i < 4; i++) {
+ XPUSHs(sv_2mortal(newSVnv(ret[i])));
+ }
+ break;
+ }
+ case GL_CULL_FACE_MODE:
+ case GL_PIXEL_MAP_I_TO_A_SIZE:
+ case GL_PIXEL_MAP_A_TO_A_SIZE:
+ case GL_BLUE_BITS:
+ case GL_EDGE_FLAG_ARRAY_STRIDE:
+ case GL_RENDER_MODE:
+ case GL_FOG_MODE:
+ case GL_DEPTH_FUNC:
+ case GL_READ_BUFFER:
+ case GL_POINT_SMOOTH_HINT:
+ case GL_PACK_SKIP_PIXELS:
+ case GL_STENCIL_REF:
+ case GL_STENCIL_CLEAR_VALUE:
+ case GL_AUX_BUFFERS:
+ case GL_COLOR_MATERIAL_PARAMETER:
+ case GL_ACCUM_BLUE_BITS:
+ case GL_INDEX_SHIFT:
+ case GL_VERTEX_ARRAY_STRIDE:
+ case GL_STENCIL_PASS_DEPTH_PASS:
+ case GL_CLIENT_ATTRIB_STACK_DEPTH:
+ case GL_DRAW_BUFFER:
+ case GL_LINE_STIPPLE_REPEAT:
+ case GL_BLEND_SRC:
+ case GL_PIXEL_MAP_B_TO_B_SIZE:
+ case GL_MAX_PIXEL_MAP_TABLE:
+ case GL_MAX_TEXTURE_SIZE:
+ case GL_PIXEL_MAP_S_TO_S_SIZE:
+ case GL_LOGIC_OP_MODE:
+ case GL_DEPTH_BITS:
+ case GL_GREEN_BITS:
+ case GL_LINE_SMOOTH_HINT:
+ case GL_ALPHA_TEST_FUNC:
+ case GL_MAX_LIGHTS:
+ case GL_FOG_HINT:
+ case GL_MAX_NAME_STACK_DEPTH:
+ case GL_INDEX_ARRAY_TYPE:
+ case GL_TEXTURE_COORD_ARRAY_TYPE:
+ case GL_COLOR_ARRAY_TYPE:
+ case GL_MAX_LIST_NESTING:
+ case GL_STENCIL_WRITEMASK:
+ case GL_LIST_BASE:
+ case GL_ACCUM_ALPHA_BITS:
+ case GL_INDEX_ARRAY_STRIDE:
+ case GL_PIXEL_MAP_I_TO_B_SIZE:
+ case GL_INDEX_BITS:
+ case GL_STENCIL_FAIL:
+ case GL_UNPACK_ALIGNMENT:
+ case GL_STENCIL_PASS_DEPTH_FAIL:
+ case GL_ATTRIB_STACK_DEPTH:
+ case GL_PACK_SKIP_ROWS:
+ case GL_TEXTURE_STACK_DEPTH:
+ case GL_MATRIX_MODE:
+ case GL_COLOR_ARRAY_STRIDE:
+ case GL_LIST_MODE:
+ case GL_UNPACK_SKIP_PIXELS:
+ case GL_PIXEL_MAP_G_TO_G_SIZE:
+ case GL_VERTEX_ARRAY_TYPE:
+ case GL_RED_BITS:
+ case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
+ case GL_INDEX_CLEAR_VALUE:
+ case GL_PIXEL_MAP_I_TO_G_SIZE:
+ case GL_ALPHA_BITS:
+ case GL_PIXEL_MAP_I_TO_R_SIZE:
+ case GL_COLOR_ARRAY_SIZE:
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ case GL_MAP1_GRID_SEGMENTS:
+ case GL_VERTEX_ARRAY_SIZE:
+ case GL_PIXEL_MAP_R_TO_R_SIZE:
+ case GL_TEXTURE_COORD_ARRAY_STRIDE:
+ case GL_MODELVIEW_STACK_DEPTH:
+ case GL_MAX_TEXTURE_STACK_DEPTH:
+ case GL_PIXEL_MAP_I_TO_I_SIZE:
+ case GL_FOG_INDEX:
+ case GL_INDEX_WRITEMASK:
+ case GL_PACK_ROW_LENGTH:
+ case GL_CURRENT_INDEX:
+ case GL_STENCIL_VALUE_MASK:
+ case GL_UNPACK_SKIP_ROWS:
+ case GL_MAX_PROJECTION_STACK_DEPTH:
+ case GL_LIST_INDEX:
+ case GL_STENCIL_FUNC:
+ case GL_INDEX_OFFSET:
+ case GL_UNPACK_ROW_LENGTH:
+ case GL_COLOR_MATERIAL_FACE:
+ case GL_NORMAL_ARRAY_TYPE:
+ case GL_STENCIL_BITS:
+ case GL_PROJECTION_STACK_DEPTH:
+ case GL_CURRENT_RASTER_INDEX:
+ case GL_SHADE_MODEL:
+ case GL_TEXTURE_ENV_MODE:
+ case GL_NORMAL_ARRAY_STRIDE:
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ case GL_MAX_CLIP_PLANES:
+ case GL_MAX_MODELVIEW_STACK_DEPTH:
+ case GL_SUBPIXEL_BITS:
+ case GL_ACCUM_RED_BITS:
+ case GL_BLEND_DST:
+ case GL_FRONT_FACE:
+ case GL_MAX_EVAL_ORDER:
+ case GL_LINE_STIPPLE_PATTERN:
+ case GL_NAME_STACK_DEPTH:
+ case GL_MAX_ATTRIB_STACK_DEPTH:
+ case GL_POLYGON_SMOOTH_HINT:
+ case GL_ACCUM_GREEN_BITS:
+ {
+ GLint ret[1];
+ int i;
+ glGetIntegerv(param, ret);
+
+ for (i = 0; i < 1; i++) {
+ XPUSHs(sv_2mortal(newSViv(ret[i])));
+ }
+ break;
+ }
+ case GL_POLYGON_MODE:
+ case GL_MAX_VIEWPORT_DIMS:
+ case GL_MAP2_GRID_SEGMENTS:
+ {
+ GLint ret[2];
+ int i;
+ glGetIntegerv(param, ret);
+
+ for (i = 0; i < 2; i++) {
+ XPUSHs(sv_2mortal(newSViv(ret[i])));
+ }
+ break;
+ }
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ {
+ GLint ret[4];
+ int i;
+ glGetIntegerv(param, ret);
+
+ for (i = 0; i < 4; i++) {
+ XPUSHs(sv_2mortal(newSViv(ret[i])));
+ }
+ break;
+ }
+ default:
+ croak("Unknown glGet parameter!");
+ }
+
+
+Uint32
+glIsEnabled ( cap )
+ Uint32 cap
+ CODE:
+ RETVAL = glIsEnabled(cap);
+ OUTPUT:
+ RETVAL
+
+void
+glPointSize ( size )
+ double size
+ CODE:
+ glPointSize((GLfloat)size);
+
+void
+glLineWidth ( size )
+ double size
+ CODE:
+ glLineWidth((GLfloat)size);
+
+void
+glLineStipple ( factor, pattern )
+ Sint32 factor
+ Uint16 pattern
+ CODE:
+ glLineStipple(factor,pattern);
+
+void
+glPolygonMode ( face, mode )
+ GLenum face
+ GLenum mode
+ CODE:
+ glPolygonMode(face,mode);
+
+void
+glFrontFace ( mode )
+ GLenum mode
+ CODE:
+ glFrontFace(mode);
+
+void
+glCullFace ( mode )
+ GLenum mode
+ CODE:
+ glCullFace(mode);
+
+void
+glPolygonStipple ( mask )
+ char *mask
+ CODE:
+ glPolygonStipple(mask);
+
+void
+glEdgeFlag ( flag )
+ GLenum flag
+ CODE:
+ glEdgeFlag(flag);
+
+void
+glNormal ( x, y, z )
+ double x
+ double y
+ double z
+ CODE:
+ glNormal3d(x,y,z);
+
+void
+glEnableClientState ( array )
+ GLenum array
+ CODE:
+ glEnableClientState(array);
+
+void
+glDisableClientState ( array )
+ GLenum array
+ CODE:
+ glDisableClientState(array);
+
+void
+glVertexPointer ( size, type, stride, pointer)
+ int size
+ GLenum type
+ Uint32 stride
+ char *pointer
+ CODE:
+ glVertexPointer(size,type,stride,pointer);
+
+void
+glColorPointer ( size, type, stride, pointer )
+ Sint32 size
+ GLenum type
+ Uint32 stride
+ char *pointer
+ CODE:
+ glColorPointer(size,type,stride,pointer);
+
+void
+glNormalPointer ( type, stride, pointer )
+ GLenum type
+ Uint32 stride
+ char *pointer
+ CODE:
+ glNormalPointer(type,stride,pointer);
+
+void
+glTexCoordPointer ( size, type, stride, pointer )
+ Sint32 size
+ GLenum type
+ Uint32 stride
+ char *pointer
+ CODE:
+ glTexCoordPointer(size,type,stride,pointer);
+
+void
+glEdgeFlagPointer ( stride, pointer )
+ Uint32 stride
+ char *pointer
+ CODE:
+ glEdgeFlagPointer(stride,pointer);
+
+void
+glArrayElement ( ith )
+ Uint32 ith
+ CODE:
+ glArrayElement(ith);
+
+void
+glDrawElements ( mode, count, type, indices )
+ GLenum mode
+ Uint32 count
+ GLenum type
+ char *indices
+ CODE:
+ glDrawElements( mode, count, type, indices);
+
+void
+glDrawRangeElements ( mode, start, end, count, type, indices )
+ GLenum mode
+ Uint32 start
+ Uint32 end
+ Uint32 count
+ GLenum type
+ char *indices
+ CODE:
+ glDrawRangeElements(mode,start,end,count,type,indices);
+
+void
+glDrawArrays ( mode, first, count )
+ GLenum mode
+ Uint32 first
+ Uint32 count
+ CODE:
+ glDrawArrays(mode,first,count);
+
+void
+glInterleavedArrays ( format, stride, pointer )
+ GLenum format
+ Uint32 stride
+ char *pointer
+ CODE:
+ glInterleavedArrays(format,stride,pointer);
+
+void
+glPushAttrib ( mask )
+ GLbitfield mask
+ CODE:
+ glPushAttrib(mask);
+
+void
+glPopAttrib ()
+ CODE:
+ glPopAttrib();
+
+void
+glPushClientAttrib ( mask )
+ GLbitfield mask
+ CODE:
+ glPushClientAttrib(mask);
+
+void
+glPopClientAttrib ()
+ CODE:
+ glPopClientAttrib();
+
+void
+glMatrixMode ( mode )
+ GLenum mode
+ CODE:
+ glMatrixMode(mode);
+
+void
+glLoadIdentity ()
+ CODE:
+ glLoadIdentity();
+
+void
+glLoadMatrix ( ... )
+ CODE:
+ int i;
+ double mat[16];
+ for ( i = 0; i < 16; i++ ) {
+ mat[i] = (i < items && SvNOK(ST(i)) ? SvNV(ST(i)) : 0.0 );
+ }
+ glLoadMatrixd(mat);
+
+void
+glMultMatrix ( ... )
+ CODE:
+ int i;
+ double mat[16];
+ for ( i = 0; i < 16; i++ ) {
+ mat[i] = (i < items && SvNOK(ST(i)) ? SvNV(ST(i)) : 0.0 );
+ }
+ glMultMatrixd(mat);
+
+void
+glTranslate ( x, y, z )
+ double x
+ double y
+ double z
+ CODE:
+ glTranslated(x,y,z);
+
+void
+glRotate ( angle, x, y, z )
+ double angle
+ double x
+ double y
+ double z
+ CODE:
+ glRotated(angle,x,y,z);
+
+void
+glScale ( x, y, z )
+ double x
+ double y
+ double z
+ CODE:
+ glScaled(x,y,z);
+
+void
+glFrustum ( left, right, bottom, top, n, f )
+ double left
+ double right
+ double bottom
+ double top
+ double n
+ double f
+ CODE:
+ glFrustum(left,right,bottom,top,n,f);
+
+void
+glOrtho ( left, right, bottom, top, n, f )
+ double left
+ double right
+ double bottom
+ double top
+ double n
+ double f
+ CODE:
+ glOrtho(left,right,bottom,top,n,f);
+
+void
+glViewport ( x, y, width, height )
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Uint32 height
+ CODE:
+ glViewport(x,y,width,height);
+
+void
+glDepthRange ( n, f )
+ double n
+ double f
+ CODE:
+ glDepthRange(n,f);
+
+void
+glPushMatrix ()
+ CODE:
+ glPushMatrix();
+
+void
+glPopMatrix ()
+ CODE:
+ glPopMatrix();
+
+void
+glClipPlane ( plane, ... )
+ GLenum plane
+ CODE:
+ double v[4];
+ int i;
+ for (i = 0; i < 4; i++ ) {
+ v[i] = (i+1 < items && SvNOK(ST(i+1))) ? SvNV(ST(i+1)) : 0.0;
+ }
+ glClipPlane(plane,v);
+
+void
+glColor ( r, g, b, ... )
+ double r
+ double g
+ double b
+ CODE:
+ if ( items == 4 ) {
+ double a;
+ a = SvNV(ST(3));
+ glColor4d(r,g,b,a);
+ } else {
+ glColor3d(r,g,b);
+ }
+
+void
+glIndex ( c )
+ Uint32 c
+ CODE:
+ glIndexi(c);
+
+void
+glShadeModel ( mode )
+ GLenum mode
+ CODE:
+ glShadeModel(mode);
+
+void
+glLight ( light, name, ... )
+ GLenum light
+ GLenum name
+ CODE:
+ int i;
+ if ( items == 6 ) {
+ float v[4];
+ for ( i = 0; i < 4; i++ ) {
+ v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+ }
+ glLightfv(light,name,v);
+ } else if ( items == 5 ) {
+ float v[3];
+ for ( i = 0; i < 3; i++ ) {
+ v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+ }
+ glLightfv(light,name,v);
+ } else if ( items == 3 ) {
+ float v;
+ v = SvNV(ST(2));
+ glLightf(light,name,v);
+ } else {
+ Perl_croak(aTHX_ "SDL::OpenGL::Light invalid arguments");
+ }
+
+void
+glLightModel ( pname, ... )
+ GLenum pname
+ CODE:
+ GLfloat vec[4];
+ if ( pname == GL_LIGHT_MODEL_LOCAL_VIEWER ||
+ pname == GL_LIGHT_MODEL_TWO_SIDE ||
+ pname == GL_LIGHT_MODEL_COLOR_CONTROL ) {
+ glLightModelf(pname,SvNV(ST(1)));
+ } else if ( pname == GL_LIGHT_MODEL_AMBIENT) {
+ vec[0] = SvNV(ST(1));
+ vec[1] = SvNV(ST(2));
+ vec[2] = SvNV(ST(3));
+ vec[3] = SvNV(ST(4));
+ glLightModelfv(pname,vec);
+ } else {
+ Perl_croak(aTHX_ "SDL::OpenGL::glLightModel unknown model %d",pname);
+ }
+
+void
+glMaterial ( face, name, ... )
+ GLenum face
+ GLenum name
+ CODE:
+ int i;
+ if ( items == 6 ) {
+ float v[4];
+ for ( i = 0; i < 4; i++ ) {
+ v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+ }
+ glMaterialfv(face,name,v);
+ } else if ( items == 5 ) {
+ float v[3];
+ for ( i = 0; i < 4; i++ ) {
+ v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+ }
+ glMaterialfv(face,name,v);
+ } else if ( items == 3 ) {
+ float v;
+ v = SvNV(ST(2));
+ glMaterialf(face,name,v);
+ } else {
+ Perl_croak(aTHX_ "SDL::OpenGL::Material invalid arguments");
+ }
+
+void
+glColorMaterial ( face, mode )
+ GLenum face
+ GLenum mode
+ CODE:
+ glColorMaterial(face,mode);
+
+void
+glBlendFunc ( sfactor, dfactor )
+ GLenum sfactor
+ GLenum dfactor
+ CODE:
+ glBlendFunc(sfactor,dfactor);
+
+
+void
+glHint ( target, hint )
+ GLenum target
+ GLenum hint
+ CODE:
+ glHint(target,hint);
+
+void
+glFog ( name, ... )
+ GLenum name
+ CODE:
+ if ( items == 5 ) {
+ float v[4];
+ v[0] = SvNV(ST(1));
+ v[1] = SvNV(ST(2));
+ v[2] = SvNV(ST(3));
+ v[3] = SvNV(ST(4));
+ glFogfv(name,v);
+ } else if ( items == 2 ) {
+ float v;
+ v = SvNV(ST(1));
+ glFogf(name,v);
+ } else {
+ Perl_croak(aTHX_ "SDL::OpenGL::Material invalid arguments");
+ }
+
+void
+glPolygonOffset ( factor, units )
+ double factor
+ double units
+ CODE:
+ glPolygonOffset(factor,units);
+
+Uint32
+glGenLists ( range )
+ Uint32 range
+ CODE:
+ RETVAL = glGenLists(range);
+ OUTPUT:
+ RETVAL
+
+void
+glNewList ( list, mode )
+ Uint32 list
+ GLenum mode
+ CODE:
+ glNewList(list,mode);
+
+void
+glEndList ()
+ CODE:
+ glEndList();
+
+void
+glDeleteLists ( base, count )
+ Uint32 base
+ Uint32 count
+ CODE:
+ glDeleteLists(base, count);
+
+void
+glCallList ( list )
+ Uint32 list
+ CODE:
+ glCallList(list);
+
+Uint32
+glIsList ( list )
+ Uint32 list
+ CODE:
+ RETVAL = glIsList(list);
+ OUTPUT:
+ RETVAL
+
+void
+glListBase ( base )
+ Uint32 base
+ CODE:
+ glListBase(base);
+
+void
+glCallLists ( ... )
+ CODE:
+ int *i, j;
+ if ( items > 0 ) {
+ i = (int*)safemalloc(sizeof(int)* (items));
+ for ( j = 0; j < items; j++ ) {
+ i[j] = SvIV(ST(j));
+ }
+ } else {
+ Perl_croak(aTHX_ "usage: SDL::OpenGL::CallLists(type,...)");
+ }
+ glCallLists(items, GL_INT, i);
+ safefree(i);
+
+void
+glCallListsString ( string )
+ SV* string
+ CODE:
+ char *str;
+ STRLEN len;
+ str = SvPV(string,len);
+ glCallLists(len,GL_BYTE,str);
+
+void
+glRasterPos ( x, y, z, ... )
+ double x
+ double y
+ double z
+ CODE:
+ if ( items == 4 ) {
+ double w = SvNV(ST(3));
+ glRasterPos4d(x,y,z,w);
+ } else {
+ glRasterPos3d(x,y,z);
+ }
+
+void
+glBitmap ( width, height, x1, y1, x2, y2, data )
+ Uint32 width
+ Uint32 height
+ double x1
+ double y1
+ double x2
+ double y2
+ char *data
+ CODE:
+ glBitmap(width,height,x1,y1,x2,y2,data);
+
+void
+glDrawPixels ( width, height, format, type, pixels )
+ Uint32 width
+ Uint32 height
+ GLenum format
+ GLenum type
+ char *pixels
+ CODE:
+ glDrawPixels(width,height,format,type,pixels);
+
+
+SV*
+glReadPixels ( x, y, width, height, format, type )
+ Uint32 x
+ Uint32 y
+ Uint32 height
+ Uint32 width
+ GLenum format
+ GLenum type
+ CODE:
+ int len, size;
+ char *buf;
+ size = 1; /* ALPHA, BLUE, GREEN or RED */
+ if (format == GL_BGR || format == GL_RGB)
+ size = 3;
+ if (format == GL_BGRA || format == GL_RGBA)
+ size = 4;
+ len = height * width * size; /* in bytes */
+ RETVAL = newSV(len); /* alloc len+1 bytes */
+ SvPOK_on(RETVAL); /* make an PV */
+ buf = SvPVX(RETVAL); /* get ptr to buffer */
+ glReadPixels(x,y,width,height,format,type,buf);
+ SvCUR_set(RETVAL, len); /* set real length */
+ OUTPUT:
+ RETVAL
+
+AV*
+glReadPixel ( x, y )
+ Uint32 x
+ Uint32 y
+ CODE:
+ int rgba[4]; /* r,g,b,a */
+ int i;
+ glReadPixels(x,y,1,1,GL_RGBA,GL_UNSIGNED_INT,rgba);
+ RETVAL = newAV();
+ for ( i = 0; i < 4; i++ ) {
+ av_push(RETVAL,newSViv(rgba[i]));
+ }
+ OUTPUT:
+ RETVAL
+
+void
+glCopyPixels ( x, y, width, height, buffer )
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Uint32 height
+ GLenum buffer
+ CODE:
+ glCopyPixels(x,y,width,height,buffer);
+
+void
+glPixelStore ( name, param )
+ Sint32 name
+ double param
+ CODE:
+ glPixelStorei(name,param);
+
+void
+glPixelTransfer ( name, ... )
+ GLenum name
+ CODE:
+ switch ( name ) {
+ case GL_MAP_COLOR:
+ case GL_MAP_STENCIL:
+ case GL_INDEX_SHIFT:
+ case GL_INDEX_OFFSET:
+ glPixelTransferi(name,SvIV(ST(1)));
+ break;
+ default:
+ glPixelTransferf(name,SvNV(ST(1)));
+ break;
+ }
+
+void
+glPixelMap ( type, map, mapsize, values )
+ GLenum type
+ GLenum map
+ Sint32 mapsize
+ char *values
+ CODE:
+ switch (type) {
+ case GL_UNSIGNED_INT:
+ glPixelMapuiv(map,mapsize,(GLint*)values);
+ break;
+ case GL_UNSIGNED_SHORT:
+ glPixelMapusv(map,mapsize,(GLushort*)values);
+ break;
+ case GL_FLOAT:
+ glPixelMapfv(map,mapsize,(GLfloat*)values);
+ break;
+ }
+
+void
+glPixelZoom ( zoomx, zoomy )
+ double zoomx
+ double zoomy
+ CODE:
+ glPixelZoom(zoomx,zoomy);
+
+#ifdef GL_VERSION_1_3
+
+void
+glColorTable ( target, internalFormat, width, format, type, data )
+ GLenum target
+ GLenum internalFormat
+ Uint32 width
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ glColorTable(target,internalFormat,width,format,type,data);
+
+void
+glColorTableParameter ( target, name, r, g, b, a)
+ GLenum target
+ GLenum name
+ double r
+ double g
+ double b
+ double a
+ CODE:
+ GLfloat vec[4];
+ vec[0] = r;
+ vec[1] = g;
+ vec[2] = b;
+ vec[3] = a;
+ glColorTableParameterfv(target,name,vec);
+
+void
+glCopyColorTable ( target, internalFormat, x, y, width )
+ GLenum target
+ GLenum internalFormat
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ CODE:
+ glCopyColorTable(target,internalFormat,x,y,width);
+
+void
+glColorSubTable ( target, start, count, format, type, data )
+ Uint32 target
+ Uint32 start
+ Uint32 count
+ Uint32 format
+ Uint32 type
+ char *data
+ CODE:
+ glColorSubTable(target,start,count,format,type,data);
+
+void
+glCopyColorSubTable ( target, start, x, y, count )
+ Uint32 target
+ Uint32 start
+ Sint32 x
+ Sint32 y
+ Uint32 count
+ CODE:
+ glCopyColorSubTable(target,start,x,y,count);
+
+void
+glConvolutionFilter2D ( target, internalFormat, width, height, format, type, image )
+ Uint32 target
+ Uint32 internalFormat
+ Uint32 width
+ Uint32 height
+ Uint32 format
+ Uint32 type
+ char *image
+ CODE:
+ glConvolutionFilter2D(target,internalFormat,width,height,format,type,image);
+
+void
+glCopyConvolutionFilter2D ( target, internalFormat, x, y, width, height )
+ Uint32 target
+ Uint32 internalFormat
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Uint32 height
+ CODE:
+ glCopyConvolutionFilter2D(target,internalFormat,x,y,width,height);
+
+void
+glSeparableFilter2D ( target, internalFormat, width, height, format, type, row, column )
+ Uint32 target
+ Uint32 internalFormat
+ Uint32 width
+ Uint32 height
+ Uint32 format
+ Uint32 type
+ char *row
+ char *column
+ CODE:
+ glSeparableFilter2D(target,internalFormat,width,height,format,type,row,column);
+
+void
+glConvolutionFilter1D ( target, internalFormat, width, format, type, image )
+ Uint32 target
+ Uint32 internalFormat
+ Uint32 width
+ Uint32 format
+ Uint32 type
+ char *image
+ CODE:
+ glConvolutionFilter1D(target,internalFormat,width,format,type,image);
+
+void
+glCopyConvolutionFilter1D ( target, internalFormat, x, y, width )
+ Uint32 target
+ Uint32 internalFormat
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ CODE:
+ glCopyConvolutionFilter1D(target,internalFormat,x,y,width);
+
+void
+glConvolutionParameter ( target, pname, ... )
+ Uint32 target
+ Uint32 pname
+ CODE:
+ Uint32 pi;
+ GLfloat pv[4];
+ switch(pname) {
+ case GL_CONVOLUTION_BORDER_MODE:
+ if ( items != 3 )
+ Perl_croak(aTHX_ "Usage: ConvolutionParameter(target,pname,...)");
+ pi = SvIV(ST(2));
+ glConvolutionParameteri(target,pname,pi);
+ break;
+ case GL_CONVOLUTION_FILTER_SCALE:
+ case GL_CONVOLUTION_FILTER_BIAS:
+ if ( items != 6 )
+ Perl_croak(aTHX_ "Usage: ConvolutionParameter(target,pname,...)");
+ pv[0] = (GLfloat)SvNV(ST(2));
+ pv[1] = (GLfloat)SvNV(ST(3));
+ pv[2] = (GLfloat)SvNV(ST(4));
+ pv[3] = (GLfloat)SvNV(ST(5));
+ glConvolutionParameterfv(target,pname,pv);
+ break;
+ default:
+ Perl_croak(aTHX_ "ConvolutionParameter invalid parameter");
+ break;
+ }
+
+void
+glHistogram ( target, width, internalFormat, sink )
+ Uint32 target
+ Uint32 width
+ Uint32 internalFormat
+ GLboolean sink
+ CODE:
+ glHistogram(target,width,internalFormat,sink);
+
+void
+glGetHistogram ( target, reset, format, type, values )
+ Uint32 target
+ GLboolean reset
+ Uint32 format
+ Uint32 type
+ char *values
+ CODE:
+ glGetHistogram(target,reset,format,type,values);
+
+void
+glResetHistogram ( target )
+ Uint32 target
+ CODE:
+ glResetHistogram(target);
+
+void
+glMinmax ( target, internalFormat, sink )
+ Uint32 target
+ Uint32 internalFormat
+ GLboolean sink
+ CODE:
+ glMinmax(target,internalFormat,sink);
+
+void
+glGetMinmax ( target, reset, format, type, values )
+ Uint32 target
+ GLboolean reset
+ Uint32 format
+ Uint32 type
+ char *values
+ CODE:
+ glGetMinmax(target,reset,format,type,values);
+
+void
+glResetMinmax ( target )
+ Uint32 target
+ CODE:
+ glResetMinmax(target);
+
+void
+glBlendEquation ( mode )
+ Uint32 mode
+ CODE:
+ glBlendEquation(mode);
+
+#endif // GL_VERSION_1_3
+
+void
+glTexImage2D ( target, level, internalFormat, width, height, border, format, type, data )
+ GLenum target
+ Sint32 level
+ Sint32 internalFormat
+ Uint32 width
+ Uint32 height
+ Sint32 border
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ glTexImage2D(target,level,internalFormat,width,height,border,format,type,data);
+
+void
+glCopyTexImage2D ( target, level, internalFormat, x, y, width, height, border )
+ GLenum target
+ Sint32 level
+ Sint32 internalFormat
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Uint32 height
+ Sint32 border
+ CODE:
+ glCopyTexImage2D(target,level,internalFormat,x,y,width,height,border);
+
+void
+glTexSubImage2D ( target, level, xoffset, yoffset, width, height, format, type, data )
+ GLenum target
+ Sint32 level
+ Sint32 xoffset
+ Sint32 yoffset
+ Uint32 width
+ Uint32 height
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,data);
+
+void
+glCopyTexSubImage2D ( target, level, xoffset, yoffset, x, y, width, height )
+ GLenum target
+ Sint32 level
+ Sint32 xoffset
+ Sint32 yoffset
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Uint32 height
+ CODE:
+ glCopyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height);
+
+void
+glTexImage1D ( target, level, internalFormat, width, border, format, type, data )
+ GLenum target
+ Sint32 level
+ Sint32 internalFormat
+ Uint32 width
+ Sint32 border
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ glTexImage1D(target,level,internalFormat,width,border,format,type,data);
+
+void
+glTexSubImage1D ( target, level, xoffset, width, format, type, data )
+ GLenum target
+ Sint32 level
+ Sint32 xoffset
+ Uint32 width
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ glTexSubImage1D(target,level,xoffset,width,format,type,data);
+
+void
+glCopyTexImage1D ( target, level, internalFormat, x, y, width, border )
+ GLenum target
+ Sint32 level
+ Sint32 internalFormat
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Sint32 border
+ CODE:
+ glCopyTexImage1D(target,level,internalFormat,x,y,width,border);
+
+void
+glCopyTexSubImage1D ( target, level, xoffset, x, y, width )
+ GLenum target
+ Sint32 level
+ Sint32 xoffset
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ CODE:
+ glCopyTexSubImage1D(target,level,xoffset,x,y,width);
+
+#ifdef GL_VERSION_1_3
+
+void
+glTexImage3D ( target, level, internalFormat, width, height, depth, border, format, type, data )
+ GLenum target
+ Sint32 level
+ Sint32 internalFormat
+ Uint32 width
+ Uint32 height
+ Uint32 depth
+ Sint32 border
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ glTexImage3D(target,level,internalFormat,width,height,depth,border,format,type,data);
+
+void
+glTexSubImage3D ( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data )
+ GLenum target
+ Sint32 level
+ Sint32 xoffset
+ Sint32 yoffset
+ Sint32 zoffset
+ Uint32 width
+ Uint32 height
+ Uint32 depth
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ glTexSubImage3D(target,level,xoffset,yoffset,zoffset,
+ width,height,depth,format,type,data);
+
+void
+glCopyTexSubImage3D ( target, level, xoffset, yoffset, zoffset, x, y, width, height )
+ GLenum target
+ Sint32 level
+ Sint32 xoffset
+ Sint32 yoffset
+ Sint32 zoffset
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Uint32 height
+ CODE:
+ glCopyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height);
+
+#endif // GL_VERSION_1_3
+
+AV*
+glGenTextures ( n )
+ Uint32 n;
+ CODE:
+ Uint32 i;
+ Uint32 *names;
+ names = (Uint32*)safemalloc(sizeof(Uint32)*n);
+ RETVAL = newAV();
+ glGenTextures(n,names);
+ for ( i = 0; i < n; i++ ) {
+ av_push(RETVAL,newSViv(names[i]));
+ }
+ safefree(names);
+ OUTPUT:
+ RETVAL
+
+GLboolean
+glIsTexture ( texture )
+ Uint32 texture
+ CODE:
+ RETVAL = glIsTexture(texture);
+ OUTPUT:
+ RETVAL
+
+void
+glBindTexture ( target, texture )
+ GLenum target
+ Uint32 texture
+ CODE:
+ glBindTexture(target,texture);
+
+void
+glDeleteTextures ( ... )
+ CODE:
+ Uint32 *textures;
+ int i;
+ textures = (Uint32*)safemalloc(sizeof(Uint32) * items);
+ if ( textures ) {
+ for ( i = 0; i < items; i++ ) {
+ textures[i] = SvIV(ST(i));
+ }
+ }
+ glDeleteTextures(items,textures);
+ safefree(textures);
+
+AV*
+glAreTexturesResident ( ... )
+ CODE:
+ Uint32 *textures;
+ GLboolean *homes;
+ int i;
+ RETVAL = newAV();
+ textures = (Uint32*)safemalloc(sizeof(Uint32) * items);
+ homes = (GLboolean*)safemalloc(sizeof(GLboolean) * items);
+ if ( textures ) {
+ for ( i = 0; i < items; i++ ) {
+ textures[i] = SvIV(ST(i));
+ }
+ }
+ if ( GL_FALSE != glAreTexturesResident(items,textures,homes)) {
+ for (i = 0; i < items; i++ ) {
+ av_push(RETVAL,newSViv(homes[i]));
+ }
+ }
+ safefree(homes);
+ safefree(textures);
+ OUTPUT:
+ RETVAL
+
+void
+glPrioritizeTextures ( n, names, priorities )
+ Uint32 n
+ char *names
+ char *priorities
+ CODE:
+ glPrioritizeTextures(n,(GLuint*)names,(const GLclampf *)priorities);
+
+void
+glTexEnv ( target, name, ... )
+ GLenum target
+ GLenum name
+ CODE:
+ float pv[4];
+ GLint p;
+ switch(name) {
+ case GL_TEXTURE_ENV_MODE:
+ p = SvIV(ST(2));
+ glTexEnvi(target,name,p);
+ break;
+ case GL_TEXTURE_ENV_COLOR:
+ pv[0] = SvNV(ST(2));
+ pv[1] = SvNV(ST(3));
+ pv[2] = SvNV(ST(4));
+ pv[3] = SvNV(ST(5));
+ glTexEnvfv(target,name,pv);
+ break;
+ }
+
+void
+glTexCoord ( ... )
+ CODE:
+ double s,t,r,q;
+ if ( items < 1 || items > 4 )
+ Perl_croak (aTHX_ "usage: SDL::OpenGL::TexCoord(s,[t,[r,[q]]])");
+ s = t = r = 0.0;
+ q = 1.0;
+ switch(items) {
+ case 4:
+ q = SvNV(ST(3));
+ case 3:
+ r = SvNV(ST(2));
+ case 2:
+ t = SvNV(ST(1));
+ case 1:
+ s = SvNV(ST(0));
+ }
+ glTexCoord4d(s,t,r,q);
+
+void
+glTexParameter ( target, name, ... )
+ GLenum target
+ GLenum name
+ CODE:
+ GLfloat pv[4];
+ GLint p;
+ switch (name) {
+ case GL_TEXTURE_BORDER_COLOR:
+ pv[0] = SvNV(ST(2));
+ pv[1] = SvNV(ST(3));
+ pv[2] = SvNV(ST(4));
+ pv[3] = SvNV(ST(5));
+ glTexParameterfv(target,name,pv);
+ break;
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ pv[0] = SvNV(ST(2));
+ glTexParameterf(target,name,pv[0]);
+ break;
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ default:
+ p = SvIV(ST(2));
+ glTexParameteri(target,name,p);
+ break;
+ }
+
+void
+glTexGen ( coord, name, ... )
+ GLenum coord
+ GLenum name
+ CODE:
+ GLdouble *pv;
+ GLint p;
+ int i;
+ switch (name) {
+ case GL_TEXTURE_GEN_MODE:
+ p = SvIV(ST(2));
+ glTexGeni(coord,name,p);
+ break;
+ default:
+ if ( items == 2 )
+ Perl_croak(aTHX_ "usage: glTexGen(coord,name,...)");
+ pv = (GLdouble*)safemalloc(sizeof(GLdouble)*(items-2));
+ for ( i = 0; i < items - 2; i++ ) {
+ pv[i] = SvNV(ST(i+2));
+ }
+ glTexGendv(coord,name,pv);
+ safefree(pv);
+ break;
+ }
+
+#ifdef GL_VERSION_1_3
+
+void
+glActiveTextureARB ( texUnit )
+ GLenum texUnit
+ CODE:
+ glActiveTextureARB(texUnit);
+
+void
+glMultiTexCoord ( texUnit, ... )
+ Uint32 texUnit
+ CODE:
+ double s,t,r,q;
+ if ( items < 2 || items > 5 )
+ Perl_croak (aTHX_ "usage: SDL::OpenGL::MultiTexCoord(tex,s,[t,[r,[q]]])");
+ s = t = r = 0.0;
+ q = 1.0;
+ switch(items) {
+ case 5:
+ q = SvNV(ST(3));
+ case 4:
+ r = SvNV(ST(2));
+ case 3:
+ t = SvNV(ST(1));
+ case 2:
+ s = SvNV(ST(0));
+ }
+ glMultiTexCoord4dARB(texUnit,s,t,r,q);
+
+#endif // GL_VERSION_1_3
+
+void
+glDrawBuffer ( mode )
+ GLenum mode
+ CODE:
+ glDrawBuffer(mode);
+
+void
+glReadBuffer ( mode )
+ GLenum mode
+ CODE:
+ glReadBuffer(mode);
+
+void
+glIndexMask ( mask )
+ Uint32 mask
+ CODE:
+ glIndexMask(mask);
+
+void
+glColorMask ( red, green, blue, alpha )
+ GLboolean red
+ GLboolean green
+ GLboolean blue
+ GLboolean alpha
+ CODE:
+ glColorMask(red,green,blue,alpha);
+
+void
+glDepthMask ( flag )
+ GLboolean flag
+ CODE:
+ glDepthMask(flag);
+
+void
+glStencilMask ( mask )
+ Uint32 mask
+ CODE:
+ glStencilMask(mask);
+
+void
+glScissor ( x , y, width, height )
+ Sint32 x
+ Sint32 y
+ Uint32 width
+ Uint32 height
+ CODE:
+ glScissor(x,y,width,height);
+
+void
+glAlphaFunc ( func, ref )
+ GLenum func
+ double ref
+ CODE:
+ glAlphaFunc(func,ref);
+
+void
+glStencilFunc ( func, ref, mask )
+ GLenum func
+ Sint32 ref
+ Uint32 mask
+ CODE:
+ glStencilFunc(func,ref,mask);
+
+void
+glStencilOp ( fail, zfail, zpass )
+ GLenum fail
+ GLenum zfail
+ GLenum zpass
+ CODE:
+ glStencilOp(fail,zfail,zpass);
+
+void
+glDepthFunc ( func )
+ GLenum func
+ CODE:
+ glDepthFunc(func);
+
+void
+glLogicOp ( opcode )
+ GLenum opcode
+ CODE:
+ glLogicOp(opcode);
+
+void
+glAccum ( op, value )
+ GLenum op
+ double value
+ CODE:
+ glAccum(op,value);
+
+void
+glMap1 ( target, u1, u2, stride, order, points )
+ GLenum target
+ double u1
+ double u2
+ Sint32 stride
+ Sint32 order
+ char *points
+ CODE:
+ glMap1d(target,u1,u2,stride,order,(double*)points);
+
+void
+glEvalCoord1 ( u )
+ double u
+ CODE:
+ glEvalCoord1d(u);
+
+void
+glMapGrid1 ( n, u1, u2 )
+ Sint32 n
+ double u1
+ double u2
+ CODE:
+ glMapGrid1d(n,u1,u2);
+
+void
+glEvalMesh1 ( mode, p1, p2 )
+ GLenum mode
+ Sint32 p1
+ Sint32 p2
+ CODE:
+ glEvalMesh1(mode,p1,p2);
+
+void
+glMap2 ( target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points )
+ GLenum target
+ double u1
+ double u2
+ Sint32 ustride
+ Sint32 uorder
+ double v1
+ double v2
+ Sint32 vstride
+ Sint32 vorder
+ char *points
+ CODE:
+ glMap2d(target,u1,u2,ustride,uorder,v1,v2,vstride,vorder,(double*)points);
+
+void
+glEvalCoord2 ( u, v )
+ double u
+ double v
+ CODE:
+ glEvalCoord2d(u,v);
+
+void
+glMapGrid2 ( nu, u1, u2, nv, v1, v2 )
+ Sint32 nu
+ double u1
+ double u2
+ Sint32 nv
+ double v1
+ double v2
+ CODE:
+ glMapGrid2d(nu,u1,u2,nv,v1,v2);
+
+void
+glEvalMesh2 ( mode, i1, i2, j1, j2 )
+ GLenum mode
+ Sint32 i1
+ Sint32 i2
+ Sint32 j1
+ Sint32 j2
+ CODE:
+ glEvalMesh2(mode,i1,i2,j1,j2);
+
+GLenum
+glGetError ( )
+ CODE:
+ RETVAL = glGetError();
+ OUTPUT:
+ RETVAL
+
+GLint
+glRenderMode ( mode )
+ GLenum mode
+ CODE:
+ RETVAL = glRenderMode( mode );
+ OUTPUT:
+ RETVAL
+
+void
+glInitNames ( )
+ CODE:
+ glInitNames();
+
+void
+glPushName ( name )
+ GLuint name
+ CODE:
+ glPushName(name);
+
+void
+glPopName ( )
+ CODE:
+ glPopName();
+
+void
+glLoadName ( name )
+ GLuint name
+ CODE:
+ glLoadName(name);
+
+void
+glFeedbackBuffer ( size, type, buffer )
+ GLuint size
+ GLenum type
+ float* buffer
+ CODE:
+ glFeedbackBuffer(size,type,buffer);
+
+void
+glPassThrough ( token )
+ GLfloat token
+ CODE:
+ glPassThrough(token);
+
+
+#endif
+
+#ifdef HAVE_GLU
+
+void
+gluLookAt ( eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz )
+ double eyex
+ double eyey
+ double eyez
+ double centerx
+ double centery
+ double centerz
+ double upx
+ double upy
+ double upz
+ CODE:
+ gluLookAt(eyex,eyey,eyez,centerx,centery,centerz,upx,upy,upz);
+
+void
+gluPerspective ( fovy, aspect, n, f )
+ double fovy
+ double aspect
+ double n
+ double f
+ CODE:
+ gluPerspective(fovy,aspect,n,f);
+
+void
+gluPickMatrix ( x, y, delx, dely, viewport )
+ double x
+ double y
+ double delx
+ double dely
+ GLint* viewport
+ CODE:
+ gluPickMatrix(x,y,delx,dely,viewport);
+
+void
+gluOrtho2D ( left, right, bottom, top )
+ double left
+ double right
+ double bottom
+ double top
+ CODE:
+ gluOrtho2D(left,right,bottom,top);
+
+int
+gluScaleImage ( format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout )
+ GLenum format
+ Uint32 widthin
+ Uint32 heightin
+ GLenum typein
+ char *datain
+ Uint32 widthout
+ Uint32 heightout
+ GLenum typeout
+ char *dataout
+ CODE:
+ RETVAL = gluScaleImage(format,widthin,heightin,typein,datain,
+ widthout,heightout,typeout,dataout);
+ OUTPUT:
+ RETVAL
+
+int
+gluBuild1DMipmaps ( target, internalFormat, width, format, type, data )
+ GLenum target
+ Sint32 internalFormat
+ Uint32 width
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ RETVAL = gluBuild1DMipmaps(target,internalFormat,width,format,type,data);
+ OUTPUT:
+ RETVAL
+
+int
+gluBuild2DMipmaps ( target, internalFormat, width, height, format, type, data )
+ GLenum target
+ Sint32 internalFormat
+ Uint32 width
+ Uint32 height
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ RETVAL = gluBuild2DMipmaps(target,internalFormat,width,height,format,type,data);
+ OUTPUT:
+ RETVAL
+
+
+#if HAVE_GLU_VERSION >= 12
+int
+gluBuild3DMipmaps ( target, internalFormat, width, height, depth, format, type, data )
+ GLenum target
+ Sint32 internalFormat
+ Uint32 width
+ Uint32 height
+ Uint32 depth
+ GLenum format
+ GLenum type
+ char *data
+ CODE:
+ RETVAL = gluBuild3DMipmaps(target,internalFormat,width,height,depth,
+ format,type,data);
+ OUTPUT:
+ RETVAL
+
+#else
+void
+gluBuild3DMipmaps ( )
+ CODE:
+ Perl_croak (aTHX_ "SDL::OpenGL::Build3DMipmaps requires GLU 1.2");
+
+#endif
+
+#if HAVE_GLU_VERSION >= 12
+int
+gluBuild1DMipmapLevels ( target, internalFormat, width, format, type, level, base, max, data )
+ GLenum target
+ Sint32 internalFormat
+ Uint32 width
+ GLenum format
+ GLenum type
+ Sint32 level
+ Sint32 base
+ Sint32 max
+ char *data
+ CODE:
+ RETVAL = gluBuild1DMipmapLevels(target,internalFormat,width,
+ format,type,level,base,max,data);
+ OUTPUT:
+ RETVAL
+
+#else
+void
+gluBuild1DMipmapLevels ()
+ CODE:
+ Perl_croak(aTHX_ "SDL::OpenGL::Build1DMipmapLevels requires GLU 1.2");
+
+#endif
+
+#if HAVE_GLU_VERSION >= 12
+int
+gluBuild2DMipmapLevels ( target, internalFormat, width, height, format, type, level, base, max, data )
+ GLenum target
+ Sint32 internalFormat
+ Uint32 width
+ Uint32 height
+ GLenum format
+ GLenum type
+ Sint32 level
+ Sint32 base
+ Sint32 max
+ char *data
+ CODE:
+ RETVAL = gluBuild2DMipmapLevels(target,internalFormat,width,height,
+ format,type,level,base,max,data);
+ OUTPUT:
+ RETVAL
+
+#else
+void
+gluBuild2DMipmapLevels ()
+ CODE:
+ Perl_croak(aTHX_ "SDL::OpenGL::Build2DMipmapLevels requires GLU 1.2");
+
+#endif
+
+#if HAVE_GLU_VERSION >= 12
+int
+gluBuild3DMipmapLevels ( target, internalFormat, width, height, depth, format, type, level, base, max, data )
+ GLenum target
+ Sint32 internalFormat
+ Uint32 width
+ Uint32 height
+ Uint32 depth
+ GLenum format
+ GLenum type
+ Sint32 level
+ Sint32 base
+ Sint32 max
+ char *data
+ CODE:
+ RETVAL = gluBuild3DMipmapLevels(target,internalFormat,width,height,depth,
+ format,type,level,base,max,data);
+ OUTPUT:
+ RETVAL
+
+#else
+void
+gluBuild3DMipmapLevels ()
+ CODE:
+ Perl_croak(aTHX_ "SDL::OpenGL::Build3DMipmapLevels requires GLU 1.2");
+
+#endif
+
+char*
+gluErrorString ( code )
+ GLenum code
+ CODE:
+ RETVAL = (char*)gluErrorString(code);
+ OUTPUT:
+ RETVAL
+
+GLUnurbsObj*
+gluNewNurbsRenderer ()
+ CODE:
+ RETVAL = gluNewNurbsRenderer();
+ OUTPUT:
+ RETVAL
+
+void
+gluDeleteNurbsRenderer ( obj )
+ GLUnurbsObj *obj
+ CODE:
+ gluDeleteNurbsRenderer(obj);
+
+void
+gluNurbsProperty ( obj, property, value )
+ GLUnurbsObj *obj
+ GLenum property
+ double value
+ CODE:
+ gluNurbsProperty(obj,property,(float)value);
+
+void
+gluLoadSamplingMatrices ( obj, mm, pm, vp )
+ GLUnurbsObj *obj
+ char *mm
+ char *pm
+ char *vp
+ CODE:
+ gluLoadSamplingMatrices(obj,(GLfloat*)mm,(GLfloat*)pm,(GLint*)vp);
+
+double
+gluGetNurbsProperty ( obj, property )
+ GLUnurbsObj *obj
+ GLenum property
+ CODE:
+ float f;
+ gluGetNurbsProperty(obj,property,&f);
+ RETVAL = (double)f;
+ OUTPUT:
+ RETVAL
+
+void
+gluNurbsCallback ( obj, which, cb )
+ GLUnurbsObj *obj
+ GLenum which
+ SV *cb
+ CODE:
+ switch(which) {
+ case GLU_ERROR:
+ sdl_perl_nurbs_error_hook = cb;
+ gluNurbsCallback(obj,GLU_ERROR,(GLvoid*)sdl_perl_nurbs_error_callback);
+ break;
+#ifdef GLU_NURBS_BEGIN
+ case GLU_NURBS_BEGIN:
+ case GLU_NURBS_BEGIN_DATA:
+ gluNurbsCallbackData(obj,(void*)cb);
+ gluNurbsCallback(obj,GLU_NURBS_BEGIN_DATA,
+ (GLvoid*)sdl_perl_nurbs_being_callback);
+ break;
+ case GLU_NURBS_TEXTURE_COORD:
+ case GLU_NURBS_TEXTURE_COORD_DATA:
+ gluNurbsCallbackData(obj,(void*)cb);
+ gluNurbsCallback(obj,GLU_NURBS_TEXTURE_COORD_DATA,
+ (GLvoid*)sdl_perl_nurbs_multi_callback);
+ break;
+ case GLU_NURBS_COLOR:
+ case GLU_NURBS_COLOR_DATA:
+ gluNurbsCallbackData(obj,(void*)cb);
+ gluNurbsCallback(obj,GLU_NURBS_COLOR_DATA,
+ (GLvoid*)sdl_perl_nurbs_multi_callback);
+ break;
+ case GLU_NURBS_NORMAL:
+ case GLU_NURBS_NORMAL_DATA:
+ gluNurbsCallbackData(obj,(void*)cb);
+ gluNurbsCallback(obj,GLU_NURBS_NORMAL_DATA,
+ (GLvoid*)sdl_perl_nurbs_multi_callback);
+ break;
+ case GLU_NURBS_VERTEX:
+ case GLU_NURBS_VERTEX_DATA:
+ gluNurbsCallbackData(obj,(void*)cb);
+ gluNurbsCallback(obj,GLU_NURBS_VERTEX_DATA,
+ (GLvoid*)sdl_perl_nurbs_multi_callback);
+ break;
+ case GLU_NURBS_END:
+ case GLU_NURBS_END_DATA:
+ gluNurbsCallbackData(obj,(void*)cb);
+ gluNurbsCallback(obj,GLU_NURBS_END_DATA,
+ (GLvoid*)sdl_perl_nurbs_end_callback);
+ break;
+#endif
+ default:
+ Perl_croak(aTHX_ "SDL::OpenGL::NurbsCallback - invalid type");
+ }
+
+void
+gluNurbsCallbackData ( obj, cb )
+ GLUnurbsObj *obj
+ SV *cb
+ CODE:
+ gluNurbsCallbackData(obj,(void*)cb);
+
+void
+gluBeginSurface ( obj )
+ GLUnurbsObj *obj
+ CODE:
+ gluBeginSurface(obj);
+
+void
+gluEndSurface ( obj )
+ GLUnurbsObj *obj
+ CODE:
+ gluEndSurface(obj);
+
+void
+gluNurbsSurface ( obj, uknot_count, uknot, vknot_count, vknot, u_stride, v_stride, ctlarray, uorder, vorder, type )
+ GLUnurbsObj *obj
+ Sint32 uknot_count
+ char *uknot
+ Sint32 vknot_count
+ char *vknot
+ Sint32 u_stride
+ Sint32 v_stride
+ char *ctlarray
+ Sint32 uorder
+ Sint32 vorder
+ GLenum type
+ CODE:
+ gluNurbsSurface(obj,uknot_count,(GLfloat*)uknot,vknot_count,(GLfloat*)vknot,
+ u_stride,v_stride,(GLfloat*)ctlarray,uorder,vorder,type);
+
+void
+gluBeginCurve ( obj )
+ GLUnurbsObj *obj
+ CODE:
+ gluBeginCurve(obj);
+
+void
+gluEndCurve ( obj )
+ GLUnurbsObj *obj
+ CODE:
+ gluEndCurve(obj);
+
+void
+gluNurbsCurve ( obj, uknot_count, uknot, u_stride, ctlarray, uorder, type )
+ GLUnurbsObj *obj
+ Sint32 uknot_count
+ char *uknot
+ Sint32 u_stride
+ char *ctlarray
+ Sint32 uorder
+ GLenum type
+ CODE:
+ gluNurbsCurve(obj,uknot_count,(GLfloat*)uknot,u_stride,(GLfloat*)ctlarray,
+ uorder,type);
+
+void
+gluBeginTrim ( obj )
+ GLUnurbsObj *obj
+ CODE:
+ gluBeginTrim(obj);
+
+void
+gluEndTrim ( obj )
+ GLUnurbsObj *obj
+ CODE:
+ gluEndTrim(obj);
+
+void
+gluPwlCurve ( obj, count, array, stride, type )
+ GLUnurbsObj *obj
+ Sint32 count
+ char *array
+ Sint32 stride
+ GLenum type
+ CODE:
+ gluPwlCurve(obj,count,(GLfloat*)array,stride,type);
+
+AV*
+gluUnProject ( winx, winy, winz, mm, pm, vp )
+ double winx
+ double winy
+ double winz
+ char *mm
+ char *pm
+ char *vp
+ CODE:
+ GLdouble objx, objy, objz;
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(gluUnProject(winx,winy,winz,(GLdouble*)mm,
+ (GLdouble*)pm,(GLint*)vp,&objx,&objy,&objz)));
+ av_push(RETVAL,newSVnv((double)objx));
+ av_push(RETVAL,newSVnv((double)objy));
+ av_push(RETVAL,newSVnv((double)objz));
+ OUTPUT:
+ RETVAL
+
+
+#ifdef GL_VERSION_1_3
+
+AV*
+gluUnProject4 ( winx, winy, winz, clipw, mm, pm, vp, n, f )
+ double winx
+ double winy
+ double winz
+ double clipw
+ char *mm
+ char *pm
+ char *vp
+ double n
+ double f
+ CODE:
+ GLdouble objx, objy, objz, objw;
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(gluUnProject4(winx,winy,winz,clipw,(GLdouble*)mm,
+ (GLdouble*)pm,(GLint*)vp,(GLclampd)n,(GLclampd)f,
+ &objx,&objy,&objz,&objw)));
+ av_push(RETVAL,newSVnv((double)objx));
+ av_push(RETVAL,newSVnv((double)objy));
+ av_push(RETVAL,newSVnv((double)objz));
+ av_push(RETVAL,newSVnv((double)objw));
+ OUTPUT:
+ RETVAL
+
+#endif // GL_VERSION_1_3
+
+AV*
+gluProject ( objx, objy, objz, mm, pm, vp )
+ double objx
+ double objy
+ double objz
+ char *mm
+ char *pm
+ char *vp
+ CODE:
+ GLdouble winx, winy, winz;
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(gluUnProject(objx,objy,objz,(GLdouble*)mm,
+ (GLdouble*)pm,(GLint*)vp,&winx,&winy,&winz)));
+ av_push(RETVAL,newSVnv((double)winx));
+ av_push(RETVAL,newSVnv((double)winy));
+ av_push(RETVAL,newSVnv((double)winz));
+ OUTPUT:
+ RETVAL
+
+#ifdef GL_VERSION_1_2
+
+GLUtesselator*
+gluNewTess ()
+ CODE:
+ RETVAL = gluNewTess();
+ OUTPUT:
+ RETVAL
+
+void
+gluTessCallback ( tess, type )
+ GLUtesselator *tess
+ GLenum type
+ CODE:
+ switch(type) {
+ case GLU_TESS_BEGIN:
+ case GLU_TESS_BEGIN_DATA:
+ gluTessCallback(tess,GLU_TESS_BEGIN_DATA,
+ (GLvoid*)sdl_perl_tess_begin_callback);
+ break;
+
+ case GLU_TESS_EDGE_FLAG:
+ case GLU_TESS_EDGE_FLAG_DATA:
+ gluTessCallback(tess,GLU_TESS_EDGE_FLAG_DATA,
+ (GLvoid*)sdl_perl_tess_edge_flag_callback);
+ break;
+
+ case GLU_TESS_VERTEX:
+ case GLU_TESS_VERTEX_DATA:
+ gluTessCallback(tess,GLU_TESS_VERTEX_DATA,
+ (GLvoid*)sdl_perl_tess_vertex_callback);
+ break;
+
+ case GLU_TESS_END:
+ case GLU_TESS_END_DATA:
+ gluTessCallback(tess,GLU_TESS_END_DATA,
+ (GLvoid*)sdl_perl_tess_end_callback);
+ break;
+
+ case GLU_TESS_COMBINE:
+ case GLU_TESS_COMBINE_DATA:
+ gluTessCallback(tess,GLU_TESS_COMBINE_DATA,
+ (GLvoid*)sdl_perl_tess_combine_callback);
+ break;
+
+ case GLU_TESS_ERROR:
+ case GLU_TESS_ERROR_DATA:
+ gluTessCallback(tess,GLU_TESS_ERROR_DATA,
+ (GLvoid*)sdl_perl_tess_error_callback);
+ break;
+ }
+
+void
+gluTessProperty ( tessobj, property, value )
+ GLUtesselator *tessobj
+ Uint32 property
+ double value
+ CODE:
+ gluTessProperty(tessobj,property,value);
+
+double
+gluGetTessProperty ( tessobj, property )
+ GLUtesselator *tessobj
+ Uint32 property
+ CODE:
+ gluGetTessProperty(tessobj,property,&RETVAL);
+ OUTPUT:
+ RETVAL
+
+void
+gluTessNormal ( tessobj, x, y, z )
+ GLUtesselator *tessobj
+ double x
+ double y
+ double z
+ CODE:
+ gluTessNormal(tessobj,x,y,z);
+
+void
+gluTessBeginPolygon ( tessobj, cb )
+ GLUtesselator *tessobj
+ SV *cb
+ CODE:
+ gluTessBeginPolygon(tessobj,cb);
+
+void
+gluTessEndPolygon ( tessobj )
+ GLUtesselator *tessobj
+ CODE:
+ gluTessEndPolygon(tessobj);
+
+void
+gluTessBeginContour ( tessobj )
+ GLUtesselator *tessobj
+ CODE:
+ gluTessBeginContour(tessobj);
+
+void
+gluTessEndContour ( tessobj )
+ GLUtesselator *tessobj
+ CODE:
+ gluTessEndContour(tessobj);
+
+void
+gluDeleteTess ( tessobj )
+ GLUtesselator *tessobj
+ CODE:
+ gluDeleteTess(tessobj);
+
+void
+gluTessVertex ( tessobj, coords, vd )
+ GLUtesselator *tessobj
+ char *coords
+ char *vd
+ CODE:
+ gluTessVertex(tessobj,(GLdouble*)coords,vd);
+
+#endif
+
+#endif
+
--- /dev/null
+// SDL.xs
+//
+// SDL Perl by David J. Goehrig <dgoehrig@cpan.org>
+//
+// Copyright (C) 2000,2001,2002,2003,2004 David J. Goehrig
+//
+// This software is under the GNU Library General Public License (LGPL)
+// see the file COPYING for terms of use
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+
+#ifdef HAVE_SDL_IMAGE
+#include <SDL_image.h>
+#endif
+
+#ifdef HAVE_SDL_MIXER
+#include <SDL_mixer.h>
+void (*mix_music_finished_cv)();
+#endif
+
+#ifdef HAVE_GL
+#include <gl.h>
+#endif
+
+#ifdef HAVE_GLU
+#include <glu.h>
+#endif
+
+#ifdef HAVE_SDL_NET
+#include <SDL_net.h>
+#endif
+
+#ifdef HAVE_SDL_TTF
+#include <SDL_ttf.h>
+#define TEXT_SOLID 1
+#define TEXT_SHADED 2
+#define TEXT_BLENDED 4
+#define UTF8_SOLID 8
+#define UTF8_SHADED 16
+#define UTF8_BLENDED 32
+#define UNICODE_SOLID 64
+#define UNICODE_SHADED 128
+#define UNICODE_BLENDED 256
+#endif
+
+#ifdef HAVE_SMPEG
+#include <smpeg/smpeg.h>
+#ifdef HAVE_SDL_MIXER
+static int sdl_perl_use_smpeg_audio = 0;
+#endif
+#endif
+
+#ifdef HAVE_SDL_GFX
+#include <SDL_rotozoom.h>
+#include <SDL_gfxPrimitives.h>
+#include <SDL_framerate.h>
+#include <SDL_imageFilter.h>
+#endif
+
+#ifdef USE_THREADS
+#define HAVE_TLS_CONTEXT
+#endif
+
+#include "defines.h"
+
+Uint32
+sdl_perl_timer_callback ( Uint32 interval, void* param )
+{
+ Uint32 retval;
+ int back;
+ SV* cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)param;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(interval)));
+ PUTBACK;
+
+ if (0 != (back = call_sv(cmd,G_SCALAR))) {
+ SPAGAIN;
+ if (back != 1 ) Perl_croak (aTHX_ "Timer Callback failed!");
+ retval = POPi;
+ } else {
+ Perl_croak(aTHX_ "Timer Callback failed!");
+ }
+
+ FREETMPS;
+ LEAVE;
+
+ LEAVE_TLS_CONTEXT
+
+ return retval;
+}
+
+void
+sdl_perl_audio_callback ( void* data, Uint8 *stream, int len )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)data;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(PTR2IV(stream))));
+ XPUSHs(sv_2mortal(newSViv(len)));
+ PUTBACK;
+
+ call_sv(cmd,G_VOID|G_DISCARD);
+
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+
+ LEAVE_TLS_CONTEXT
+}
+
+#ifdef HAVE_SDL_MIXER
+
+void
+sdl_perl_music_callback ( void )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)Mix_GetMusicHookData();
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ PUTBACK;
+
+ call_sv(cmd,G_VOID|G_DISCARD);
+
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+
+ LEAVE_TLS_CONTEXT
+}
+
+void
+sdl_perl_music_finished_callback ( void )
+{
+ SV *cmd;
+ ENTER_TLS_CONTEXT
+ dSP;
+
+ cmd = (SV*)mix_music_finished_cv;
+ if ( cmd == NULL ) return;
+
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ PUTBACK;
+
+ call_sv(cmd,G_VOID|G_DISCARD);
+
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+
+ LEAVE_TLS_CONTEXT
+}
+
+#endif
+
+void
+sdl_perl_atexit (void)
+{
+ SDL_Quit();
+#ifdef MACOSX
+ SDL_macosx_quit();
+#endif
+}
+
+void boot_SDL();
+void boot_SDL__OpenGL();
+
+XS(boot_SDL_perl)
+{
+ GET_TLS_CONTEXT
+ boot_SDL();
+}
+
+MODULE = SDL_perl PACKAGE = SDL
+PROTOTYPES : DISABLE
+
+char *
+GetError ()
+ CODE:
+ RETVAL = SDL_GetError();
+ OUTPUT:
+ RETVAL
+
+int
+Init ( flags )
+ Uint32 flags
+ CODE:
+#ifdef MACOSX
+ SDL_macosx_init();
+#endif
+ RETVAL = SDL_Init(flags);
+#ifdef HAVE_TLS_CONTEXT
+ Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);
+#else
+ atexit(sdl_perl_atexit);
+#endif
+ OUTPUT:
+ RETVAL
+
+int
+InitSubSystem ( flags )
+ Uint32 flags
+ CODE:
+ RETVAL = SDL_InitSubSystem(flags);
+ OUTPUT:
+ RETVAL
+
+void
+QuitSubSystem ( flags )
+ Uint32 flags
+ CODE:
+ SDL_QuitSubSystem(flags);
+
+void
+Quit ()
+ CODE:
+ SDL_Quit();
+#ifdef MACOSX
+ SDL_macosx_quit();
+#endif
+
+
+int
+WasInit ( flags )
+ Uint32 flags
+ CODE:
+ RETVAL = SDL_WasInit(flags);
+ OUTPUT:
+ RETVAL
+
+void
+Delay ( ms )
+ int ms
+ CODE:
+ SDL_Delay(ms);
+
+Uint32
+GetTicks ()
+ CODE:
+ RETVAL = SDL_GetTicks();
+ OUTPUT:
+ RETVAL
+
+int
+SetTimer ( interval, callback )
+ Uint32 interval
+ SDL_TimerCallback callback
+ CODE:
+ RETVAL = SDL_SetTimer(interval,callback);
+ OUTPUT:
+ RETVAL
+
+SDL_TimerID
+AddTimer ( interval, callback, param )
+ Uint32 interval
+ SDL_NewTimerCallback callback
+ void *param
+ CODE:
+ RETVAL = SDL_AddTimer(interval,callback,param);
+ OUTPUT:
+ RETVAL
+
+SDL_NewTimerCallback
+PerlTimerCallback ()
+ CODE:
+ RETVAL = sdl_perl_timer_callback;
+ OUTPUT:
+ RETVAL
+
+SDL_TimerID
+NewTimer ( interval, cmd )
+ Uint32 interval
+ void *cmd
+ CODE:
+ RETVAL = SDL_AddTimer(interval,sdl_perl_timer_callback,cmd);
+ OUTPUT:
+ RETVAL
+
+Uint32
+RemoveTimer ( id )
+ SDL_TimerID id
+ CODE:
+ RETVAL = SDL_RemoveTimer(id);
+ OUTPUT:
+ RETVAL
+
+int
+CDNumDrives ()
+ CODE:
+ RETVAL = SDL_CDNumDrives();
+ OUTPUT:
+ RETVAL
+
+char *
+CDName ( drive )
+ int drive
+ CODE:
+ RETVAL = strdup(SDL_CDName(drive));
+ OUTPUT:
+ RETVAL
+
+SDL_CD *
+CDOpen ( drive )
+ int drive
+ CODE:
+ RETVAL = SDL_CDOpen(drive);
+ OUTPUT:
+ RETVAL
+
+Uint8
+CDTrackId ( track )
+ SDL_CDtrack *track
+ CODE:
+ RETVAL = track->id;
+ OUTPUT:
+ RETVAL
+
+Uint8
+CDTrackType ( track )
+ SDL_CDtrack *track
+ CODE:
+ RETVAL = track->type;
+ OUTPUT:
+ RETVAL
+
+Uint16
+CDTrackLength ( track )
+ SDL_CDtrack *track
+ CODE:
+ RETVAL = track->length;
+ OUTPUT:
+ RETVAL
+
+Uint32
+CDTrackOffset ( track )
+ SDL_CDtrack *track
+ CODE:
+ RETVAL = track->offset;
+ OUTPUT:
+ RETVAL
+
+Uint32
+CDStatus ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = SDL_CDStatus(cd);
+ OUTPUT:
+ RETVAL
+
+int
+CDPlayTracks ( cd, start_track, ntracks, start_frame, nframes )
+ SDL_CD *cd
+ int start_track
+ int ntracks
+ int start_frame
+ int nframes
+ CODE:
+ RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes);
+ OUTPUT:
+ RETVAL
+
+int
+CDPlay ( cd, start, length )
+ SDL_CD *cd
+ int start
+ int length
+ CODE:
+ RETVAL = SDL_CDPlay(cd,start,length);
+ OUTPUT:
+ RETVAL
+
+int
+CDPause ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = SDL_CDPause(cd);
+ OUTPUT:
+ RETVAL
+
+int
+CDResume ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = SDL_CDResume(cd);
+ OUTPUT:
+ RETVAL
+
+int
+CDStop ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = SDL_CDStop(cd);
+ OUTPUT:
+ RETVAL
+
+int
+CDEject ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = SDL_CDEject(cd);
+ OUTPUT:
+ RETVAL
+
+void
+CDClose ( cd )
+ SDL_CD *cd
+ CODE:
+ SDL_CDClose(cd);
+
+int
+CDId ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = cd->id;
+ OUTPUT:
+ RETVAL
+
+int
+CDNumTracks ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = cd->numtracks;
+ OUTPUT:
+ RETVAL
+
+int
+CDCurTrack ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = cd->cur_track;
+ OUTPUT:
+ RETVAL
+
+int
+CDCurFrame ( cd )
+ SDL_CD *cd
+ CODE:
+ RETVAL = cd->cur_frame;
+ OUTPUT:
+ RETVAL
+
+SDL_CDtrack *
+CDTrack ( cd, number )
+ SDL_CD *cd
+ int number
+ CODE:
+ RETVAL = (SDL_CDtrack *)(cd->track + number);
+ OUTPUT:
+ RETVAL
+
+void
+PumpEvents ()
+ CODE:
+ SDL_PumpEvents();
+
+int
+PushEvent( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = SDL_PushEvent( e );
+ OUTPUT:
+ RETVAL
+
+SDL_Event *
+NewEvent ()
+ CODE:
+ RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event));
+ OUTPUT:
+ RETVAL
+
+void
+FreeEvent ( e )
+ SDL_Event *e
+ CODE:
+ safefree(e);
+
+int
+PollEvent ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = SDL_PollEvent(e);
+ OUTPUT:
+ RETVAL
+
+int
+WaitEvent ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = SDL_WaitEvent(e);
+ OUTPUT:
+ RETVAL
+
+Uint8
+EventState ( type, state )
+ Uint8 type
+ int state
+ CODE:
+ RETVAL = SDL_EventState(type,state);
+ OUTPUT:
+ RETVAL
+
+Uint8
+EventType ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->type;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SetEventType ( e, type )
+ SDL_Event *e
+ Uint8 type
+ CODE:
+ RETVAL = e->type;
+ e->type = type;
+ OUTPUT:
+ RETVAL
+
+Uint8
+ActiveEventGain ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->active.gain;
+ OUTPUT:
+ RETVAL
+
+Uint8
+ActiveEventState ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->active.state;
+ OUTPUT:
+ RETVAL
+
+Uint8
+KeyEventState( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->key.state;
+ OUTPUT:
+ RETVAL
+
+int
+KeyEventSym ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->key.keysym.sym;
+ OUTPUT:
+ RETVAL
+
+int
+KeyEventMod ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->key.keysym.mod;
+ OUTPUT:
+ RETVAL
+
+Uint16
+KeyEventUnicode ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->key.keysym.unicode;
+ OUTPUT:
+ RETVAL
+
+Uint8
+KeyEventScanCode ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->key.keysym.scancode;
+ OUTPUT:
+ RETVAL
+
+Uint8
+MouseMotionState ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->motion.state;
+ OUTPUT:
+ RETVAL
+
+Uint16
+MouseMotionX ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->motion.x;
+ OUTPUT:
+ RETVAL
+
+Uint16
+MouseMotionY ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->motion.y;
+ OUTPUT:
+ RETVAL
+
+Sint16
+MouseMotionXrel( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->motion.xrel;
+ OUTPUT:
+ RETVAL
+
+Sint16
+MouseMotionYrel ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->motion.yrel;
+ OUTPUT:
+ RETVAL
+
+Uint8
+MouseButtonState ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->button.state;
+ OUTPUT:
+ RETVAL
+
+Uint8
+MouseButton ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->button.button;
+ OUTPUT:
+ RETVAL
+
+Uint16
+MouseButtonX ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->button.x;
+ OUTPUT:
+ RETVAL
+
+Uint16
+MouseButtonY ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->button.y;
+ OUTPUT:
+ RETVAL
+
+SDL_SysWMmsg *
+SysWMEventMsg ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->syswm.msg;
+ OUTPUT:
+ RETVAL
+
+int
+EnableUnicode ( enable )
+ int enable
+ CODE:
+ RETVAL = SDL_EnableUNICODE(enable);
+ OUTPUT:
+ RETVAL
+
+void
+EnableKeyRepeat ( delay, interval )
+ int delay
+ int interval
+ CODE:
+ SDL_EnableKeyRepeat(delay,interval);
+
+Uint32
+GetModState ()
+ CODE:
+ RETVAL = SDL_GetModState();
+ OUTPUT:
+ RETVAL
+
+void
+SetModState ( state )
+ Uint32 state
+ CODE:
+ SDL_SetModState(state);
+
+char *
+GetKeyName ( sym )
+ int sym
+ CODE:
+ RETVAL = SDL_GetKeyName(sym);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface *
+CreateRGBSurface (flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
+ Uint32 flags
+ int width
+ int height
+ int depth
+ Uint32 Rmask
+ Uint32 Gmask
+ Uint32 Bmask
+ Uint32 Amask
+ CODE:
+ RETVAL = SDL_CreateRGBSurface ( flags, width, height,
+ depth, Rmask, Gmask, Bmask, Amask );
+ OUTPUT:
+ RETVAL
+
+
+SDL_Surface *
+CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask )
+ char *pixels
+ int width
+ int height
+ int depth
+ int pitch
+ Uint32 Rmask
+ Uint32 Gmask
+ Uint32 Bmask
+ Uint32 Amask
+ CODE:
+ Uint8* pixeldata;
+ Uint32 len = pitch * height;
+ New(0,pixeldata,len,Uint8);
+ Copy(pixels,pixeldata,len,Uint8);
+ RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height,
+ depth, pitch, Rmask, Gmask, Bmask, Amask );
+ OUTPUT:
+ RETVAL
+
+#ifdef HAVE_SDL_IMAGE
+
+SDL_Surface *
+IMGLoad ( fname )
+ char *fname
+ CODE:
+ RETVAL = IMG_Load(fname);
+ OUTPUT:
+ RETVAL
+
+#endif
+
+SDL_Surface*
+SurfaceCopy ( surface )
+ SDL_Surface *surface
+ CODE:
+ Uint8* pixels;
+ Uint32 size = surface->pitch * surface->h;
+ New(0,pixels,size,Uint8);
+ Copy(surface->pixels,pixels,size,Uint8);
+ RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h,
+ surface->format->BitsPerPixel, surface->pitch,
+ surface->format->Rmask, surface->format->Gmask,
+ surface->format->Bmask, surface->format->Amask);
+ OUTPUT:
+ RETVAL
+
+void
+FreeSurface ( surface )
+ SDL_Surface *surface
+ CODE:
+ if (surface) {
+ Uint8* pixels = surface->pixels;
+ Uint32 flags = surface->flags;
+ SDL_FreeSurface(surface);
+ if (flags & SDL_PREALLOC)
+ Safefree(pixels);
+ }
+
+Uint32
+SurfaceFlags ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->flags;
+ OUTPUT:
+ RETVAL
+
+SDL_Palette *
+SurfacePalette ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->palette;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SurfaceBitsPerPixel ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->BitsPerPixel;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SurfaceBytesPerPixel ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->BytesPerPixel;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SurfaceRshift ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Rshift;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SurfaceGshift ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Gshift;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SurfaceBshift ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Bshift;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SurfaceAshift ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Ashift;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SurfaceRmask( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Rmask;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SurfaceGmask ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Gmask;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SurfaceBmask ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Bmask;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SurfaceAmask ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->Amask;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SurfaceColorKey ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->colorkey;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SurfaceAlpha( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->format->alpha;
+ OUTPUT:
+ RETVAL
+
+int
+SurfaceW ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->w;
+ OUTPUT:
+ RETVAL
+
+int
+SurfaceH ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->h;
+ OUTPUT:
+ RETVAL
+
+Uint16
+SurfacePitch ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = surface->pitch;
+ OUTPUT:
+ RETVAL
+
+SV*
+SurfacePixels ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h);
+ OUTPUT:
+ RETVAL
+
+SDL_Color*
+SurfacePixel ( surface, x, y, ... )
+ SDL_Surface *surface
+ Sint32 x
+ Sint32 y
+ CODE:
+ SDL_Color* color;
+ int pix,index;
+ Uint8 r,g,b,a;
+ int bpp = surface->format->BytesPerPixel;
+ Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y;
+ if ( items < 3 || items > 4 )
+ Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])");
+ if ( items == 4) {
+ color = (SDL_Color*)SvIV(ST(3));
+ pix = SDL_MapRGB(surface->format,color->r,color->g,color->b);
+ switch(bpp) {
+ case 1:
+ *(Uint8*)p = pix;
+ break;
+ case 2:
+ *(Uint16*)p = pix;
+ break;
+ case 3:
+ if (SDL_BYTEORDER == SDL_BIG_ENDIAN) {
+ p[0] = (pix >> 16) & 0xff;
+ p[1] = (pix >> 8) & 0xff;
+ p[2] = pix & 0xff;
+ } else {
+ p[0] = pix & 0xff;
+ p[1] = (pix >> 8) & 0xff;
+ p[2] = (pix >> 16) & 0xff;
+ }
+ break;
+ case 4:
+ *(Uint32*)p = pix;
+ break;
+ }
+ }
+ RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
+ switch(bpp) {
+ case 1:
+ index = *(Uint8*)p;
+ memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color));
+ break;
+ case 2:
+ pix = *(Uint16*)p;
+ SDL_GetRGB(pix,surface->format,&r,&g,&b);
+ RETVAL->r = r;
+ RETVAL->g = g;
+ RETVAL->b = b;
+ break;
+ case 3:
+ case 4:
+ pix = *(Uint32*)p;
+ SDL_GetRGB(pix,surface->format,&r,&g,&b);
+ RETVAL->r = r;
+ RETVAL->g = g;
+ RETVAL->b = b;
+ break;
+ }
+ OUTPUT:
+ RETVAL
+
+int
+MUSTLOCK ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = SDL_MUSTLOCK(surface);
+ OUTPUT:
+ RETVAL
+
+int
+SurfaceLock ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = SDL_LockSurface(surface);
+ OUTPUT:
+ RETVAL
+
+void
+SurfaceUnlock ( surface )
+ SDL_Surface *surface
+ CODE:
+ SDL_UnlockSurface(surface);
+
+SDL_Surface *
+GetVideoSurface ()
+ CODE:
+ RETVAL = SDL_GetVideoSurface();
+ OUTPUT:
+ RETVAL
+
+
+HV *
+VideoInfo ()
+ CODE:
+ HV *hv;
+ SDL_VideoInfo *info;
+ info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
+ memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
+ hv = newHV();
+ hv_store(hv,"hw_available",strlen("hw_available"),
+ newSViv(info->hw_available),0);
+ hv_store(hv,"wm_available",strlen("wm_available"),
+ newSViv(info->wm_available),0);
+ hv_store(hv,"blit_hw",strlen("blit_hw"),
+ newSViv(info->blit_hw),0);
+ hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
+ newSViv(info->blit_hw_CC),0);
+ hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
+ newSViv(info->blit_hw_A),0);
+ hv_store(hv,"blit_sw",strlen("blit_sw"),
+ newSViv(info->blit_sw),0);
+ hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
+ newSViv(info->blit_sw_CC),0);
+ hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
+ newSViv(info->blit_sw_A),0);
+ hv_store(hv,"blit_fill",strlen("blit_fill"),
+ newSViv(info->blit_fill),0);
+ hv_store(hv,"video_mem",strlen("video_mem"),
+ newSViv(info->video_mem),0);
+ RETVAL = hv;
+ OUTPUT:
+ RETVAL
+
+SDL_Rect *
+NewRect ( x, y, w, h )
+ Sint16 x
+ Sint16 y
+ Uint16 w
+ Uint16 h
+ CODE:
+ RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect));
+ RETVAL->x = x;
+ RETVAL->y = y;
+ RETVAL->w = w;
+ RETVAL->h = h;
+ OUTPUT:
+ RETVAL
+
+void
+FreeRect ( rect )
+ SDL_Rect *rect
+ CODE:
+ safefree(rect);
+
+Sint16
+RectX ( rect, ... )
+ SDL_Rect *rect
+ CODE:
+ if (items > 1 ) rect->x = SvIV(ST(1));
+ RETVAL = rect->x;
+ OUTPUT:
+ RETVAL
+
+Sint16
+RectY ( rect, ... )
+ SDL_Rect *rect
+ CODE:
+ if (items > 1 ) rect->y = SvIV(ST(1));
+ RETVAL = rect->y;
+ OUTPUT:
+ RETVAL
+
+Uint16
+RectW ( rect, ... )
+ SDL_Rect *rect
+ CODE:
+ if (items > 1 ) rect->w = SvIV(ST(1));
+ RETVAL = rect->w;
+ OUTPUT:
+ RETVAL
+
+Uint16
+RectH ( rect, ... )
+ SDL_Rect *rect
+ CODE:
+ if (items > 1 ) rect->h = SvIV(ST(1));
+ RETVAL = rect->h;
+ OUTPUT:
+ RETVAL
+
+AV*
+ListModes ( format, flags )
+ Uint32 flags
+ SDL_PixelFormat *format
+ CODE:
+ SDL_Rect **mode;
+ RETVAL = newAV();
+ mode = SDL_ListModes(format,flags);
+ if (mode == (SDL_Rect**)-1 ) {
+ av_push(RETVAL,newSVpv("all",0));
+ } else if (! mode ) {
+ av_push(RETVAL,newSVpv("none",0));
+ } else {
+ for (;*mode;mode++) {
+ av_push(RETVAL,newSViv(PTR2IV(*mode)));
+ }
+ }
+ OUTPUT:
+ RETVAL
+
+
+SDL_Color *
+NewColor ( r, g, b )
+ Uint8 r
+ Uint8 g
+ Uint8 b
+ CODE:
+ RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
+ RETVAL->r = r;
+ RETVAL->g = g;
+ RETVAL->b = b;
+ OUTPUT:
+ RETVAL
+
+Uint8
+ColorR ( color, ... )
+ SDL_Color *color
+ CODE:
+ if (items > 1 ) color->r = SvIV(ST(1));
+ RETVAL = color->r;
+ OUTPUT:
+ RETVAL
+
+Uint8
+ColorG ( color, ... )
+ SDL_Color *color
+ CODE:
+ if (items > 1 ) color->g = SvIV(ST(1));
+ RETVAL = color->g;
+ OUTPUT:
+ RETVAL
+
+Uint8
+ColorB ( color, ... )
+ SDL_Color *color
+ CODE:
+ if (items > 1 ) color->b = SvIV(ST(1));
+ RETVAL = color->b;
+ OUTPUT:
+ RETVAL
+
+void
+FreeColor ( color )
+ SDL_Color *color
+ CODE:
+ return; safefree(color);
+
+SDL_Palette *
+NewPalette ( number )
+ int number
+ CODE:
+ RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
+ RETVAL->colors = (SDL_Color *)safemalloc(number *
+ sizeof(SDL_Color));
+ RETVAL->ncolors = number;
+ OUTPUT:
+ RETVAL
+
+int
+PaletteNColors ( palette, ... )
+ SDL_Palette *palette
+ CODE:
+ if ( items > 1 ) palette->ncolors = SvIV(ST(1));
+ RETVAL = palette->ncolors;
+ OUTPUT:
+ RETVAL
+
+SDL_Color *
+PaletteColors ( palette, index, ... )
+ SDL_Palette *palette
+ int index
+ CODE:
+ if ( items > 2 ) {
+ palette->colors[index].r = SvUV(ST(2));
+ palette->colors[index].g = SvUV(ST(3));
+ palette->colors[index].b = SvUV(ST(4));
+ }
+ RETVAL = (SDL_Color *)(palette->colors + index);
+ OUTPUT:
+ RETVAL
+
+int
+VideoModeOK ( width, height, bpp, flags )
+ int width
+ int height
+ int bpp
+ Uint32 flags
+ CODE:
+ RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface *
+SetVideoMode ( width, height, bpp, flags )
+ int width
+ int height
+ int bpp
+ Uint32 flags
+ CODE:
+ RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
+ OUTPUT:
+ RETVAL
+
+void
+UpdateRect ( surface, x, y, w ,h )
+ SDL_Surface *surface
+ int x
+ int y
+ int w
+ int h
+ CODE:
+ SDL_UpdateRect(surface,x,y,w,h);
+
+void
+UpdateRects ( surface, ... )
+ SDL_Surface *surface
+ CODE:
+ SDL_Rect *rects, *temp;
+ int num_rects,i;
+ if ( items < 2 ) return;
+ num_rects = items - 1;
+ rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
+ for(i=0;i<num_rects;i++) {
+ temp = (SDL_Rect *)SvIV(ST(i+1));
+ rects[i].x = temp->x;
+ rects[i].y = temp->y;
+ rects[i].w = temp->w;
+ rects[i].h = temp->h;
+ }
+ SDL_UpdateRects(surface,num_rects,rects);
+ safefree(rects);
+
+int
+Flip ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = SDL_Flip(surface);
+ OUTPUT:
+ RETVAL
+
+int
+SetColors ( surface, start, ... )
+ SDL_Surface *surface
+ int start
+ CODE:
+ SDL_Color *colors,*temp;
+ int i, length;
+ if ( items < 3 ) { RETVAL = 0; goto all_done; }
+ length = items - 2;
+ colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
+ for ( i = 0; i < length ; i++ ) {
+ temp = (SDL_Color *)SvIV(ST(i+2));
+ colors[i].r = temp->r;
+ colors[i].g = temp->g;
+ colors[i].b = temp->b;
+ }
+ RETVAL = SDL_SetColors(surface, colors, start, length );
+ safefree(colors);
+all_done:
+ OUTPUT:
+ RETVAL
+
+Uint32
+MapRGB ( surface, r, g, b )
+ SDL_Surface *surface
+ Uint8 r
+ Uint8 g
+ Uint8 b
+ CODE:
+ RETVAL = SDL_MapRGB(surface->format,r,g,b);
+ OUTPUT:
+ RETVAL
+
+Uint32
+MapRGBA ( surface, r, g, b, a )
+ SDL_Surface *surface
+ Uint8 r
+ Uint8 g
+ Uint8 b
+ Uint8 a
+ CODE:
+ RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
+ OUTPUT:
+ RETVAL
+
+AV *
+GetRGB ( surface, pixel )
+ SDL_Surface *surface
+ Uint32 pixel
+ CODE:
+ Uint8 r,g,b;
+ SDL_GetRGB(pixel,surface->format,&r,&g,&b);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(r));
+ av_push(RETVAL,newSViv(g));
+ av_push(RETVAL,newSViv(b));
+ OUTPUT:
+ RETVAL
+
+AV *
+GetRGBA ( surface, pixel )
+ SDL_Surface *surface
+ Uint32 pixel
+ CODE:
+ Uint8 r,g,b,a;
+ SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(r));
+ av_push(RETVAL,newSViv(g));
+ av_push(RETVAL,newSViv(b));
+ av_push(RETVAL,newSViv(a));
+ OUTPUT:
+ RETVAL
+
+int
+SaveBMP ( surface, filename )
+ SDL_Surface *surface
+ char *filename
+ CODE:
+ RETVAL = SDL_SaveBMP(surface,filename);
+ OUTPUT:
+ RETVAL
+
+int
+SetColorKey ( surface, flag, key )
+ SDL_Surface *surface
+ Uint32 flag
+ SDL_Color *key
+ CODE:
+ Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
+ RETVAL = SDL_SetColorKey(surface,flag,pixel);
+ OUTPUT:
+ RETVAL
+
+int
+SetAlpha ( surface, flag, alpha )
+ SDL_Surface *surface
+ Uint32 flag
+ Uint8 alpha
+ CODE:
+ RETVAL = SDL_SetAlpha(surface,flag,alpha);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface *
+DisplayFormat ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = SDL_DisplayFormat(surface);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+DisplayFormatAlpha ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = SDL_DisplayFormatAlpha(surface);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+ConvertRGB ( surface )
+ SDL_Surface * surface
+ CODE:
+ SDL_PixelFormat fmt;
+ fmt.palette = NULL;
+ fmt.BitsPerPixel = 24;
+ fmt.BytesPerPixel = 3;
+ fmt.Rmask = 0x000000ff;
+ fmt.Gmask = 0x0000ff00;
+ fmt.Bmask = 0x00ff0000;
+ fmt.Amask = 0x00000000;
+ fmt.Rloss = 0;
+ fmt.Gloss = 0;
+ fmt.Bloss = 0;
+ fmt.Aloss = 0;
+ fmt.Rshift = 0;
+ fmt.Gshift = 8;
+ fmt.Bshift = 16;
+ fmt.Ashift = 24;
+ fmt.colorkey = 0;
+ fmt.alpha = 0;
+ RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+ConvertRGBA ( surface )
+ SDL_Surface * surface
+ CODE:
+ SDL_PixelFormat fmt;
+ fmt.palette = NULL;
+ fmt.BitsPerPixel = 32;
+ fmt.BytesPerPixel = 4;
+ fmt.Rmask = 0x000000ff;
+ fmt.Gmask = 0x0000ff00;
+ fmt.Bmask = 0x00ff0000;
+ fmt.Amask = 0xff000000;
+ fmt.Rloss = 0;
+ fmt.Gloss = 0;
+ fmt.Bloss = 0;
+ fmt.Aloss = 0;
+ fmt.Rshift = 0;
+ fmt.Gshift = 8;
+ fmt.Bshift = 16;
+ fmt.Ashift = 24;
+ fmt.colorkey = 0;
+ fmt.alpha = 0;
+ RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
+ OUTPUT:
+ RETVAL
+
+int
+BlitSurface ( src, src_rect, dest, dest_rect )
+ SDL_Surface *src
+ SDL_Rect *src_rect
+ SDL_Surface *dest
+ SDL_Rect *dest_rect
+ CODE:
+ RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
+ OUTPUT:
+ RETVAL
+
+int
+FillRect ( dest, dest_rect, color )
+ SDL_Surface *dest
+ SDL_Rect *dest_rect
+ SDL_Color *color
+ CODE:
+ Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b);
+ RETVAL = SDL_FillRect(dest,dest_rect,pixel);
+ OUTPUT:
+ RETVAL
+
+Uint8
+GetAppState ()
+ CODE:
+ RETVAL = SDL_GetAppState();
+ OUTPUT:
+ RETVAL
+
+
+void
+WMSetCaption ( title, icon )
+ char *title
+ char *icon
+ CODE:
+ SDL_WM_SetCaption(title,icon);
+
+AV *
+WMGetCaption ()
+ CODE:
+ char *title,*icon;
+ SDL_WM_GetCaption(&title,&icon);
+ RETVAL = newAV();
+ av_push(RETVAL,newSVpv(title,0));
+ av_push(RETVAL,newSVpv(icon,0));
+ OUTPUT:
+ RETVAL
+
+void
+WMSetIcon ( icon )
+ SDL_Surface *icon
+ CODE:
+ SDL_WM_SetIcon(icon,NULL);
+
+void
+WarpMouse ( x, y )
+ Uint16 x
+ Uint16 y
+ CODE:
+ SDL_WarpMouse(x,y);
+
+AV*
+GetMouseState ()
+ CODE:
+ Uint8 mask;
+ int x;
+ int y;
+ mask = SDL_GetMouseState(&x,&y);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(mask));
+ av_push(RETVAL,newSViv(x));
+ av_push(RETVAL,newSViv(y));
+ OUTPUT:
+ RETVAL
+
+AV*
+GetRelativeMouseState ()
+ CODE:
+ Uint8 mask;
+ int x;
+ int y;
+ mask = SDL_GetRelativeMouseState(&x,&y);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(mask));
+ av_push(RETVAL,newSViv(x));
+ av_push(RETVAL,newSViv(y));
+ OUTPUT:
+ RETVAL
+
+SDL_Cursor *
+NewCursor ( data, mask, x ,y )
+ SDL_Surface *data
+ SDL_Surface *mask
+ int x
+ int y
+ CODE:
+ RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
+ (Uint8*)mask->pixels,data->w,data->h,x,y);
+ OUTPUT:
+ RETVAL
+
+void
+FreeCursor ( cursor )
+ SDL_Cursor *cursor
+ CODE:
+ SDL_FreeCursor(cursor);
+
+void
+SetCursor ( cursor )
+ SDL_Cursor *cursor
+ CODE:
+ SDL_SetCursor(cursor);
+
+SDL_Cursor *
+GetCursor ()
+ CODE:
+ RETVAL = SDL_GetCursor();
+ OUTPUT:
+ RETVAL
+
+int
+ShowCursor ( toggle )
+ int toggle
+ CODE:
+ RETVAL = SDL_ShowCursor(toggle);
+ OUTPUT:
+ RETVAL
+
+SDL_AudioSpec *
+NewAudioSpec ( freq, format, channels, samples )
+ int freq
+ Uint16 format
+ Uint8 channels
+ Uint16 samples
+ CODE:
+ RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
+ RETVAL->freq = freq;
+ RETVAL->format = format;
+ RETVAL->channels = channels;
+ RETVAL->samples = samples;
+ OUTPUT:
+ RETVAL
+
+void
+FreeAudioSpec ( spec )
+ SDL_AudioSpec *spec
+ CODE:
+ safefree(spec);
+
+SDL_AudioCVT *
+NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
+ Uint16 src_format
+ Uint8 src_channels
+ int src_rate
+ Uint16 dst_format
+ Uint8 dst_channels
+ int dst_rate
+ CODE:
+ RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
+ if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
+ dst_format, dst_channels, dst_rate)) {
+ safefree(RETVAL); RETVAL = NULL; }
+ OUTPUT:
+ RETVAL
+
+void
+FreeAudioCVT ( cvt )
+ SDL_AudioCVT *cvt
+ CODE:
+ safefree(cvt);
+
+int
+ConvertAudioData ( cvt, data, len )
+ SDL_AudioCVT *cvt
+ Uint8 *data
+ int len
+ CODE:
+ cvt->len = len;
+ cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
+ memcpy(cvt->buf,data,cvt->len);
+ RETVAL = SDL_ConvertAudio(cvt);
+ OUTPUT:
+ RETVAL
+
+int
+OpenAudio ( spec, callback )
+ SDL_AudioSpec *spec
+ SV* callback
+ CODE:
+ spec->userdata = (void*)callback;
+ spec->callback = sdl_perl_audio_callback;
+ RETVAL = SDL_OpenAudio(spec,NULL);
+ OUTPUT:
+ RETVAL
+
+Uint32
+GetAudioStatus ()
+ CODE:
+ RETVAL = SDL_GetAudioStatus ();
+ OUTPUT:
+ RETVAL
+
+void
+PauseAudio ( p_on )
+ int p_on
+ CODE:
+ SDL_PauseAudio(p_on);
+
+void
+LockAudio ()
+ CODE:
+ SDL_LockAudio();
+
+void
+UnlockAudio ()
+ CODE:
+ SDL_UnlockAudio();
+
+void
+CloseAudio ()
+ CODE:
+ SDL_CloseAudio();
+
+void
+FreeWAV ( buf )
+ Uint8 *buf
+ CODE:
+ SDL_FreeWAV(buf);
+
+AV *
+LoadWAV ( filename, spec )
+ char *filename
+ SDL_AudioSpec *spec
+ CODE:
+ SDL_AudioSpec *temp;
+ Uint8 *buf;
+ Uint32 len;
+
+ RETVAL = newAV();
+ temp = SDL_LoadWAV(filename,spec,&buf,&len);
+ if ( ! temp ) goto error;
+ av_push(RETVAL,newSViv(PTR2IV(temp)));
+ av_push(RETVAL,newSViv(PTR2IV(buf)));
+ av_push(RETVAL,newSViv(len));
+error:
+ OUTPUT:
+ RETVAL
+
+#ifdef HAVE_SDL_MIXER
+
+void
+MixAudio ( dst, src, len, volume )
+ Uint8 *dst
+ Uint8 *src
+ Uint32 len
+ int volume
+ CODE:
+ SDL_MixAudio(dst,src,len,volume);
+
+int
+MixOpenAudio ( frequency, format, channels, chunksize )
+ int frequency
+ Uint16 format
+ int channels
+ int chunksize
+ CODE:
+ RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
+ OUTPUT:
+ RETVAL
+
+int
+MixAllocateChannels ( number )
+ int number
+ CODE:
+ RETVAL = Mix_AllocateChannels(number);
+ OUTPUT:
+ RETVAL
+
+AV *
+MixQuerySpec ()
+ CODE:
+ int freq, channels, status;
+ Uint16 format;
+ status = Mix_QuerySpec(&freq,&format,&channels);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(status));
+ av_push(RETVAL,newSViv(freq));
+ av_push(RETVAL,newSViv(format));
+ av_push(RETVAL,newSViv(channels));
+ OUTPUT:
+ RETVAL
+
+Mix_Chunk *
+MixLoadWAV ( filename )
+ char *filename
+ CODE:
+ RETVAL = Mix_LoadWAV(filename);
+ OUTPUT:
+ RETVAL
+
+Mix_Music *
+MixLoadMusic ( filename )
+ char *filename
+ CODE:
+ RETVAL = Mix_LoadMUS(filename);
+ OUTPUT:
+ RETVAL
+
+Mix_Chunk *
+MixQuickLoadWAV ( buf )
+ Uint8 *buf
+ CODE:
+ RETVAL = Mix_QuickLoad_WAV(buf);
+ OUTPUT:
+ RETVAL
+
+void
+MixFreeChunk( chunk )
+ Mix_Chunk *chunk
+ CODE:
+ Mix_FreeChunk(chunk);
+
+void
+MixFreeMusic ( music )
+ Mix_Music *music
+ CODE:
+ Mix_FreeMusic(music);
+
+void
+MixSetPostMixCallback ( func, arg )
+ void *func
+ void *arg
+ CODE:
+ Mix_SetPostMix(func,arg);
+
+void*
+PerlMixMusicHook ()
+ CODE:
+ RETVAL = sdl_perl_music_callback;
+ OUTPUT:
+ RETVAL
+
+void
+MixSetMusicHook ( func, arg )
+ void *func
+ void *arg
+ CODE:
+ Mix_HookMusic(func,arg);
+
+void
+MixSetMusicFinishedHook ( func )
+ void *func
+ CODE:
+ mix_music_finished_cv = func;
+ Mix_HookMusicFinished(sdl_perl_music_finished_callback);
+
+void *
+MixGetMusicHookData ()
+ CODE:
+ RETVAL = Mix_GetMusicHookData();
+ OUTPUT:
+ RETVAL
+
+int
+MixReverseChannels ( number )
+ int number
+ CODE:
+ RETVAL = Mix_ReserveChannels ( number );
+ OUTPUT:
+ RETVAL
+
+int
+MixGroupChannel ( which, tag )
+ int which
+ int tag
+ CODE:
+ RETVAL = Mix_GroupChannel(which,tag);
+ OUTPUT:
+ RETVAL
+
+int
+MixGroupChannels ( from, to, tag )
+ int from
+ int to
+ int tag
+ CODE:
+ RETVAL = Mix_GroupChannels(from,to,tag);
+ OUTPUT:
+ RETVAL
+
+int
+MixGroupAvailable ( tag )
+ int tag
+ CODE:
+ RETVAL = Mix_GroupAvailable(tag);
+ OUTPUT:
+ RETVAL
+
+int
+MixGroupCount ( tag )
+ int tag
+ CODE:
+ RETVAL = Mix_GroupCount(tag);
+ OUTPUT:
+ RETVAL
+
+int
+MixGroupOldest ( tag )
+ int tag
+ CODE:
+ RETVAL = Mix_GroupOldest(tag);
+ OUTPUT:
+ RETVAL
+
+int
+MixGroupNewer ( tag )
+ int tag
+ CODE:
+ RETVAL = Mix_GroupNewer(tag);
+ OUTPUT:
+ RETVAL
+
+int
+MixPlayChannel ( channel, chunk, loops )
+ int channel
+ Mix_Chunk *chunk
+ int loops
+ CODE:
+ RETVAL = Mix_PlayChannel(channel,chunk,loops);
+ OUTPUT:
+ RETVAL
+
+int
+MixPlayChannelTimed ( channel, chunk, loops, ticks )
+ int channel
+ Mix_Chunk *chunk
+ int loops
+ int ticks
+ CODE:
+ RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
+ OUTPUT:
+ RETVAL
+
+int
+MixPlayMusic ( music, loops )
+ Mix_Music *music
+ int loops
+ CODE:
+ RETVAL = Mix_PlayMusic(music,loops);
+ OUTPUT:
+ RETVAL
+
+int
+MixFadeInChannel ( channel, chunk, loops, ms )
+ int channel
+ Mix_Chunk *chunk
+ int loops
+ int ms
+ CODE:
+ RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
+ OUTPUT:
+ RETVAL
+
+int
+MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
+ int channel
+ Mix_Chunk *chunk
+ int loops
+ int ticks
+ int ms
+ CODE:
+ RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
+ OUTPUT:
+ RETVAL
+
+int
+MixFadeInMusic ( music, loops, ms )
+ Mix_Music *music
+ int loops
+ int ms
+ CODE:
+ RETVAL = Mix_FadeInMusic(music,loops,ms);
+ OUTPUT:
+ RETVAL
+
+int
+MixVolume ( channel, volume )
+ int channel
+ int volume
+ CODE:
+ RETVAL = Mix_Volume(channel,volume);
+ OUTPUT:
+ RETVAL
+
+int
+MixVolumeChunk ( chunk, volume )
+ Mix_Chunk *chunk
+ int volume
+ CODE:
+ RETVAL = Mix_VolumeChunk(chunk,volume);
+ OUTPUT:
+ RETVAL
+
+int
+MixVolumeMusic ( volume )
+ int volume
+ CODE:
+ RETVAL = Mix_VolumeMusic(volume);
+ OUTPUT:
+ RETVAL
+
+int
+MixHaltChannel ( channel )
+ int channel
+ CODE:
+ RETVAL = Mix_HaltChannel(channel);
+ OUTPUT:
+ RETVAL
+
+int
+MixHaltGroup ( tag )
+ int tag
+ CODE:
+ RETVAL = Mix_HaltGroup(tag);
+ OUTPUT:
+ RETVAL
+
+int
+MixHaltMusic ()
+ CODE:
+ RETVAL = Mix_HaltMusic();
+ OUTPUT:
+ RETVAL
+
+int
+MixExpireChannel ( channel, ticks )
+ int channel
+ int ticks
+ CODE:
+ RETVAL = Mix_ExpireChannel ( channel,ticks);
+ OUTPUT:
+ RETVAL
+
+int
+MixFadeOutChannel ( which, ms )
+ int which
+ int ms
+ CODE:
+ RETVAL = Mix_FadeOutChannel(which,ms);
+ OUTPUT:
+ RETVAL
+
+int
+MixFadeOutGroup ( which, ms )
+ int which
+ int ms
+ CODE:
+ RETVAL = Mix_FadeOutGroup(which,ms);
+ OUTPUT:
+ RETVAL
+
+int
+MixFadeOutMusic ( ms )
+ int ms
+ CODE:
+ RETVAL = Mix_FadeOutMusic(ms);
+ OUTPUT:
+ RETVAL
+
+Mix_Fading
+MixFadingMusic()
+ CODE:
+ RETVAL = Mix_FadingMusic();
+ OUTPUT:
+ RETVAL
+
+Mix_Fading
+MixFadingChannel( which )
+ int which
+ CODE:
+ RETVAL = Mix_FadingChannel(which);
+ OUTPUT:
+ RETVAL
+
+void
+MixPause ( channel )
+ int channel
+ CODE:
+ Mix_Pause(channel);
+
+void
+MixResume ( channel )
+ int channel
+ CODE:
+ Mix_Resume(channel);
+
+int
+MixPaused ( channel )
+ int channel
+ CODE:
+ RETVAL = Mix_Paused(channel);
+ OUTPUT:
+ RETVAL
+
+void
+MixPauseMusic ()
+ CODE:
+ Mix_PauseMusic();
+
+void
+MixResumeMusic ()
+ CODE:
+ Mix_ResumeMusic();
+
+void
+MixRewindMusic ()
+ CODE:
+ Mix_RewindMusic();
+
+int
+MixPausedMusic ()
+ CODE:
+ RETVAL = Mix_PausedMusic();
+ OUTPUT:
+ RETVAL
+
+int
+MixPlaying( channel )
+ int channel
+ CODE:
+ RETVAL = Mix_Playing(channel);
+ OUTPUT:
+ RETVAL
+
+int
+MixPlayingMusic()
+ CODE:
+ RETVAL = Mix_PlayingMusic();
+ OUTPUT:
+ RETVAL
+
+
+void
+MixCloseAudio ()
+ CODE:
+ Mix_CloseAudio();
+
+#endif
+
+int
+GLLoadLibrary ( path )
+ char *path
+ CODE:
+ RETVAL = SDL_GL_LoadLibrary(path);
+ OUTPUT:
+ RETVAL
+
+void*
+GLGetProcAddress ( proc )
+ char *proc
+ CODE:
+ RETVAL = SDL_GL_GetProcAddress(proc);
+ OUTPUT:
+ RETVAL
+
+int
+GLSetAttribute ( attr, value )
+ int attr
+ int value
+ CODE:
+ RETVAL = SDL_GL_SetAttribute(attr, value);
+ OUTPUT:
+ RETVAL
+
+AV *
+GLGetAttribute ( attr )
+ int attr
+ CODE:
+ int value;
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
+ av_push(RETVAL,newSViv(value));
+ OUTPUT:
+ RETVAL
+
+void
+GLSwapBuffers ()
+ CODE:
+ SDL_GL_SwapBuffers ();
+
+
+int
+BigEndian ()
+ CODE:
+ RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
+ OUTPUT:
+ RETVAL
+
+int
+NumJoysticks ()
+ CODE:
+ RETVAL = SDL_NumJoysticks();
+ OUTPUT:
+ RETVAL
+
+char *
+JoystickName ( index )
+ int index
+ CODE:
+ RETVAL = (char*)SDL_JoystickName(index);
+ OUTPUT:
+ RETVAL
+
+SDL_Joystick *
+JoystickOpen ( index )
+ int index
+ CODE:
+ RETVAL = SDL_JoystickOpen(index);
+ OUTPUT:
+ RETVAL
+
+int
+JoystickOpened ( index )
+ int index
+ CODE:
+ RETVAL = SDL_JoystickOpened(index);
+ OUTPUT:
+ RETVAL
+
+int
+JoystickIndex ( joystick )
+ SDL_Joystick *joystick
+ CODE:
+ RETVAL = SDL_JoystickIndex(joystick);
+ OUTPUT:
+ RETVAL
+
+int
+JoystickNumAxes ( joystick )
+ SDL_Joystick *joystick
+ CODE:
+ RETVAL = SDL_JoystickNumAxes(joystick);
+ OUTPUT:
+ RETVAL
+
+int
+JoystickNumBalls ( joystick )
+ SDL_Joystick *joystick
+ CODE:
+ RETVAL = SDL_JoystickNumBalls(joystick);
+ OUTPUT:
+ RETVAL
+
+int
+JoystickNumHats ( joystick )
+ SDL_Joystick *joystick
+ CODE:
+ RETVAL = SDL_JoystickNumHats(joystick);
+ OUTPUT:
+ RETVAL
+
+int
+JoystickNumButtons ( joystick )
+ SDL_Joystick *joystick
+ CODE:
+ RETVAL = SDL_JoystickNumButtons(joystick);
+ OUTPUT:
+ RETVAL
+
+void
+JoystickUpdate ()
+ CODE:
+ SDL_JoystickUpdate();
+
+Sint16
+JoystickGetAxis ( joystick, axis )
+ SDL_Joystick *joystick
+ int axis
+ CODE:
+ RETVAL = SDL_JoystickGetAxis(joystick,axis);
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoystickGetHat ( joystick, hat )
+ SDL_Joystick *joystick
+ int hat
+ CODE:
+ RETVAL = SDL_JoystickGetHat(joystick,hat);
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoystickGetButton ( joystick, button)
+ SDL_Joystick *joystick
+ int button
+ CODE:
+ RETVAL = SDL_JoystickGetButton(joystick,button);
+ OUTPUT:
+ RETVAL
+
+AV *
+JoystickGetBall ( joystick, ball )
+ SDL_Joystick *joystick
+ int ball
+ CODE:
+ int success,dx,dy;
+ success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(success));
+ av_push(RETVAL,newSViv(dx));
+ av_push(RETVAL,newSViv(dy));
+ OUTPUT:
+ RETVAL
+
+void
+JoystickClose ( joystick )
+ SDL_Joystick *joystick
+ CODE:
+ SDL_JoystickClose(joystick);
+
+Sint16
+JoyAxisEventWhich ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jaxis.which;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyAxisEventAxis ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jaxis.axis;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyAxisEventValue ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jaxis.value;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyButtonEventWhich ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jbutton.which;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyButtonEventButton ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jbutton.button;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyButtonEventState ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jbutton.state;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyHatEventWhich ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jhat.which;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyHatEventHat ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jhat.hat;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyHatEventValue ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jhat.value;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyBallEventWhich ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jball.which;
+ OUTPUT:
+ RETVAL
+
+Uint8
+JoyBallEventBall ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jball.ball;
+ OUTPUT:
+ RETVAL
+
+Sint16
+JoyBallEventXrel ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jball.xrel;
+ OUTPUT:
+ RETVAL
+
+Sint16
+JoyBallEventYrel ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->jball.yrel;
+ OUTPUT:
+ RETVAL
+
+void
+SetClipRect ( surface, rect )
+ SDL_Surface *surface
+ SDL_Rect *rect
+ CODE:
+ SDL_SetClipRect(surface,rect);
+
+SDL_Rect*
+GetClipRect ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect));
+ SDL_GetClipRect(surface,RETVAL);
+ OUTPUT:
+ RETVAL
+
+
+#ifdef HAVE_SDL_NET
+
+int
+NetInit ()
+ CODE:
+ RETVAL = SDLNet_Init();
+ OUTPUT:
+ RETVAL
+
+void
+NetQuit ()
+ CODE:
+ SDLNet_Quit();
+
+IPaddress*
+NetNewIPaddress ( host, port )
+ Uint32 host
+ Uint16 port
+ CODE:
+ RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
+ RETVAL->host = host;
+ RETVAL->port = port;
+ OUTPUT:
+ RETVAL
+
+Uint32
+NetIPaddressHost ( ip )
+ IPaddress *ip
+ CODE:
+ RETVAL = ip->host;
+ OUTPUT:
+ RETVAL
+
+Uint16
+NetIPaddressPort ( ip )
+ IPaddress *ip
+ CODE:
+ RETVAL = ip->port;
+ OUTPUT:
+ RETVAL
+
+void
+NetFreeIPaddress ( ip )
+ IPaddress *ip
+ CODE:
+ safefree(ip);
+
+char*
+NetResolveIP ( address )
+ IPaddress *address
+ CODE:
+ RETVAL = SDLNet_ResolveIP(address);
+ OUTPUT:
+ RETVAL
+
+int
+NetResolveHost ( address, host, port )
+ IPaddress *address
+ char *host
+ Uint16 port
+ CODE:
+ RETVAL = SDLNet_ResolveHost(address,host,port);
+ OUTPUT:
+ RETVAL
+
+TCPsocket
+NetTCPOpen ( ip )
+ IPaddress *ip
+ CODE:
+ RETVAL = SDLNet_TCP_Open(ip);
+ OUTPUT:
+ RETVAL
+
+TCPsocket
+NetTCPAccept ( server )
+ TCPsocket server
+ CODE:
+ RETVAL = SDLNet_TCP_Accept(server);
+ OUTPUT:
+ RETVAL
+
+IPaddress*
+NetTCPGetPeerAddress ( sock )
+ TCPsocket sock
+ CODE:
+ RETVAL = SDLNet_TCP_GetPeerAddress(sock);
+ OUTPUT:
+ RETVAL
+
+int
+NetTCPSend ( sock, data, len )
+ TCPsocket sock
+ void *data
+ int len
+ CODE:
+ RETVAL = SDLNet_TCP_Send(sock,data,len);
+ OUTPUT:
+ RETVAL
+
+AV*
+NetTCPRecv ( sock, maxlen )
+ TCPsocket sock
+ int maxlen
+ CODE:
+ int status;
+ void *buffer;
+ buffer = safemalloc(maxlen);
+ RETVAL = newAV();
+ status = SDLNet_TCP_Recv(sock,buffer,maxlen);
+ av_push(RETVAL,newSViv(status));
+ av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
+ OUTPUT:
+ RETVAL
+
+void
+NetTCPClose ( sock )
+ TCPsocket sock
+ CODE:
+ SDLNet_TCP_Close(sock);
+
+UDPpacket*
+NetAllocPacket ( size )
+ int size
+ CODE:
+ RETVAL = SDLNet_AllocPacket(size);
+ OUTPUT:
+ RETVAL
+
+UDPpacket**
+NetAllocPacketV ( howmany, size )
+ int howmany
+ int size
+ CODE:
+ RETVAL = SDLNet_AllocPacketV(howmany,size);
+ OUTPUT:
+ RETVAL
+
+int
+NetResizePacket ( packet, newsize )
+ UDPpacket *packet
+ int newsize
+ CODE:
+ RETVAL = SDLNet_ResizePacket(packet,newsize);
+ OUTPUT:
+ RETVAL
+
+void
+NetFreePacket ( packet )
+ UDPpacket *packet
+ CODE:
+ SDLNet_FreePacket(packet);
+
+void
+NetFreePacketV ( packet )
+ UDPpacket **packet
+ CODE:
+ SDLNet_FreePacketV(packet);
+
+UDPsocket
+NetUDPOpen ( port )
+ Uint16 port
+ CODE:
+ RETVAL = SDLNet_UDP_Open(port);
+ OUTPUT:
+ RETVAL
+
+int
+NetUDPBind ( sock, channel, address )
+ UDPsocket sock
+ int channel
+ IPaddress *address
+ CODE:
+ RETVAL = SDLNet_UDP_Bind(sock,channel,address);
+ OUTPUT:
+ RETVAL
+
+void
+NetUDPUnbind ( sock, channel )
+ UDPsocket sock
+ int channel
+ CODE:
+ SDLNet_UDP_Unbind(sock,channel);
+
+IPaddress*
+NetUDPGetPeerAddress ( sock, channel )
+ UDPsocket sock
+ int channel
+ CODE:
+ RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
+ OUTPUT:
+ RETVAL
+
+int
+NetUDPSendV ( sock, packets, npackets )
+ UDPsocket sock
+ UDPpacket **packets
+ int npackets
+ CODE:
+ RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
+ OUTPUT:
+ RETVAL
+
+int
+NetUDPSend ( sock, channel, packet )
+ UDPsocket sock
+ int channel
+ UDPpacket *packet
+ CODE:
+ RETVAL = SDLNet_UDP_Send(sock,channel,packet);
+ OUTPUT:
+ RETVAL
+
+int
+NetUDPRecvV ( sock, packets )
+ UDPsocket sock
+ UDPpacket **packets
+ CODE:
+ RETVAL = SDLNet_UDP_RecvV(sock,packets);
+ OUTPUT:
+ RETVAL
+
+int
+NetUDPRecv ( sock, packet )
+ UDPsocket sock
+ UDPpacket *packet
+ CODE:
+ RETVAL = SDLNet_UDP_Recv(sock,packet);
+ OUTPUT:
+ RETVAL
+
+void
+NetUDPClose ( sock )
+ UDPsocket sock
+ CODE:
+ SDLNet_UDP_Close(sock);
+
+SDLNet_SocketSet
+NetAllocSocketSet ( maxsockets )
+ int maxsockets
+ CODE:
+ RETVAL = SDLNet_AllocSocketSet(maxsockets);
+ OUTPUT:
+ RETVAL
+
+int
+NetTCP_AddSocket ( set, sock )
+ SDLNet_SocketSet set
+ TCPsocket sock
+ CODE:
+ RETVAL = SDLNet_TCP_AddSocket(set,sock);
+ OUTPUT:
+ RETVAL
+
+int
+NetUDP_AddSocket ( set, sock )
+ SDLNet_SocketSet set
+ UDPsocket sock
+ CODE:
+ RETVAL = SDLNet_UDP_AddSocket(set,sock);
+ OUTPUT:
+ RETVAL
+
+int
+NetTCP_DelSocket ( set, sock )
+ SDLNet_SocketSet set
+ TCPsocket sock
+ CODE:
+ RETVAL = SDLNet_TCP_DelSocket(set,sock);
+ OUTPUT:
+ RETVAL
+
+int
+NetUDP_DelSocket ( set, sock )
+ SDLNet_SocketSet set
+ UDPsocket sock
+ CODE:
+ RETVAL = SDLNet_UDP_DelSocket(set,sock);
+ OUTPUT:
+ RETVAL
+
+int
+NetCheckSockets ( set, timeout )
+ SDLNet_SocketSet set
+ Uint32 timeout
+ CODE:
+ RETVAL = SDLNet_CheckSockets(set,timeout);
+ OUTPUT:
+ RETVAL
+
+int
+NetSocketReady ( sock )
+ SDLNet_GenericSocket sock
+ CODE:
+ RETVAL = SDLNet_SocketReady(sock);
+ OUTPUT:
+ RETVAL
+
+void
+NetFreeSocketSet ( set )
+ SDLNet_SocketSet set
+ CODE:
+ SDLNet_FreeSocketSet(set);
+
+void
+NetWrite16 ( value, area )
+ Uint16 value
+ void *area
+ CODE:
+ SDLNet_Write16(value,area);
+
+void
+NetWrite32 ( value, area )
+ Uint32 value
+ void *area
+ CODE:
+ SDLNet_Write32(value,area);
+
+Uint16
+NetRead16 ( area )
+ void *area
+ CODE:
+ RETVAL = SDLNet_Read16(area);
+ OUTPUT:
+ RETVAL
+
+Uint32
+NetRead32 ( area )
+ void *area
+ CODE:
+ RETVAL = SDLNet_Read32(area);
+ OUTPUT:
+ RETVAL
+
+#endif
+
+#ifdef HAVE_SDL_TTF
+
+int
+TTFInit ()
+ CODE:
+ RETVAL = TTF_Init();
+ OUTPUT:
+ RETVAL
+
+void
+TTFQuit ()
+ CODE:
+ TTF_Quit();
+
+TTF_Font*
+TTFOpenFont ( file, ptsize )
+ char *file
+ int ptsize
+ CODE:
+ RETVAL = TTF_OpenFont(file,ptsize);
+ OUTPUT:
+ RETVAL
+
+int
+TTFGetFontStyle ( font )
+ TTF_Font *font
+ CODE:
+ RETVAL = TTF_GetFontStyle(font);
+ OUTPUT:
+ RETVAL
+
+void
+TTFSetFontStyle ( font, style )
+ TTF_Font *font
+ int style
+ CODE:
+ TTF_SetFontStyle(font,style);
+
+int
+TTFFontHeight ( font )
+ TTF_Font *font
+ CODE:
+ RETVAL = TTF_FontHeight(font);
+ OUTPUT:
+ RETVAL
+
+int
+TTFFontAscent ( font )
+ TTF_Font *font
+ CODE:
+ RETVAL = TTF_FontAscent(font);
+ OUTPUT:
+ RETVAL
+
+int
+TTFFontDescent ( font )
+ TTF_Font *font
+ CODE:
+ RETVAL = TTF_FontDescent(font);
+ OUTPUT:
+ RETVAL
+
+int
+TTFFontLineSkip ( font )
+ TTF_Font *font
+ CODE:
+ RETVAL = TTF_FontLineSkip(font);
+ OUTPUT:
+ RETVAL
+
+AV*
+TTFGlyphMetrics ( font, ch )
+ TTF_Font *font
+ Uint16 ch
+ CODE:
+ int minx, miny, maxx, maxy, advance;
+ RETVAL = newAV();
+ TTF_GlyphMetrics(font, ch, &minx, &miny, &maxx, &maxy, &advance);
+ av_push(RETVAL,newSViv(minx));
+ av_push(RETVAL,newSViv(miny));
+ av_push(RETVAL,newSViv(maxx));
+ av_push(RETVAL,newSViv(maxy));
+ av_push(RETVAL,newSViv(advance));
+ OUTPUT:
+ RETVAL
+
+AV*
+TTFSizeText ( font, text )
+ TTF_Font *font
+ char *text
+ CODE:
+ int w,h;
+ RETVAL = newAV();
+ TTF_SizeText(font,text,&w,&h);
+ av_push(RETVAL,newSViv(w));
+ av_push(RETVAL,newSViv(h));
+ OUTPUT:
+ RETVAL
+
+AV*
+TTFSizeUTF8 ( font, text )
+ TTF_Font *font
+ char *text
+ CODE:
+ int w,h;
+ RETVAL = newAV();
+ TTF_SizeUTF8(font,text,&w,&h);
+ av_push(RETVAL,newSViv(w));
+ av_push(RETVAL,newSViv(h));
+ OUTPUT:
+ RETVAL
+
+AV*
+TTFSizeUNICODE ( font, text )
+ TTF_Font *font
+ const Uint16 *text
+ CODE:
+ int w,h;
+ RETVAL = newAV();
+ TTF_SizeUNICODE(font,text,&w,&h);
+ av_push(RETVAL,newSViv(w));
+ av_push(RETVAL,newSViv(h));
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderTextSolid ( font, text, fg )
+ TTF_Font *font
+ char *text
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderText_Solid(font,text,*fg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderUTF8Solid ( font, text, fg )
+ TTF_Font *font
+ char *text
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderUTF8_Solid(font,text,*fg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderUNICODESolid ( font, text, fg )
+ TTF_Font *font
+ const Uint16 *text
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderUNICODE_Solid(font,text,*fg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderGlyphSolid ( font, ch, fg )
+ TTF_Font *font
+ Uint16 ch
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderGlyph_Solid(font,ch,*fg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderTextShaded ( font, text, fg, bg )
+ TTF_Font *font
+ char *text
+ SDL_Color *fg
+ SDL_Color *bg
+ CODE:
+ RETVAL = TTF_RenderText_Shaded(font,text,*fg,*bg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderUTF8Shaded( font, text, fg, bg )
+ TTF_Font *font
+ char *text
+ SDL_Color *fg
+ SDL_Color *bg
+ CODE:
+ RETVAL = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderUNICODEShaded( font, text, fg, bg )
+ TTF_Font *font
+ const Uint16 *text
+ SDL_Color *fg
+ SDL_Color *bg
+ CODE:
+ RETVAL = TTF_RenderUNICODE_Shaded(font,text,*fg,*bg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderGlyphShaded ( font, ch, fg, bg )
+ TTF_Font *font
+ Uint16 ch
+ SDL_Color *fg
+ SDL_Color *bg
+ CODE:
+ RETVAL = TTF_RenderGlyph_Shaded(font,ch,*fg,*bg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderTextBlended( font, text, fg )
+ TTF_Font *font
+ char *text
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderText_Blended(font,text,*fg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderUTF8Blended( font, text, fg )
+ TTF_Font *font
+ char *text
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderUTF8_Blended(font,text,*fg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderUNICODEBlended( font, text, fg )
+ TTF_Font *font
+ const Uint16 *text
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderUNICODE_Blended(font,text,*fg);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface*
+TTFRenderGlyphBlended( font, ch, fg )
+ TTF_Font *font
+ Uint16 ch
+ SDL_Color *fg
+ CODE:
+ RETVAL = TTF_RenderGlyph_Blended(font,ch,*fg);
+ OUTPUT:
+ RETVAL
+
+void
+TTFCloseFont ( font )
+ TTF_Font *font
+ CODE:
+ TTF_CloseFont(font);
+
+SDL_Surface*
+TTFPutString ( font, mode, surface, x, y, fg, bg, text )
+ TTF_Font *font
+ int mode
+ SDL_Surface *surface
+ int x
+ int y
+ SDL_Color *fg
+ SDL_Color *bg
+ char *text
+ CODE:
+ SDL_Surface *img;
+ SDL_Rect dest;
+ int w,h;
+ dest.x = x;
+ dest.y = y;
+ RETVAL = NULL;
+ switch (mode) {
+ case TEXT_SOLID:
+ img = TTF_RenderText_Solid(font,text,*fg);
+ TTF_SizeText(font,text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case TEXT_SHADED:
+ img = TTF_RenderText_Shaded(font,text,*fg,*bg);
+ TTF_SizeText(font,text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case TEXT_BLENDED:
+ img = TTF_RenderText_Blended(font,text,*fg);
+ TTF_SizeText(font,text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case UTF8_SOLID:
+ img = TTF_RenderUTF8_Solid(font,text,*fg);
+ TTF_SizeUTF8(font,text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case UTF8_SHADED:
+ img = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
+ TTF_SizeUTF8(font,text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case UTF8_BLENDED:
+ img = TTF_RenderUTF8_Blended(font,text,*fg);
+ TTF_SizeUTF8(font,text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case UNICODE_SOLID:
+ img = TTF_RenderUNICODE_Solid(font,(Uint16*)text,*fg);
+ TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case UNICODE_SHADED:
+ img = TTF_RenderUNICODE_Shaded(font,(Uint16*)text,*fg,*bg);
+ TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ case UNICODE_BLENDED:
+ img = TTF_RenderUNICODE_Blended(font,(Uint16*)text,*fg);
+ TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ break;
+ default:
+ img = TTF_RenderText_Shaded(font,text,*fg,*bg);
+ TTF_SizeText(font,text,&w,&h);
+ dest.w = w;
+ dest.h = h;
+ }
+ if ( img && img->format && img->format->palette ) {
+ SDL_Color *c = &img->format->palette->colors[0];
+ Uint32 key = SDL_MapRGB( img->format, c->r, c->g, c->b );
+ SDL_SetColorKey(img,SDL_SRCCOLORKEY,key );
+ if (0 > SDL_BlitSurface(img,NULL,surface,&dest)) {
+ SDL_FreeSurface(img);
+ RETVAL = NULL;
+ } else {
+ RETVAL = img;
+ }
+ }
+ OUTPUT:
+ RETVAL
+
+#endif
+
+SDL_Overlay*
+CreateYUVOverlay ( width, height, format, display )
+ int width
+ int height
+ Uint32 format
+ SDL_Surface *display
+ CODE:
+ RETVAL = SDL_CreateYUVOverlay ( width, height, format, display );
+ OUTPUT:
+ RETVAL
+
+int
+LockYUVOverlay ( overlay )
+ SDL_Overlay *overlay
+ CODE:
+ RETVAL = SDL_LockYUVOverlay(overlay);
+ OUTPUT:
+ RETVAL
+
+void
+UnlockYUVOverlay ( overlay )
+ SDL_Overlay *overlay
+ CODE:
+ SDL_UnlockYUVOverlay(overlay);
+
+int
+DisplayYUVOverlay ( overlay, dstrect )
+ SDL_Overlay *overlay
+ SDL_Rect *dstrect
+ CODE:
+ RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
+ OUTPUT:
+ RETVAL
+
+void
+FreeYUVOverlay ( overlay )
+ SDL_Overlay *overlay
+ CODE:
+ SDL_FreeYUVOverlay ( overlay );
+
+Uint32
+OverlayFormat ( overlay, ... )
+ SDL_Overlay *overlay
+ CODE:
+ if ( items > 1 )
+ overlay->format = SvIV(ST(1));
+ RETVAL = overlay->format;
+ OUTPUT:
+ RETVAL
+
+int
+OverlayW ( overlay, ... )
+ SDL_Overlay *overlay
+ CODE:
+ if ( items > 1 )
+ overlay->w = SvIV(ST(1));
+ RETVAL = overlay->w;
+ OUTPUT:
+ RETVAL
+
+int
+OverlayH ( overlay, ... )
+ SDL_Overlay *overlay
+ CODE:
+ if ( items > 1 )
+ overlay->h = SvIV(ST(1));
+ RETVAL = overlay->h;
+ OUTPUT:
+ RETVAL
+
+int
+OverlayPlanes ( overlay, ... )
+ SDL_Overlay *overlay
+ CODE:
+ if ( items > 1 )
+ overlay->planes = SvIV(ST(1));
+ RETVAL = overlay->planes;
+ OUTPUT:
+ RETVAL
+
+Uint32
+OverlayHW ( overlay )
+ SDL_Overlay *overlay
+ CODE:
+ RETVAL = overlay->hw_overlay;
+ OUTPUT:
+ RETVAL
+
+Uint16*
+OverlayPitches ( overlay )
+ SDL_Overlay *overlay
+ CODE:
+ RETVAL = overlay->pitches;
+ OUTPUT:
+ RETVAL
+
+Uint8**
+OverlayPixels ( overlay )
+ SDL_Overlay *overlay
+ CODE:
+ RETVAL = overlay->pixels;
+ OUTPUT:
+ RETVAL
+
+int
+WMToggleFullScreen ( surface )
+ SDL_Surface *surface
+ CODE:
+ RETVAL = SDL_WM_ToggleFullScreen(surface);
+ OUTPUT:
+ RETVAL
+
+Uint32
+WMGrabInput ( mode )
+ Uint32 mode
+ CODE:
+ RETVAL = SDL_WM_GrabInput(mode);
+ OUTPUT:
+ RETVAL
+
+int
+WMIconifyWindow ()
+ CODE:
+ RETVAL = SDL_WM_IconifyWindow();
+ OUTPUT:
+ RETVAL
+
+int
+ResizeEventW ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->resize.w;
+ OUTPUT:
+ RETVAL
+
+int
+ResizeEventH ( e )
+ SDL_Event *e
+ CODE:
+ RETVAL = e->resize.h;
+ OUTPUT:
+ RETVAL
+
+char*
+AudioDriverName ()
+ CODE:
+ char name[32];
+ RETVAL = SDL_AudioDriverName(name,32);
+ OUTPUT:
+ RETVAL
+
+Uint32
+GetKeyState ( k )
+ SDLKey k
+ CODE:
+ if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
+ RETVAL = SDL_GetKeyState(NULL)[k];
+ OUTPUT:
+ RETVAL
+
+#ifdef HAVE_SMPEG
+
+SMPEG_Info *
+NewSMPEGInfo()
+ CODE:
+ RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
+ OUTPUT:
+ RETVAL
+
+void
+FreeSMPEGInfo ( info )
+ SMPEG_Info *info;
+ CODE:
+ safefree(info);
+
+int
+SMPEGInfoHasAudio ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->has_audio;
+ OUTPUT:
+ RETVAL
+
+int
+SMPEGInfoHasVideo ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->has_video;
+ OUTPUT:
+ RETVAL
+
+int
+SMPEGInfoWidth ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->width;
+ OUTPUT:
+ RETVAL
+
+int
+SMPEGInfoHeight ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->height;
+ OUTPUT:
+ RETVAL
+
+int
+SMPEGInfoCurrentFrame ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->current_frame;
+ OUTPUT:
+ RETVAL
+
+double
+SMPEGInfoCurrentFPS ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->current_fps;
+ OUTPUT:
+ RETVAL
+
+int
+SMPEGInfoCurrentAudioFrame ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->audio_current_frame;
+ OUTPUT:
+ RETVAL
+
+int
+SMPEGInfoCurrentOffset ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->current_offset;
+ OUTPUT:
+ RETVAL
+
+int
+SMPEGInfoTotalSize ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->total_size;
+ OUTPUT:
+ RETVAL
+
+double
+SMPEGInfoCurrentTime ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->current_time;
+ OUTPUT:
+ RETVAL
+
+double
+SMPEGInfoTotalTime ( info )
+ SMPEG_Info* info;
+ CODE:
+ RETVAL = info->total_time;
+ OUTPUT:
+ RETVAL
+
+char *
+SMPEGError ( mpeg )
+ SMPEG* mpeg ;
+ CODE:
+ RETVAL = SMPEG_error(mpeg);
+ OUTPUT:
+ RETVAL
+
+SMPEG*
+NewSMPEG ( filename, info, use_audio )
+ char* filename;
+ SMPEG_Info* info;
+ int use_audio
+ CODE:
+#ifdef HAVE_SDL_MIXER
+ RETVAL = SMPEG_new(filename,info,0);
+#else
+ RETVAL = SMPEG_new(filename,info,use_audio);
+#endif
+ OUTPUT:
+ RETVAL
+
+void
+FreeSMPEG ( mpeg )
+ SMPEG* mpeg;
+ CODE:
+ SMPEG_delete(mpeg);
+
+void
+SMPEGEnableAudio ( mpeg , flag )
+ SMPEG* mpeg ;
+ int flag;
+ CODE:
+ SMPEG_enableaudio(mpeg,flag);
+#ifdef HAVE_SDL_MIXER
+ sdl_perl_use_smpeg_audio = flag;
+#endif
+
+void
+SMPEGEnableVideo ( mpeg , flag )
+ SMPEG* mpeg ;
+ int flag;
+ CODE:
+ SMPEG_enablevideo(mpeg,flag);
+
+void
+SMPEGSetVolume ( mpeg , volume )
+ SMPEG* mpeg ;
+ int volume;
+ CODE:
+ SMPEG_setvolume(mpeg,volume);
+
+void
+SMPEGSetDisplay ( mpeg, dest, surfLock )
+ SMPEG* mpeg;
+ SDL_Surface* dest;
+ SDL_mutex* surfLock;
+ CODE:
+ SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
+
+void
+SMPEGScaleXY ( mpeg, w, h)
+ SMPEG* mpeg;
+ int w;
+ int h;
+ CODE:
+ SMPEG_scaleXY(mpeg,w,h);
+
+void
+SMPEGScale ( mpeg, scale )
+ SMPEG* mpeg;
+ int scale
+ CODE:
+ SMPEG_scale(mpeg,scale);
+
+void
+SMPEGPlay ( mpeg )
+ SMPEG* mpeg;
+ CODE:
+ SDL_AudioSpec audiofmt;
+ Uint16 format;
+ int freq, channels;
+#ifdef HAVE_SDL_MIXER
+ if (sdl_perl_use_smpeg_audio ) {
+ SMPEG_enableaudio(mpeg, 0);
+ Mix_QuerySpec(&freq, &format, &channels);
+ audiofmt.format = format;
+ audiofmt.freq = freq;
+ audiofmt.channels = channels;
+ SMPEG_actualSpec(mpeg, &audiofmt);
+ Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
+ SMPEG_enableaudio(mpeg, 1);
+ }
+#endif
+ SMPEG_play(mpeg);
+
+SMPEGstatus
+SMPEGStatus ( mpeg )
+ SMPEG* mpeg;
+ CODE:
+ RETVAL = SMPEG_status(mpeg);
+ OUTPUT:
+ RETVAL
+
+void
+SMPEGPause ( mpeg )
+ SMPEG* mpeg;
+ CODE:
+ SMPEG_pause(mpeg);
+
+void
+SMPEGLoop ( mpeg, repeat )
+ SMPEG* mpeg;
+ int repeat
+ CODE:
+ SMPEG_loop(mpeg,repeat);
+
+void
+SMPEGStop ( mpeg )
+ SMPEG* mpeg;
+ CODE:
+ SMPEG_stop(mpeg);
+#ifdef HAVE_SDL_MIXER
+ Mix_HookMusic(NULL, NULL);
+#endif
+
+void
+SMPEGRewind ( mpeg )
+ SMPEG* mpeg;
+ CODE:
+ SMPEG_rewind(mpeg);
+
+void
+SMPEGSeek ( mpeg, bytes )
+ SMPEG* mpeg;
+ int bytes;
+ CODE:
+ SMPEG_seek(mpeg,bytes);
+
+void
+SMPEGSkip ( mpeg, seconds )
+ SMPEG* mpeg;
+ float seconds;
+ CODE:
+ SMPEG_skip(mpeg,seconds);
+
+void
+SMPEGSetDisplayRegion ( mpeg, rect )
+ SMPEG* mpeg;
+ SDL_Rect* rect;
+ CODE:
+ SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
+
+void
+SMPEGRenderFrame ( mpeg, frame )
+ SMPEG* mpeg;
+ int frame;
+ CODE:
+ SMPEG_renderFrame(mpeg,frame);
+
+SMPEG_Info *
+SMPEGGetInfo ( mpeg )
+ SMPEG* mpeg;
+ CODE:
+ RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
+ SMPEG_getinfo(mpeg,RETVAL);
+ OUTPUT:
+ RETVAL
+
+
+#endif
+
+#ifdef HAVE_SDL_GFX
+
+SDL_Surface *
+GFXRotoZoom ( src, angle, zoom, smooth)
+ SDL_Surface * src;
+ double angle;
+ double zoom;
+ int smooth;
+ CODE:
+ RETVAL = rotozoomSurface( src, angle, zoom, smooth);
+ OUTPUT:
+ RETVAL
+
+SDL_Surface *
+GFXZoom ( src, zoomx, zoomy, smooth)
+ SDL_Surface *src;
+ double zoomx;
+ double zoomy;
+ int smooth;
+ CODE:
+ RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
+ OUTPUT:
+ RETVAL
+
+
+int
+GFXPixelColor ( dst, x, y, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Uint32 color;
+CODE:
+ RETVAL = pixelColor( dst, x, y, color);
+OUTPUT:
+ RETVAL
+
+int
+GFXPixelRGBA ( dst, x, y, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXHlineColor ( dst, x1, x2, y, color )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 x2;
+ Sint16 y;
+ Uint32 color;
+CODE:
+ RETVAL = hlineColor( dst, x1, x2, y, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 x2;
+ Sint16 y;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXVlineColor ( dst, x, y1, y2, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y1;
+ Sint16 y2;
+ Uint32 color;
+CODE:
+ RETVAL = vlineColor( dst, x, y1, y2, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y1;
+ Sint16 y2;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXRectangleColor ( dst, x1, y1, x2, y2, color )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint32 color;
+CODE:
+ RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXBoxColor ( dst, x1, y1, x2, y2, color )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint32 color;
+CODE:
+ RETVAL = boxColor( dst, x1, y1, x2, y2, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXLineColor ( dst, x1, y1, x2, y2, color )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint32 color;
+CODE:
+ RETVAL = lineColor( dst, x1, y1, x2, y2, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXAalineColor ( dst, x1, y1, x2, y2, color )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint32 color;
+CODE:
+ RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x1;
+ Sint16 y1;
+ Sint16 x2;
+ Sint16 y2;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXCircleColor ( dst, x, y, r, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 r;
+ Uint32 color;
+CODE:
+ RETVAL = circleColor( dst, x, y, r, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rad;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXAacircleColor ( dst, x, y, r, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 r;
+ Uint32 color;
+CODE:
+ RETVAL = aacircleColor( dst, x, y, r, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rad;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledCircleColor ( dst, x, y, r, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 r;
+ Uint32 color;
+CODE:
+ RETVAL = filledCircleColor( dst, x, y, r, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rad;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXEllipseColor ( dst, x, y, rx, ry, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rx;
+ Sint16 ry;
+ Uint32 color;
+CODE:
+ RETVAL = ellipseColor( dst, x, y, rx, ry, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rx;
+ Sint16 ry;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
+ SDL_Surface* dst;
+ Sint16 xc;
+ Sint16 yc;
+ Sint16 rx;
+ Sint16 ry;
+ Uint32 color;
+CODE:
+ RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rx;
+ Sint16 ry;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rx;
+ Sint16 ry;
+ Uint32 color;
+CODE:
+ RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rx;
+ Sint16 ry;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledpieColor ( dst, x, y, rad, start, end, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rad;
+ Sint16 start;
+ Sint16 end;
+ Uint32 color;
+CODE:
+ RETVAL = filledpieColor( dst, x, y, rad, start, end, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledpieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ Sint16 rad;
+ Sint16 start;
+ Sint16 end;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = filledpieRGBA( dst, x, y, rad, start, end, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXPolygonColor ( dst, vx, vy, n, color )
+ SDL_Surface* dst;
+ Sint16* vx;
+ Sint16* vy;
+ int n;
+ Uint32 color;
+CODE:
+ RETVAL = polygonColor( dst, vx, vy, n, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16* vx;
+ Sint16* vy;
+ int n;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXAapolygonColor ( dst, vx, vy, n, color )
+ SDL_Surface* dst;
+ Sint16* vx;
+ Sint16* vy;
+ int n;
+ Uint32 color;
+CODE:
+ RETVAL = aapolygonColor( dst, vx, vy, n, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16* vx;
+ Sint16* vy;
+ int n;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledPolygonColor ( dst, vx, vy, n, color )
+ SDL_Surface* dst;
+ Sint16* vx;
+ Sint16* vy;
+ int n;
+ int color;
+CODE:
+ RETVAL = filledPolygonColor( dst, vx, vy, n, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16* vx;
+ Sint16* vy;
+ int n;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXCharacterColor ( dst, x, y, c, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ char c;
+ Uint32 color;
+CODE:
+ RETVAL = characterColor( dst, x, y, c, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ char c;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+int
+GFXStringColor ( dst, x, y, c, color )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ char* c;
+ Uint32 color;
+CODE:
+ RETVAL = stringColor( dst, x, y, c, color );
+OUTPUT:
+ RETVAL
+
+int
+GFXStringRGBA ( dst, x, y, c, r, g, b, a )
+ SDL_Surface* dst;
+ Sint16 x;
+ Sint16 y;
+ char* c;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 a;
+CODE:
+ RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
+OUTPUT:
+ RETVAL
+
+#endif
+
+#ifdef HAVE_SDL_SOUND
+
+Uint16
+SoundAudioInfoFormat ( audioinfo )
+ Sound_AudioInfo* audioinfo
+ CODE:
+ RETVAL = audioinfo->format;
+ OUTPUT:
+ RETVAL
+
+Uint8
+SoundAudioInfoChannels ( audioinfo )
+ Sound_AudioInfo* audioinfo
+ CODE:
+ RETVAL = audioinfo->channels;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SoundAudioInforate ( audioinfo )
+ Sound_AudioInfo* audioinfo
+ CODE:
+ RETVAL = audioinfo->rate;
+ OUTPUT:
+ RETVAL
+
+AV*
+SoundDecoderInfoExtensions ( decoderinfo )
+ Sound_DecoderInfo* decoderinfo
+ CODE:
+ char **ext;
+ for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
+ av_push(RETVAL,sv_2mortal(newSVpv(*ext,0)));
+ }
+ OUTPUT:
+ RETVAL
+
+char*
+SoundDecoderInfoDescription ( decoderinfo )
+ Sound_DecoderInfo* decoderinfo
+ CODE:
+ RETVAL = decoderinfo->description;
+ OUTPUT:
+ RETVAL
+
+char*
+SoundDecoderInfoAuthor ( decoderinfo )
+ Sound_DecoderInfo* decoderinfo
+ CODE:
+ RETVAL = decoderinfo->author;
+ OUTPUT:
+ RETVAL
+
+char*
+SoundDecoderInfoUrl ( decoderinfo )
+ Sound_DecoderInfo* decoderinfo
+ CODE:
+ RETVAL = decoderinfo->url;
+ OUTPUT:
+ RETVAL
+
+const Sound_DecoderInfo*
+SoundSampleDecoder ( sample )
+ Sound_Sample* sample
+ CODE:
+ RETVAL = sample->decoder;
+ OUTPUT:
+ RETVAL
+
+Sound_AudioInfo*
+SoundSampleDesired ( sample )
+ Sound_Sample* sample
+ CODE:
+ RETVAL = &sample->desired;
+ OUTPUT:
+ RETVAL
+
+Sound_AudioInfo*
+SoundSampleAcutal ( sample )
+ Sound_Sample* sample
+ CODE:
+ RETVAL = &sample->actual;
+ OUTPUT:
+ RETVAL
+
+char*
+SoundSampleBuffer ( sample )
+ Sound_Sample* sample
+ CODE:
+ RETVAL = sample->buffer;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SoundSampleBufferSize ( sample )
+ Sound_Sample* sample
+ CODE:
+ RETVAL = sample->buffer;
+ OUTPUT:
+ RETVAL
+
+Uint32
+SoundSampleFlags ( sample )
+ Sound_Sample* sample
+ CODE:
+ RETVAL = (Uint32)sample->flags;
+ OUTPUT:
+ RETVAL
+
+
+
+#endif
+
+MODULE = SDL PACKAGE = SDL
+PROTOTYPES : DISABLE
+
+
--- /dev/null
+/************************************************************************
+* SFONT - SDL Font Library by Karl Bartel <karlb@gmx.net> *
+* *
+* All functions are explained below. There are two versions of each *
+* funtction. The first is the normal one, the function with the *
+* 2 at the end can be used when you want to handle more than one font *
+* in your program. *
+* *
+************************************************************************/
+
+#include "SDL.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Delcare one variable of this type for each font you are using.
+// To load the fonts, load the font image into YourFont->Surface
+// and call InitFont( YourFont );
+typedef struct {
+ SDL_Surface *Surface;
+ int CharPos[512];
+ int h;
+} SFont_FontInfo;
+
+// Initializes the font
+// Font: this contains the suface with the font.
+// The font must be loaded before using this function.
+void InitFont (SDL_Surface *Font);
+void InitFont2(SFont_FontInfo *Font);
+
+// Blits a string to a surface
+// Destination: the suface you want to blit to
+// text: a string containing the text you want to blit.
+void PutString (SDL_Surface *Surface, int x, int y, char *text);
+void PutString2(SDL_Surface *Surface, SFont_FontInfo *Font, int x, int y, char *text);
+
+// Returns the width of "text" in pixels
+#ifdef MACOSX
+int SFont_TextWidth(char *text);
+int SFont_TextWidth2(SFont_FontInfo *Font, char *text);
+#else
+int TextWidth(char *text);
+int TextWidth2(SFont_FontInfo *Font, char *text);
+#endif
+
+// Blits a string to with centered x position
+void XCenteredString (SDL_Surface *Surface, int y, char *text);
+void XCenteredString2(SDL_Surface *Surface, SFont_FontInfo *Font, int y, char *text);
+
+// Allows the user to enter text
+// Width: What is the maximum width of the text (in pixels)
+// text: This string contains the text which was entered by the user
+void SFont_Input ( SDL_Surface *Destination, int x, int y, int Width, char *text);
+void SFont_Input2( SDL_Surface *Destination, SFont_FontInfo *Font, int x, int y, int Width, char *text);
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null
+// SDL::SFont
+//
+// SFont bitmap font support
+//
+// SFont library code by Karl Bartel <karlb@gmx.net>
+//
+// SFont.xs Copyright (C) 2004 David J. Goehrig
+//
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+#include <string.h>
+#include <stdlib.h>
+
+#ifdef USE_THREADS
+#define HAVE_TLS_CONTEXT
+#endif
+
+#include "../defines.h"
+#include "../SFont.h"
+
+#ifdef HAVE_SDL_IMAGE
+#include <SDL_image.h>
+
+SFont_FontInfo InternalFont;
+Uint32 SFont_GetPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y)
+{
+
+ Uint8 *bits;
+ Uint32 Bpp;
+ if (X<0) puts("SFONT ERROR: x too small in SFont_GetPixel. Report this to <karlb@gmx.net>");
+ if (X>=Surface->w) puts("SFONT ERROR: x too big in SFont_GetPixel. Report this to <karlb@gmx.net>");
+
+ Bpp = Surface->format->BytesPerPixel;
+
+ bits = ((Uint8 *)Surface->pixels)+Y*Surface->pitch+X*Bpp;
+
+ // Get the pixel
+ switch(Bpp) {
+ case 1:
+ return *((Uint8 *)Surface->pixels + Y * Surface->pitch + X);
+ break;
+ case 2:
+ return *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X);
+ break;
+ case 3: { // Format/endian independent
+ Uint8 r, g, b;
+ r = *((bits)+Surface->format->Rshift/8);
+ g = *((bits)+Surface->format->Gshift/8);
+ b = *((bits)+Surface->format->Bshift/8);
+ return SDL_MapRGB(Surface->format, r, g, b);
+ }
+ break;
+ case 4:
+ return *((Uint32 *)Surface->pixels + Y * Surface->pitch/4 + X);
+ break;
+ }
+
+ return -1;
+}
+
+void SFont_InitFont2(SFont_FontInfo *Font)
+{
+ int x = 0, i = 0;
+
+ if ( Font->Surface==NULL ) {
+ printf("The font has not been loaded!\n");
+ exit(1);
+ }
+
+ if (SDL_MUSTLOCK(Font->Surface)) SDL_LockSurface(Font->Surface);
+
+ while ( x < Font->Surface->w ) {
+ if(SFont_GetPixel(Font->Surface,x,0)==SDL_MapRGB(Font->Surface->format,255,0,255)) {
+ Font->CharPos[i++]=x;
+ while (( x < Font->Surface->w-1) && (SFont_GetPixel(Font->Surface,x,0)==SDL_MapRGB(Font->Surface->format,255,0,255)))
+ x++;
+ Font->CharPos[i++]=x;
+ }
+ x++;
+ }
+ if (SDL_MUSTLOCK(Font->Surface)) SDL_UnlockSurface(Font->Surface);
+
+ Font->h=Font->Surface->h;
+ SDL_SetColorKey(Font->Surface, SDL_SRCCOLORKEY, SFont_GetPixel(Font->Surface, 0, Font->Surface->h-1));
+}
+
+void SFont_InitFont(SDL_Surface *Font)
+{
+ InternalFont.Surface=Font;
+ SFont_InitFont2(&InternalFont);
+}
+
+void SFont_PutString2(SDL_Surface *Surface, SFont_FontInfo *Font, int x, int y, char *text)
+{
+ int ofs;
+ int i=0;
+ SDL_Rect srcrect,dstrect;
+
+ while (text[i]!='\0') {
+ if (text[i]==' ') {
+ x+=Font->CharPos[2]-Font->CharPos[1];
+ i++;
+ }
+ else {
+// printf("-%c- %c - %u\n",228,text[i],text[i]);
+ ofs=(text[i]-33)*2+1;
+// printf("printing %c %d\n",text[i],ofs);
+ srcrect.w = dstrect.w = (Font->CharPos[ofs+2]+Font->CharPos[ofs+1])/2-(Font->CharPos[ofs]+Font->CharPos[ofs-1])/2;
+ srcrect.h = dstrect.h = Font->Surface->h-1;
+ srcrect.x = (Font->CharPos[ofs]+Font->CharPos[ofs-1])/2;
+ srcrect.y = 1;
+ dstrect.x = x-(float)(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2;
+ dstrect.y = y;
+
+ SDL_BlitSurface( Font->Surface, &srcrect, Surface, &dstrect);
+
+ x+=Font->CharPos[ofs+1]-Font->CharPos[ofs];
+ i++;
+ }
+ }
+}
+
+void SFont_PutString(SDL_Surface *Surface, int x, int y, char *text)
+{
+ SFont_PutString2(Surface, &InternalFont, x, y, text);
+}
+
+int SFont_TextWidth2(SFont_FontInfo *Font, char *text)
+{
+ int ofs=0;
+ int i=0,x=0;
+
+ while (text[i]!='\0') {
+ if (text[i]==' ') {
+ x+=Font->CharPos[2]-Font->CharPos[1];
+ i++;
+ }
+ else {
+ ofs=(text[i]-33)*2+1;
+ x+=Font->CharPos[ofs+1]-Font->CharPos[ofs];
+ i++;
+ }
+ }
+// printf ("--%d\n",x);
+ return x;
+}
+
+int SFont_TextWidth(char *text)
+{
+ return SFont_TextWidth2(&InternalFont, text);
+}
+
+void SFont_XCenteredString2(SDL_Surface *Surface, SFont_FontInfo *Font, int y, char *text)
+{
+ SFont_PutString2(Surface, Font, Surface->w/2-SFont_TextWidth2(Font,text)/2, y, text);
+}
+
+void SFont_XCenteredString(SDL_Surface *Surface, int y, char *text)
+{
+ SFont_XCenteredString2(Surface, &InternalFont, y, text);
+}
+
+void SFont_InternalInput( SDL_Surface *Dest, SFont_FontInfo *Font, int x, int y, int PixelWidth, char *text)
+{
+ SDL_Event event;
+ int ch=-1,blink=0;
+ long blinktimer=0;
+ SDL_Surface *Back;
+ SDL_Rect rect;
+ int previous;
+// int ofs=(text[0]-33)*2+1;
+// int leftshift=(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2;
+
+ Back = SDL_AllocSurface(Dest->flags,
+ Dest->w,
+ Font->h,
+ Dest->format->BitsPerPixel,
+ Dest->format->Rmask,
+ Dest->format->Gmask,
+ Dest->format->Bmask, 0);
+ rect.x=0;
+ rect.y=y;
+ rect.w=Dest->w;
+ rect.h=Font->Surface->h;
+ SDL_BlitSurface(Dest, &rect, Back, NULL);
+ SFont_PutString2(Dest,Font,x,y,text);
+ SDL_UpdateRects(Dest, 1, &rect);
+
+ // start input
+ previous=SDL_EnableUNICODE(1);
+ blinktimer=SDL_GetTicks();
+ while (ch!=SDLK_RETURN) {
+ if (event.type==SDL_KEYDOWN) {
+ ch=event.key.keysym.unicode;
+ if (((ch>31)||(ch=='\b')) && (ch<128)) {
+ if ((ch=='\b')&&(strlen(text)>0))
+ text[strlen(text)-1]='\0';
+ else if (ch!='\b')
+ sprintf(text,"%s%c",text,ch);
+ if (SFont_TextWidth2(Font,text)>PixelWidth) text[strlen(text)-1]='\0';
+ SDL_BlitSurface( Back, NULL, Dest, &rect);
+ SFont_PutString2(Dest, Font, x, y, text);
+ SDL_UpdateRects(Dest, 1, &rect);
+// printf("%s ## %d\n",text,strlen(text));
+ SDL_WaitEvent(&event);
+ }
+ }
+ if (SDL_GetTicks()>blinktimer) {
+ blink=1-blink;
+ blinktimer=SDL_GetTicks()+500;
+ if (blink) {
+ SFont_PutString2(Dest, Font, x+SFont_TextWidth2(Font,text), y, "|");
+ SDL_UpdateRects(Dest, 1, &rect);
+// SDL_UpdateRect(Dest, x+SFont_TextWidth2(Font,text), y, SFont_TextWidth2(Font,"|"), Font->Surface->h);
+ } else {
+ SDL_BlitSurface( Back, NULL, Dest, &rect);
+ SFont_PutString2(Dest, Font, x, y, text);
+ SDL_UpdateRects(Dest, 1, &rect);
+// SDL_UpdateRect(Dest, x-(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2, y, PixelWidth, Font->Surface->h);
+ }
+ }
+ SDL_Delay(1);
+ SDL_PollEvent(&event);
+ }
+ text[strlen(text)]='\0';
+ SDL_FreeSurface(Back);
+ SDL_EnableUNICODE(previous); //restore the previous state
+}
+
+void SFont_Input2( SDL_Surface *Dest, SFont_FontInfo *Font, int x, int y, int PixelWidth, char *text)
+{
+ SFont_InternalInput( Dest, Font, x, y, PixelWidth, text);
+}
+void SFont_Input( SDL_Surface *Dest, int x, int y, int PixelWidth, char *text)
+{
+ SFont_Input2( Dest, &InternalFont, x, y, PixelWidth, text);
+}
+
+#endif
+
+MODULE = SDL::SFont PACKAGE = SDL::SFont
+PROTOTYPES : DISABLE
+
+#ifdef HAVE_SDL_IMAGE
+
+SDL_Surface *
+NewFont ( filename )
+ char *filename
+ CODE:
+ RETVAL = IMG_Load(filename);
+ SFont_InitFont(RETVAL);
+ OUTPUT:
+ RETVAL
+
+void
+UseFont ( surface )
+ SDL_Surface *surface
+ CODE:
+ SFont_InitFont(surface);
+
+void
+PutString ( surface, x, y, text )
+ SDL_Surface *surface
+ int x
+ int y
+ char *text
+ CODE:
+ SFont_PutString( surface, x, y, text );
+
+int
+TextWidth ( text )
+ char *text
+ CODE:
+ RETVAL = SFont_TextWidth(text);
+ OUTPUT:
+ RETVAL
+
+
+#endif
--- /dev/null
+//
+// Copyright (C) 2004 David J. Goehrig
+//
+//
+
+#ifndef SDL_PERL_DEFINES_H
+#define SDL_PERL_DEFINES_H
+
+#ifdef HAVE_TLS_CONTEXT
+PerlInterpreter *parent_perl = NULL;
+extern PerlInterpreter *parent_perl;
+#define GET_TLS_CONTEXT parent_perl = PERL_GET_CONTEXT;
+#define ENTER_TLS_CONTEXT \
+ PerlInterpreter *current_perl = PERL_GET_CONTEXT; \
+ PERL_SET_CONTEXT(parent_perl); { \
+ PerlInterpreter *my_perl = parent_perl;
+#define LEAVE_TLS_CONTEXT \
+ } PERL_SET_CONTEXT(current_perl);
+#else
+#define GET_TLS_CONTEXT /* TLS context not enabled */
+#define ENTER_TLS_CONTEXT /* TLS context not enabled */
+#define LEAVE_TLS_CONTEXT /* TLS context not enabled */
+#endif
+
+#endif
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::App
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+plan ( tests => 2 );
+
+use_ok( 'SDL::App' );
+
+can_ok ('SDL::App', qw/
+ new
+ resize
+ title
+ delay
+ ticks
+ error
+ warp
+ fullscreen
+ iconify
+ grab_input
+ loop
+ sync
+ attribute /);
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Cdrom
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+
+use Test::More;
+
+plan ( tests => 3 );
+
+use_ok( 'SDL::Cdrom' );
+
+can_ok ('main', qw/ CD_NUM_DRIVES /);
+
+can_ok ('SDL::Cdrom', qw/
+ new
+ name
+ status
+ play
+ pause
+ resume
+ stop
+ eject
+ id
+ num_tracks
+ track
+ current
+ current_frame /);
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Color
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+
+use Test::More;
+
+plan ( tests => 10 );
+
+use_ok( 'SDL::Color' );
+
+can_ok ('SDL::Color', qw/
+ new
+ r
+ g
+ b
+ pixel /);
+
+# some basic tests:
+
+my $color = SDL::Color->new();
+is (ref($color), 'SDL::Color', 'new was ok');
+is ($color->r(),0, 'r is 0');
+is ($color->g(),0, 'g is 0');
+is ($color->b(),0, 'b is 0');
+
+$color = SDL::Color->new( -r => 0xff, -g => 0xff, -b => 0xff);
+is (ref($color), 'SDL::Color', 'new was ok');
+is ($color->r(),255, 'r is 255');
+is ($color->g(),255, 'g is 255');
+is ($color->b(),255, 'b is 255');
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Cursor
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+
+use Test::More;
+
+plan ( tests => 2 );
+
+use_ok( 'SDL::Cursor' );
+
+can_ok ('SDL::Cursor', qw/
+ new
+ warp
+ use
+ get
+ show /);
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Event
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+
+use Test::More;
+
+plan ( tests => 2 );
+
+use_ok( 'SDL::Event' );
+
+can_ok ('SDL::Event', qw/
+ new
+ type
+ pump
+ poll
+ wait
+ set
+ set_unicode
+ set_key_repeat
+ active_gain
+ active_state
+ key_state
+ key_sym
+ key_name
+ key_mod
+ key_unicode
+ key_scancode
+ motion_state
+ motion_x
+ motion_y
+ motion_xrel
+ motion_yrel
+ button
+ button_state
+ button_x
+ button_y /);
+
+
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Font
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('SDL_image') ) {
+ plan ( tests => 2 );
+} else {
+ plan ( skip_all => 'SDL_image support not compiled' );
+}
+
+use_ok( 'SDL::Font' );
+
+can_ok ('SDL::Font', qw/ new use /);
+
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Mixer
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('SDL_mixer') ) {
+ plan ( tests => 3 );
+} else {
+ plan ( skip_all => 'SDL_mixer support not compiled' );
+}
+
+use_ok( 'SDL::Mixer' );
+
+can_ok ('SDL::Mixer', qw/
+ new
+ query_spec
+ reserve_channels
+ allocate_channels
+ group_channel
+ group_channels
+ group_available
+ group_count
+ group_oldest
+ group_newer
+ play_channel
+ play_music
+ fade_in_channel
+ fade_in_music
+ channel_volume
+ music_volume
+ halt_channel
+ halt_group
+ halt_music
+ channel_expire
+ fade_out_channel
+ fade_out_group
+ fade_out_music
+ fading_music
+ fading_channel
+ pause
+ resume
+ paused
+ pause_music
+ resume_music
+ rewind_music
+ music_paused
+ playing
+ playing_music
+ /);
+
+# these are exported by default, so main:: should know them:
+SDL::Init(SDL_INIT_AUDIO);
+my $mixer = SDL::Mixer->new();
+isa_ok($mixer, 'SDL::Mixer');
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::MPEG
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('smpeg') && SDL::Config->has('SDL_mixer') ) {
+ plan ( tests => 2 );
+} else {
+ plan ( skip_all =>
+ ( SDL::Config->has('smpeg') ? '' : ' smpeg support not compiled') .
+ ( SDL::Config->has('SDL_mixer') ? '' : ' SDL_mixer support not compiled') );
+}
+
+use_ok( 'SDL::MPEG' );
+
+can_ok ('SDL::MPEG', qw/
+ new
+ has_audio
+ has_video
+ width
+ height
+ size
+ offset
+ frame
+ fps
+ time
+ length /);
+
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Music
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+plan ( tests => 2 );
+
+use_ok( 'SDL::Music' );
+
+can_ok ('SDL::Music', qw/
+ new
+ /);
+
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::OpenGL
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('GL') && SDL::Config->has('GLU') ) {
+ plan ( tests => 3 );
+} else {
+ plan ( skip_all => 'OpenGL support not compiled' );
+}
+
+use_ok('SDL::OpenGL');
+
+can_ok('main', qw/
+ glBegin
+ glClear
+ glClearColor
+ glColor
+ glCullFace
+ glEnable
+ glEnd
+ glEvalCoord1
+ glEvalCoord2
+ glEvalMesh2
+ glFrontFace
+ glFrustum
+ glGet
+ glLight
+ glLoadIdentity
+ glMap1
+ glMap2
+ glMapGrid2
+ glMaterial
+ glMatrixMode
+ glPointSize
+ glPopMatrix
+ glPushMatrix
+ glRotate
+ glScale
+ glShadeModel
+ glTranslate
+ glVertex
+ glVertex
+ glViewport /);
+
+can_ok('main',qw/
+ gluPerspective
+ gluBeginSurface
+ gluBeginTrim
+ gluEndSurface
+ gluEndTrim
+ gluNewNurbsRenderer
+ gluNurbsCurve
+ gluNurbsProperty
+ gluNurbsSurface
+ gluPwlCurve /);
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Palette
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+
+use Test::More;
+
+plan ( tests => 2 );
+
+use_ok( 'SDL::Palette' );
+
+can_ok ('SDL::Palette', qw/
+ new
+ size
+ red
+ green
+ blue
+ color /);
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Rect
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+
+use Test::More;
+
+plan ( tests => 15 );
+
+use_ok( 'SDL::Rect' );
+
+can_ok ('SDL::Rect', qw/
+ new
+ x
+ y
+ width
+ height /);
+
+my $rect = SDL::Rect->new();
+
+# creating with defaults
+is (ref($rect),'SDL::Rect','new went ok');
+is ($rect->x(), 0, 'x is 0');
+is ($rect->y(), 0, 'y is 0');
+is ($rect->width(), 0, 'w is 0');
+is ($rect->height(), 0, 'h is 0');
+
+# set and get at the same time
+is ($rect->x(12), 12, 'x is now 12');
+is ($rect->y(123), 123, 'y is now 12');
+is ($rect->width(45), 45, 'w is now 45');
+is ($rect->height(67), 67, 'h is now 67');
+
+# get alone
+is ($rect->x(), 12, 'x is 12');
+is ($rect->y(), 123, 'y is 12');
+is ($rect->width(), 45, 'w is 45');
+is ($rect->height(), 67, 'h is 67');
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+plan ( tests => 9 );
+
+use_ok( 'SDL' );
+
+can_ok ('SDL', qw/in verify/);
+
+is (SDL::in('foo','bar'), 0, "foo isn't in ('bar')");
+is (SDL::in('foo','foo'), 1, "foo is in ('foo')");
+is (SDL::in('foo','foo','bar'), 1, "foo is in ('foo','bar')");
+is (SDL::in('foo','foo','bar','foo'), 1, "foo is once in ('foo','bar','foo')");
+is (SDL::in('foo','fab','bar'), 0, "foo isn't in ('fab','bar')");
+is (SDL::in('foo','fab',undef,'bar'), 0, "foo isn't in ('fab',undef,'bar')");
+is (SDL::in('foo','fab',undef,'foo'), 1, "foo is in ('fab',undef,'foo')");
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Sound
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+plan ( tests => 2 );
+
+use_ok( 'SDL::Sound' );
+
+can_ok ('SDL::Sound', qw/
+ new
+ volume
+ /);
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Surface
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+
+use Test::More;
+
+plan ( tests => 3 );
+
+use_ok( 'SDL::Surface' );
+
+can_ok ('SDL::Surface', qw/
+ new
+ flags
+ palette
+ bpp
+ bytes_per_pixel
+ Rshift
+ Gshift
+ Bshift
+ Ashift
+ Rmask
+ Bmask
+ Gmask
+ Amask
+ color_key
+ alpha
+ width
+ height
+ pitch
+ pixels
+ pixel
+ fill
+ lockp
+ lock
+ unlock
+ update
+ flip
+ blit
+ set_colors
+ set_color_key
+ set_alpha
+ display_format
+ rgb
+ rgba
+ print
+ save_bmp
+ video_info /);
+
+my $surface = SDL::Surface->new();
+
+isa_ok($surface,'SDL::Surface');
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Timer
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL;
+use SDL::Config;
+
+use Test::More;
+
+plan ( tests => 4 );
+
+use_ok( 'SDL::Timer' );
+
+can_ok ('SDL::Timer', qw/
+ new run stop
+ /);
+
+my $fired = 0;
+
+SDL::Init(SDL_INIT_TIMER);
+
+my $timer = new SDL::Timer
+ sub { $fired++ }, -delay => 30, -times => 1;
+
+isa_ok($timer, 'SDL::Timer');
+
+SDL::Delay(100);
+is ($fired, 1,'timer fired once');
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Tool::Font
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('SDL_image')
+ && SDL::Config->has('SDL_ttf') ) {
+ plan ( tests => 2 );
+} else {
+ plan ( skip_all =>
+ ( SDL::Config->has('SDL_image')
+ ? ''
+ : ' SDL_image support not compiled')
+ . ( SDL::Config->has('SDL_ttf')
+ ? ''
+ : ' SDL_ttf support not compiled'));
+}
+
+use_ok( 'SDL::Tool::Font' );
+
+can_ok ('SDL::Tool::Font', qw/
+ new
+ print
+ /);
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::Tool::Graphic
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('SDL_gfx') ) {
+ plan ( tests => 3 );
+} else {
+ plan ( skip_all => 'SDL_gfx support not compiled' );
+}
+
+use_ok( 'SDL::Tool::Graphic' );
+
+can_ok ('SDL::Tool::Graphic', qw/
+ new zoom rotoZoom
+ /);
+
+my $gtool = SDL::Tool::Graphic->new();
+isa_ok ($gtool, 'SDL::Tool::Graphic');
+
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::TTFont
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('SDL_ttf') ) {
+ plan ( tests => 2 );
+} else {
+ plan ( skip_all => 'SDL_ttf support not compiled' );
+}
+
+use_ok( 'SDL::TTFont' );
+
+can_ok ('SDL::TTFont', qw/
+ new
+ print
+ width
+ height
+ ascent
+ descent
+ normal
+ bold
+ italic
+ underline
+ text_shaded
+ text_solid
+ text_blended
+ utf8_shaded
+ utf8_solid
+ utf8_blended
+ unicode_shaded
+ unicode_solid
+ unicode_blended /);
--- /dev/null
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2003 Tels
+# Copyright (C) 2004 David J. Goehrig
+#
+# basic testing of SDL::VIDEO
+
+BEGIN {
+ unshift @INC, 'blib/lib','blib/arch';
+}
+
+use strict;
+use SDL::Config;
+
+use Test::More;
+
+if ( SDL::Config->has('smpeg') && SDL::Config->has('SDL_mixer') ) {
+ plan ( tests => 2 );
+} else {
+ plan ( skip_all =>
+ ( SDL::Config->has('smpeg') ? '' : ' smpeg support not compiled') .
+ ( SDL::Config->has('SDL_mixer') ? '' : ' SDL_mixer support not compiled') );
+}
+
+use_ok( 'SDL::Video' );
+
+can_ok ('SDL::Video', qw/
+ new
+ error
+ audio
+ video
+ volume
+ display
+ scale
+ play
+ pause
+ stop
+ rewind
+ seek
+ skip
+ loop
+ region
+ frame
+ info
+ status /);
+
+
--- /dev/null
+README
+
+These scripts are intended to demonstrate how
+the SDLperl OpenGL API can be used.
+
+Due to the high level nature of the perl language,
+much of the OpenGL API's complexity has been
+reduced to a lowest common denominator, that is
+to say, real numbers.
+
+Given the overhead of perl itself, hardware accleration
+is pretty much mandatory for good performance. That
+said, perl and good hardware acceleration go hand in
+hand like fine wine and delicious cheese.
+
+Descriptions:
+
+test1.pl Basic Triangle and Square
+test2.pl 3D Cube example
+test3.pl Bezier Curve example
+test4.pl Bezier Surface (wireframe & solid)
+test5.pl Nurbs Surfaces, Curves, and Trims
+
+The tutorial directory contains SDL_perl specific
+adaptations of Jeff Molofee's OpenGL tutorial examples.
+The original tutorials and accompanying C programs
+can be found at http://nehe.gamedev.net
+
+tutorial/lesson02.pl Basic Triangle and Square
+tutorial/lesson03.pl Color Triangle and Square
+tutorial/lesson04.pl Rotating Triangle and Square
+tutorial/lesson05.pl Rotating Pyramid and Cube
+tutorial/lesson06.pl Rotating Textured Cube
+tutorial/lesson07.pl Lighting and Filters Cube
+tutorial/lesson08.pl Blending (aka transperancy) Cube
+
+
--- /dev/null
+#!/usr/bin/env perl
+
+use SDL;
+use SDL::App;
+use SDL::Surface;
+use SDL::Event;
+use SDL::OpenGL;
+use SDL::OpenGL::Constants;
+
+#for ( keys %main:: ) {
+# print "$_\n";
+#}
+
+print "Starting $0\n";
+
+my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1;
+
+print "Initializing OpenGL settings\n";
+printf "%-24s%s\n", "GL_RED_SIZE ", $app->attribute( SDL_GL_RED_SIZE() );
+printf "%-24s%s\n", "GL_GREEN_SIZE ", $app->attribute( SDL_GL_GREEN_SIZE());
+printf "%-24s%s\n", "GL_BLUE_SIZE ", $app->attribute( SDL_GL_BLUE_SIZE() );
+printf "%-24s%s\n", "GL_DEPTH_SIZE ", $app->attribute( SDL_GL_DEPTH_SIZE() );
+printf "%-24s%s\n", "GL_DOUBLEBUFFER ", $app->attribute( SDL_GL_DOUBLEBUFFER() );
+
+sub DrawScene {
+
+ glClear( GL_DEPTH_BUFFER_BIT()
+ | GL_COLOR_BUFFER_BIT());
+
+ glLoadIdentity();
+
+ glTranslate(-1.5,0,-6);
+
+ glColor(1,1,1);
+
+ glBegin(GL_TRIANGLES());
+ glColor(1,0,0) if (@_);
+ glVertex(0,1,0);
+ glColor(0,1,0) if (@_);
+ glVertex(-1,-1,0);
+ glColor(0,0,1) if (@_);
+ glVertex(1,-1,0);
+ glEnd();
+
+ glTranslate(3,0,0);
+
+ glBegin(GL_QUADS());
+ glColor(1,0,0) if (@_);
+ glVertex(-1,1,0);
+ glColor(0,1,0) if (@_);
+ glVertex(1,1,0);
+ glColor(0,0,1) if (@_);
+ glVertex(1,-1,0);
+ glColor(1,1,0) if (@_);
+ glVertex(-1,-1,0);
+ glEnd();
+}
+
+sub DrawColorScene {
+ DrawScene 'with color';
+}
+
+sub InitView {
+ glViewport(0,0,800,600);
+
+ glMatrixMode(GL_PROJECTION());
+ glLoadIdentity();
+
+ if ( @_ ) {
+ gluPerspective(45.0,4/3,0.1,100.0);
+ } else {
+ glFrustum(-0.1,0.1,-0.075,0.075,0.175,100.0);
+ }
+
+ glMatrixMode(GL_MODELVIEW());
+ glLoadIdentity();
+}
+
+InitView();
+
+DrawScene();
+
+$app->sync();
+
+$toggle = 1;
+
+$app->loop( {
+ SDL_QUIT() => sub { exit(0); },
+ SDL_KEYDOWN() => sub { $toggle = ($toggle) ? 0 : 1;
+ ($toggle) ? DrawScene() : DrawColorScene();
+ $app->sync();
+ },
+ } );
--- /dev/null
+#!/usr/bin/env perl
+
+use SDL;
+use SDL::App;
+use SDL::Surface;
+use SDL::Event;
+use SDL::OpenGL;
+
+package SDL::OpenGL::Cube;
+use SDL;
+use SDL::OpenGL;
+
+my $vertex_array = pack "d24",
+ -0.5,-0.5,-0.5, 0.5,-0.5,-0.5, 0.5,0.5,-0.5, -0.5,0.5,-0.5, # back
+ -0.5,-0.5,0.5, 0.5,-0.5,0.5, 0.5,0.5,0.5, -0.5,0.5,0.5 ; # front
+
+my $indicies = pack "C24",
+ 4,5,6,7, # front
+ 1,2,6,5, # right
+ 0,1,5,4, # bottom
+ 0,3,2,1, # back
+ 0,4,7,3, # left
+ 2,3,7,6; # top
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ bless $self,$class;
+ $self;
+}
+
+sub draw {
+ my ($self) = @_;
+ $self->color();
+ glEnableClientState(GL_VERTEX_ARRAY());
+ glVertexPointer(3,GL_DOUBLE(),0,$vertex_array);
+ glDrawElements(GL_QUADS(), 24, GL_UNSIGNED_BYTE(), $indicies);
+}
+
+sub color {
+ my ($self,@colors) = @_;
+
+ if (@colors) {
+ $$self{colored} = 1;
+ die "SDL::OpenGL::Cube::color requires 24 floating point color values\n"
+ unless (scalar(@colors) == 24);
+ $$self{-colors} = pack "f24",@colors;
+ }
+
+ if ($$self{colored}) {
+ glEnableClientState(GL_COLOR_ARRAY);
+ glColorPointer(3,GL_FLOAT,0,$$self{-colors});
+ } else {
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
+}
+
+
+1;
+
+
+die "Usage: $0 delay\n Hold the space key for a white cube\n" unless (defined $ARGV[0]);
+$delay = $ARGV[0];
+
+print "Starting $0\n";
+
+my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl =>1;
+
+print "Initializing OpenGL settings\n";
+printf "%-24s%s\n", "GL_RED_SIZE ", $app->attribute( SDL_GL_RED_SIZE() );
+printf "%-24s%s\n", "GL_GREEN_SIZE ", $app->attribute( SDL_GL_GREEN_SIZE());
+printf "%-24s%s\n", "GL_BLUE_SIZE ", $app->attribute( SDL_GL_BLUE_SIZE() );
+printf "%-24s%s\n", "GL_DEPTH_SIZE ", $app->attribute( SDL_GL_DEPTH_SIZE() );
+printf "%-24s%s\n", "GL_DOUBLEBUFFER ", $app->attribute( SDL_GL_DOUBLEBUFFER() );
+
+$angle = 0;
+$other = 0;
+
+my @colors = (
+ 1.0,1.0,0.0, 1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0, #back
+ 0.4,0.4,0.4, 0.3,0.3,0.3, 0.2,0.2,0.2, 0.1,0.1,0.1 ); #front
+
+
+$cube = new SDL::OpenGL::Cube;
+$cube->color(@colors);
+
+$white = new SDL::OpenGL::Cube;
+
+$toggle = 1;
+
+glEnable(GL_CULL_FACE);
+glFrontFace(GL_CCW);
+glCullFace(GL_BACK);
+
+sub DrawScene {
+
+ glClear( GL_DEPTH_BUFFER_BIT()
+ | GL_COLOR_BUFFER_BIT());
+
+ glLoadIdentity();
+
+ glTranslate(0,0,-6.0);
+ glRotate($angle % 360,1,1,0);
+ glRotate($other % 360,0,1,1);
+
+ $angle += 6;
+ $other += $angle % 5;
+
+ glColor(1,1,1);
+ $toggle ? $cube->draw() : $white->draw();
+
+ $app->sync();
+
+}
+
+sub InitView {
+ glViewport(0,0,800,600);
+
+ glMatrixMode(GL_PROJECTION());
+ glLoadIdentity();
+
+ if ( @_ ) {
+ gluPerspective(45.0,4/3,0.1,100.0);
+ } else {
+ glFrustum(-0.1,0.1,-0.075,0.075,0.3,100.0);
+ }
+
+ glMatrixMode(GL_MODELVIEW());
+ glLoadIdentity();
+}
+
+InitView();
+
+DrawScene();
+$app->sync();
+
+my $event = new SDL::Event;
+
+for (;;) {
+ for (0 .. 5) {
+ $event->pump();
+ $event->poll();
+ exit(0) if ($event->type() == SDL_QUIT());
+ if (SDL::GetKeyState(SDLK_SPACE()) == SDL_PRESSED()) {
+ $toggle = 0;
+ } else {
+ $toggle = 1;
+ }
+ $app->delay($delay);
+ }
+ DrawScene();
+}
+
--- /dev/null
+#!/usr/bin/env perl
+#
+# Bezier Curve example
+#
+
+use SDL;
+use SDL::App;
+use SDL::Surface;
+use SDL::Event;
+use SDL::OpenGL;
+
+my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1;
+
+my @points = ( [-4.0, -4.0, 0.0 ],
+ [-2.0, 4.0, 0.0 ],
+ [ 2.0, -4.0, 0.0 ],
+ [ 4.0, 4.0, 0.0 ] );
+
+my $ctrlpoints = pack "d12", map { @$_ } @points;
+
+sub init {
+
+ glViewport(0,0,800,600);
+ glMatrixMode(GL_PROJECTION());
+ glLoadIdentity();
+
+ glFrustum (-0.1,0.1,-0.075,0.075,0.3,100.0 );
+
+ glMatrixMode(GL_MODELVIEW());
+ glLoadIdentity();
+
+ glTranslate(0,0,-30);
+
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glShadeModel(GL_FLAT());
+ glMap1(GL_MAP1_VERTEX_3(), 0.0, 1.0, 3, 4, $ctrlpoints);
+ glEnable(GL_MAP1_VERTEX_3());
+}
+
+sub display {
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColor(1.0,1.0,1.0);
+ glBegin(GL_LINE_STRIP);
+ for my $i ( 0 .. 30 ) {
+ glEvalCoord1($i/30);
+ }
+ glEnd();
+
+ glPointSize(5);
+ glColor(1.0,1.0,0);
+ glBegin(GL_POINTS);
+ for my $i ( 0 .. 3 ) {
+ glVertex( @{$points[$i]} );
+ }
+ glEnd();
+ $app->sync();
+}
+
+init();
+display();
+
+$app->loop({ SDL_QUIT() => sub { exit(); } });
+
--- /dev/null
+#!/usr/bin/env perl
+#
+# Bezier Surface example
+#
+
+use SDL;
+use SDL::App;
+use SDL::Event;
+use SDL::OpenGL;
+
+my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1;
+
+my @points = ( [-1.5, -1.5, 4.0 ], [-0.5, -1.5, 2.0 ],
+ [-0.5, -1.5, -1.0 ], [ 1.5, -1.5, 2.0 ],
+ [-1.5, -0.5, 1.0 ], [-0.5, -0.5, 3.0 ],
+ [ 0.5, -0.5, 0.0 ], [ 1.5, -0.5, -1.0 ],
+ [-1.5, 0.5, 4.0 ], [-0.5, 0.5, 0.0 ],
+ [ 0.5, 0.5, 3.0 ], [ 1.5, 0.5, 4.0 ],
+ [-1.5, 1.5, -2.0 ], [-0.5, 1.5, -2.0 ],
+ [ 0.5, 1.5, 0.0 ], [ 1.5, 1.5, -1.0 ],
+ );
+
+my $ctrlpoints = pack "d48", map { @$_ } @points;
+
+sub init {
+
+ glViewport(0,0,800,600);
+ glMatrixMode(GL_PROJECTION());
+ glLoadIdentity();
+
+ glFrustum (-0.1,0.1,-0.075,0.075,0.3,100.0 );
+
+ glMatrixMode(GL_MODELVIEW());
+ glLoadIdentity();
+
+ glTranslate(0,0,-15);
+
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glMap2(GL_MAP2_VERTEX_3(), 0, 1, 3, 4, 0, 1, 12, 4, $ctrlpoints);
+ glEnable(GL_MAP2_VERTEX_3());
+ glMapGrid2(20,0,1,20,0,1);
+ glEnable(GL_DEPTH_TEST);
+ glShadeModel(GL_SMOOTH());
+}
+
+sub initlight {
+
+ glEnable(GL_LIGHTING());
+ glEnable(GL_LIGHT0());
+
+ glLight(GL_LIGHT0(),GL_AMBIENT(),0.2,0.2,0.2,1.0);
+ glLight(GL_LIGHT0(),GL_POSITION(), 0.0,0.0,2.0,1.0);
+
+ glMaterial(GL_FRONT(), GL_DIFFUSE(),0.6,0.6,0.6,1.0);
+ glMaterial(GL_FRONT(), GL_SPECULAR(), 1.0, 1.0, 1.0, 1.0);
+ glMaterial(GL_FRONT(), GL_SHININESS(), 50.0);
+
+}
+
+my ($a1,$a2) = (89,305);
+
+sub display {
+ glClear(GL_COLOR_BUFFER_BIT() | GL_DEPTH_BUFFER_BIT());
+ glColor(1.0,1.0,1.0);
+ glPushMatrix();
+ glRotate($a1 % 360, 0.0, 1.0, 1.0);
+ glRotate($a2 % 360, 1.0, 1.0, 0.0);
+ if ($toggle) {
+ glEvalMesh2(GL_FILL,0,20,0,20);
+ } else {
+ glBegin(GL_LINE_STRIP);
+ for my $j ( 0 .. 8 ) {
+ for my $i ( 0 .. 30 ) {
+ glEvalCoord2($i/30,$j/8);
+ }
+ for my $i ( 0 .. 30 ) {
+ glEvalCoord2($j/8,$i/30);
+ }
+ }
+ glEnd();
+ }
+ glPopMatrix();
+ $app->sync();
+}
+
+print STDERR <<USAGE;
+$0
+ Press: t Toggle wireframe / solid
+ f Toggle fullscreen
+ q Quit
+ any Rotate Bezier Surface
+USAGE
+
+init();
+initlight();
+display();
+
+my $event = new SDL::Event;
+$app->loop ({
+ SDL_QUIT() => sub { exit(); },
+ SDL_KEYDOWN() => sub {
+ my ($event) = @_;
+ if ( $event->key_sym() == SDLK_f ) {
+ $app->fullscreen();
+ display();
+ } elsif ( $event->key_sym() == SDLK_t ) {
+ $toggle = $toggle ? 0 : 1;
+ display();
+ } elsif ( $event->key_sym() == SDLK_q ) {
+ exit();
+ } else {
+ $a1 += 33; $a2 += 5;
+ display();
+ }
+ },
+});
+
--- /dev/null
+#!/usr/bin/env perl
+#
+# Bezier Surface example
+#
+
+use SDL;
+use SDL::App;
+use SDL::Event;
+use SDL::OpenGL;
+
+my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1;
+
+my $knots = pack "f8", 0,0,0,0,1,1,1,1;
+my $edgePts = pack "f10", 0,0,1,0,1,1,0,1,0,0;
+my $curvePts = pack "f8", 0.25,0.5,0.25,0.75,0.75,0.75,0.75,0.5;
+my $curveKnots = pack "f8", 0,0,0,0,1,1,1,1;
+my $pwlPts = pack "f8", 0.75, 0.5, 0.5, 0.25, 0.25, 0.5, 0, 0;
+
+sub init {
+ glViewport(0,0,800,600);
+ glMatrixMode(GL_PROJECTION());
+ glLoadIdentity();
+ glFrustum (-0.1,0.1,-0.075,0.075,0.3,100.0 );
+ glMatrixMode(GL_MODELVIEW());
+ glLoadIdentity();
+ glTranslate(0,0,-15);
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glShadeModel(GL_SMOOTH());
+}
+
+sub initlight {
+ glEnable(GL_LIGHTING());
+ glEnable(GL_LIGHT0());
+ glEnable(GL_DEPTH_TEST());
+ glEnable(GL_AUTO_NORMAL());
+ glEnable(GL_NORMALIZE());
+ glLight(GL_LIGHT0(),GL_AMBIENT(),0.3,0.3,0.3,1.0);
+ glLight(GL_LIGHT0(),GL_POSITION(), 1.0,0.0,2.0,1.0);
+ glMaterial(GL_FRONT(), GL_DIFFUSE(),0.6,0.6,0.6,1.0);
+ glMaterial(GL_FRONT(), GL_SPECULAR(), 1.0, 1.0, 1.0, 1.0);
+ glMaterial(GL_FRONT(), GL_SHININESS(), 40.0);
+}
+
+my ($a,$b) = (0,90);
+
+my $ctrldata;
+sub initpts {
+ my @points;
+ for my $u ( 0 .. 3 ) {
+ for my $v ( 0 .. 3 ) {
+ push @points, 2.0 * ($u - 1.5);
+ push @points, 2.0 * ($v - 1.5);
+ if (( $u == 1 || $u == 2 ) && ( $v == 1 || $v == 2 )) {
+ push @points, 3.0;
+ } else {
+ push @points, -3.0;
+ }
+ }
+ }
+ $ctrldata = pack "f48", @points;
+}
+
+sub display {
+ glClear(GL_COLOR_BUFFER_BIT() | GL_DEPTH_BUFFER_BIT());
+ glPushMatrix();
+ glRotate($a%360,0,1,0);
+ glRotate($b%360,-1,0,0);
+ glScale(0.5,0.5,0.5);
+ $nurb = gluNewNurbsRenderer();
+ gluNurbsProperty($nurb,GLU_CULLING,GL_TRUE);
+ gluBeginSurface($nurb);
+ gluNurbsSurface($nurb, 8, $knots, 8, $knots,
+ 4*3, 3, $ctrldata,
+ 4, 4, GL_MAP2_VERTEX_3);
+ if ($toggle) {
+ gluBeginTrim($nurb);
+ gluPwlCurve($nurb,5,$edgePts,2,GLU_MAP1_TRIM_2);
+ gluEndTrim($nurb);
+ gluBeginTrim($nurb);
+ gluNurbsCurve($nurb,8,$curveKnots, 2, $curvePts, 4, GLU_MAP1_TRIM_2);
+ gluPwlCurve($nurb,3,$pwlPts,2,GLU_MAP1_TRIM_2);
+ gluEndTrim($nurb);
+ }
+
+ gluEndSurface($nurb);
+
+ glPopMatrix();
+ $app->sync();
+}
+
+init();
+initlight();
+initpts();
+display();
+
+print STDERR <<USAGE;
+Press:
+q Quit
+t Toggle Curve & Trim
+f Toggle Fullscreen
+Up/Down/Left/Right Rotate
+
+USAGE
+
+my $event = new SDL::Event;
+$app->loop ({
+ SDL_QUIT() => sub { exit(); },
+ SDL_KEYDOWN() => sub {
+ my ($event) = @_;
+ if ( $event->key_sym() == SDLK_f ) {
+ $app->fullscreen();
+ display();
+ } elsif ( $event->key_sym() == SDLK_t ) {
+ $toggle = $toggle ? 0 : 1;
+ display();
+ } elsif ( $event->key_sym() == SDLK_q ) {
+ exit();
+ } else {
+ if ($event->key_sym() == SDLK_LEFT()) {
+ $a -= 10;
+ } elsif ($event->key_sym() == SDLK_RIGHT()) {
+ $a += 10;
+ } elsif ($event->key_sym() == SDLK_UP()) {
+ $b += 10;
+ } elsif ($event->key_sym() == SDLK_DOWN()) {
+ $b -= 10;
+ }
+ display();
+ }
+ },
+});
+
--- /dev/null
+
+NUMPOLLIES 36
+
+// Floor 1
+-3.0 0.0 -3.0 0.0 6.0
+-3.0 0.0 3.0 0.0 0.0
+ 3.0 0.0 3.0 6.0 0.0
+
+-3.0 0.0 -3.0 0.0 6.0
+ 3.0 0.0 -3.0 6.0 6.0
+ 3.0 0.0 3.0 6.0 0.0
+
+// Ceiling 1
+-3.0 1.0 -3.0 0.0 6.0
+-3.0 1.0 3.0 0.0 0.0
+ 3.0 1.0 3.0 6.0 0.0
+-3.0 1.0 -3.0 0.0 6.0
+ 3.0 1.0 -3.0 6.0 6.0
+ 3.0 1.0 3.0 6.0 0.0
+
+// A1
+
+-2.0 1.0 -2.0 0.0 1.0
+-2.0 0.0 -2.0 0.0 0.0
+-0.5 0.0 -2.0 1.5 0.0
+-2.0 1.0 -2.0 0.0 1.0
+-0.5 1.0 -2.0 1.5 1.0
+-0.5 0.0 -2.0 1.5 0.0
+
+// A2
+
+ 2.0 1.0 -2.0 2.0 1.0
+ 2.0 0.0 -2.0 2.0 0.0
+ 0.5 0.0 -2.0 0.5 0.0
+ 2.0 1.0 -2.0 2.0 1.0
+ 0.5 1.0 -2.0 0.5 1.0
+ 0.5 0.0 -2.0 0.5 0.0
+
+// B1
+
+-2.0 1.0 2.0 2.0 1.0
+-2.0 0.0 2.0 2.0 0.0
+-0.5 0.0 2.0 0.5 0.0
+-2.0 1.0 2.0 2.0 1.0
+-0.5 1.0 2.0 0.5 1.0
+-0.5 0.0 2.0 0.5 0.0
+
+// B2
+
+ 2.0 1.0 2.0 2.0 1.0
+ 2.0 0.0 2.0 2.0 0.0
+ 0.5 0.0 2.0 0.5 0.0
+ 2.0 1.0 2.0 2.0 1.0
+ 0.5 1.0 2.0 0.5 1.0
+ 0.5 0.0 2.0 0.5 0.0
+
+// C1
+
+-2.0 1.0 -2.0 0.0 1.0
+-2.0 0.0 -2.0 0.0 0.0
+-2.0 0.0 -0.5 1.5 0.0
+-2.0 1.0 -2.0 0.0 1.0
+-2.0 1.0 -0.5 1.5 1.0
+-2.0 0.0 -0.5 1.5 0.0
+
+// C2
+
+-2.0 1.0 2.0 2.0 1.0
+-2.0 0.0 2.0 2.0 0.0
+-2.0 0.0 0.5 0.5 0.0
+-2.0 1.0 2.0 2.0 1.0
+-2.0 1.0 0.5 0.5 1.0
+-2.0 0.0 0.5 0.5 0.0
+
+// D1
+
+2.0 1.0 -2.0 0.0 1.0
+2.0 0.0 -2.0 0.0 0.0
+2.0 0.0 -0.5 1.5 0.0
+2.0 1.0 -2.0 0.0 1.0
+2.0 1.0 -0.5 1.5 1.0
+2.0 0.0 -0.5 1.5 0.0
+
+// D2
+
+2.0 1.0 2.0 2.0 1.0
+2.0 0.0 2.0 2.0 0.0
+2.0 0.0 0.5 0.5 0.0
+2.0 1.0 2.0 2.0 1.0
+2.0 1.0 0.5 0.5 1.0
+2.0 0.0 0.5 0.5 0.0
+
+// Upper hallway - L
+-0.5 1.0 -3.0 0.0 1.0
+-0.5 0.0 -3.0 0.0 0.0
+-0.5 0.0 -2.0 1.0 0.0
+-0.5 1.0 -3.0 0.0 1.0
+-0.5 1.0 -2.0 1.0 1.0
+-0.5 0.0 -2.0 1.0 0.0
+
+// Upper hallway - R
+0.5 1.0 -3.0 0.0 1.0
+0.5 0.0 -3.0 0.0 0.0
+0.5 0.0 -2.0 1.0 0.0
+0.5 1.0 -3.0 0.0 1.0
+0.5 1.0 -2.0 1.0 1.0
+0.5 0.0 -2.0 1.0 0.0
+
+// Lower hallway - L
+-0.5 1.0 3.0 0.0 1.0
+-0.5 0.0 3.0 0.0 0.0
+-0.5 0.0 2.0 1.0 0.0
+-0.5 1.0 3.0 0.0 1.0
+-0.5 1.0 2.0 1.0 1.0
+-0.5 0.0 2.0 1.0 0.0
+
+// Lower hallway - R
+0.5 1.0 3.0 0.0 1.0
+0.5 0.0 3.0 0.0 0.0
+0.5 0.0 2.0 1.0 0.0
+0.5 1.0 3.0 0.0 1.0
+0.5 1.0 2.0 1.0 1.0
+0.5 0.0 2.0 1.0 0.0
+
+
+// Left hallway - Lw
+
+-3.0 1.0 0.5 1.0 1.0
+-3.0 0.0 0.5 1.0 0.0
+-2.0 0.0 0.5 0.0 0.0
+-3.0 1.0 0.5 1.0 1.0
+-2.0 1.0 0.5 0.0 1.0
+-2.0 0.0 0.5 0.0 0.0
+
+// Left hallway - Hi
+
+-3.0 1.0 -0.5 1.0 1.0
+-3.0 0.0 -0.5 1.0 0.0
+-2.0 0.0 -0.5 0.0 0.0
+-3.0 1.0 -0.5 1.0 1.0
+-2.0 1.0 -0.5 0.0 1.0
+-2.0 0.0 -0.5 0.0 0.0
+
+// Right hallway - Lw
+
+3.0 1.0 0.5 1.0 1.0
+3.0 0.0 0.5 1.0 0.0
+2.0 0.0 0.5 0.0 0.0
+3.0 1.0 0.5 1.0 1.0
+2.0 1.0 0.5 0.0 1.0
+2.0 0.0 0.5 0.0 0.0
+
+// Right hallway - Hi
+
+3.0 1.0 -0.5 1.0 1.0
+3.0 0.0 -0.5 1.0 0.0
+2.0 0.0 -0.5 0.0 0.0
+3.0 1.0 -0.5 1.0 1.0
+2.0 1.0 -0.5 0.0 1.0
+2.0 0.0 -0.5 0.0 0.0
\ No newline at end of file
--- /dev/null
+#!/usr/bin/perl -w
+# This code was created by Jeff Molofee '99
+# (ported to SDL by Sam Lantinga '2000)
+# (ported to Perl/SDL by Wayne Keenan '2000)
+#
+# If you've found this code useful, please let me know.
+#
+# Visit me at www.demonews.com/hosted/nehe
+
+use strict;
+use Getopt::Long;
+
+use SDL;
+use SDL::App;
+use SDL::OpenGL;
+use SDL::Event;
+
+my $arg_screen_width =640;
+my $arg_screen_height=512;
+my $arg_fullscreen=0;
+
+GetOptions(
+ "width:i" => \$arg_screen_width,
+ "height:i" => \$arg_screen_height,
+ "fullscreen!" => \$arg_fullscreen,
+
+ ) or die $!;
+
+main();
+exit;
+
+
+sub main
+ {
+ my $done=0;
+
+ my $app = new SDL::App ( -title => "Jeff Molofee's GL Code Tutorial ... NeHe '99",
+ -icon => "icon.png",
+ -width => $arg_screen_width,
+ -height =>$arg_screen_height,
+ -d => 16,
+ -gl => 1,
+
+ );
+ $app->fullscreen() if ($arg_fullscreen);
+
+ SDL::ShowCursor (0);
+
+ my $event = new SDL::Event;
+ $event->set(SDL_SYSWMEVENT,SDL_IGNORE);#
+
+ InitGL($arg_screen_width, $arg_screen_height);
+
+ while ( ! $done ) {
+
+ DrawGLScene();
+
+ $app->sync();
+
+ $event->pump;
+ $event->poll;
+
+
+ if ( $event->type == SDL_QUIT ) {
+ $done = 1;
+ }
+
+ if ( $event->type == SDL_KEYDOWN ) {
+ if ( $event->key_sym == SDLK_ESCAPE ) {
+ $done = 1;
+ }
+ }
+ }
+ }
+
+
+
+
+
+
+#########################################################################
+#Pretty much in original form, but 'Perlised'
+
+
+sub InitGL
+ {
+ my ($Width, $Height)=@_;
+
+ glViewport(0, 0, $Width, $Height);
+ glClearColor(0.0, 0.0, 0.0, 0.0); # This Will Clear The Background Color To Black
+ glClearDepth(1.0); # Enables Clearing Of The Depth Buffer
+ glDepthFunc(GL_LESS()); # The Type Of Depth Test To Do
+ glEnable(GL_DEPTH_TEST()); # Enables Depth Testing
+ glShadeModel(GL_SMOOTH()); # Enables Smooth Color Shading
+
+ glMatrixMode(GL_PROJECTION());
+ glLoadIdentity(); # Reset The Projection Matrix
+
+ gluPerspective(45.0, $Width/$Height, 0.1, 100.0); # Calculate The Aspect Ratio Of The Window
+
+ glMatrixMode(GL_MODELVIEW());
+ }
+
+
+
+# The main drawing function.
+sub DrawGLScene
+ {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Clear The Screen And The Depth Buffer
+ glLoadIdentity(); # Reset The View
+
+ glTranslate(-1.5,0.0,-6.0); # Move Left 1.5 Units And Into The Screen 6.0
+
+ # draw a triangle
+ glBegin(GL_POLYGON); # start drawing a polygon
+ glVertex( 0.0, 1.0, 0.0); # Top
+ glVertex( 1.0,-1.0, 0.0); # Bottom Right
+ glVertex(-1.0,-1.0, 0.0); # Bottom Left
+ glEnd(); # we're done with the polygon
+
+ glTranslate(3.0,0.0,0.0); # Move Right 3 Units
+
+ # draw a square (quadrilateral)
+ glBegin(GL_QUADS); # start drawing a polygon (4 sided)
+ glVertex(-1.0, 1.0, 0.0); # Top Left
+ glVertex( 1.0, 1.0, 0.0); # Top Right
+ glVertex( 1.0,-1.0, 0.0); # Bottom Right
+ glVertex(-1.0,-1.0, 0.0); # Bottom Left
+ glEnd(); # done with the polygon
+
+
+ }
+
+
+
+
--- /dev/null
+#!/usr/bin/perl -w
+# This code was created by Jeff Molofee '99
+# (ported to SDL by Sam Lantinga '2000)
+# (ported to Perl/SDL by Wayne Keenan '2000)
+#
+# If you've found this code useful, please let me know.
+#
+# Visit me at www.demonews.com/hosted/nehe
+
+use strict;
+use Getopt::Long;
+
+use SDL;
+use SDL::App;
+use SDL::OpenGL;
+use SDL::Event;
+
+my $arg_screen_width =640;
+my $arg_screen_height=512;
+my $arg_fullscreen=0;
+
+GetOptions(
+ "width:i" => \$arg_screen_width,
+ "height:i" => \$arg_screen_height,
+ "fullscreen!" => \$arg_fullscreen,
+ ) or die $!;
+
+main();
+exit;
+
+
+sub main
+ {
+ my $done=0;
+
+ my $app = new SDL::App ( -title => "Jeff Molofee's GL Code Tutorial ... NeHe '99",
+ -icon => "icon.png",
+ -width => $arg_screen_width,
+ -height =>$arg_screen_height,
+ -d => 16,
+ -opengl => 1,
+ );
+ $app->fullscreen() if $arg_fullscreen;
+
+ SDL::ShowCursor(0);
+
+ my $event = new SDL::Event;
+ $event->set(SDL_SYSWMEVENT,SDL_IGNORE);#
+
+
+
+ InitGL($arg_screen_width, $arg_screen_height);
+
+ while ( ! $done ) {
+
+ DrawGLScene();
+
+ $app->sync();
+
+ $event->pump;
+ $event->poll;
+
+
+ if ( $event->type == SDL_QUIT ) {
+ $done = 1;
+ }
+
+ if ( $event->type == SDL_KEYDOWN ) {
+ if ( $event->key_sym == SDLK_ESCAPE ) {
+ $done = 1;
+ }
+ }
+ }
+ }
+
+
+
+
+
+
+#########################################################################
+#Pretty much in original form, but 'Perlised'
+
+
+sub InitGL
+ {
+ my ($Width, $Height)=@_;
+
+ glViewport(0, 0, $Width, $Height);
+ glClearColor(0.0, 0.0, 0.0, 0.0); # This Will Clear The Background Color To Black
+ glClearDepth(1.0); # Enables Clearing Of The Depth Buffer
+ glDepthFunc(GL_LESS); # The Type Of Depth Test To Do
+ glEnable(GL_DEPTH_TEST); # Enables Depth Testing
+ glShadeModel(GL_SMOOTH); # Enables Smooth Color Shading
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity(); # Reset The Projection Matrix
+
+ gluPerspective(45.0, $Width/$Height, 0.1, 100.0); # Calculate The Aspect Ratio Of The Window
+
+ glMatrixMode(GL_MODELVIEW);
+ }
+
+
+
+# The main drawing function.
+sub DrawGLScene
+ {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Clear The Screen And The Depth Buffer
+ glLoadIdentity(); # Reset The View
+
+ glTranslate(-1.5,0.0,-6.0); # Move Left 1.5 Units And Into The Screen 6.0
+
+ # draw a triangle (in smooth coloring mode)
+ glBegin(GL_POLYGON); # start drawing a polygon
+ glColor(1.0,0.0,0.0); # Set The Color To Red
+ glVertex( 0.0, 1.0, 0.0); # Top
+ glColor(0.0,1.0,0.0); # Set The Color To Green
+ glVertex( 1.0,-1.0, 0.0); # Bottom Right
+ glColor(0.0,0.0,1.0); # Set The Color To Blue
+ glVertex(-1.0,-1.0, 0.0); # Bottom Left
+ glEnd(); # we're done with the polygon (smooth color interpolation)
+
+ glTranslate(3.0,0.0,0.0); # Move Right 3 Units
+
+ # draw a square (quadrilateral)
+ glColor(0.5,0.5,1.0); # set color to a blue shade.
+ glBegin(GL_QUADS); # start drawing a polygon (4 sided)
+ glVertex(-1.0, 1.0, 0.0); # Top Left
+ glVertex( 1.0, 1.0, 0.0); # Top Right
+ glVertex( 1.0,-1.0, 0.0); # Bottom Right
+ glVertex(-1.0,-1.0, 0.0); # Bottom Left
+ glEnd(); # done with the polygon
+
+
+
+
+ }
+
+
+
+
--- /dev/null
+#!/usr/bin/perl -w
+# This code was created by Jeff Molofee '99
+# (ported to SDL by Sam Lantinga '2000)
+# (ported to Perl/SDL by Wayne Keenan '2000)
+#
+# If you've found this code useful, please let me know.
+#
+# Visit me at www.demonews.com/hosted/nehe
+
+use strict;
+use Getopt::Long;
+
+use SDL;
+use SDL::App;
+use SDL::OpenGL;
+use SDL::Event;
+
+my $arg_screen_width =640;
+my $arg_screen_height=512;
+my $arg_fullscreen=0;
+my $delay=30;
+
+GetOptions(
+ "width:i" => \$arg_screen_width,
+ "height:i" => \$arg_screen_height,
+ "fullscreen!" => \$arg_fullscreen,
+ "delay:i" => \$delay,
+ ) or die <<USAGE;
+Usage $0 -w 800 -h 600 -d 10 --fullscreen
+USAGE
+
+#/* rotation angle for the triangle. */
+my $rtri = 0.0;
+
+#/* rotation angle for the quadrilateral. */
+my $rquad = 0.0;
+
+
+main();
+exit;
+
+
+sub main
+ {
+ my $done=0;
+ my $app = new SDL::App ( -title => "Jeff Molofee's GL Code Tutorial ... NeHe '99",
+ -icon => "icon.png",
+ -width => $arg_screen_width,
+ -height =>$arg_screen_height,
+ -gl => 1,
+ );
+ $app->fullscreen() if $arg_fullscreen;
+
+ SDL::ShowCursor(0);
+
+ my $event = new SDL::Event;
+ $event->set(SDL_SYSWMEVENT,SDL_IGNORE);#
+
+
+
+ InitGL($arg_screen_width, $arg_screen_height);
+
+ while ( ! $done ) {
+
+ DrawGLScene();
+
+ $app->sync();
+ $app->delay($delay);
+
+ $event->pump;
+ $event->poll;
+
+
+ if ( $event->type == SDL_QUIT ) {
+ $done = 1;
+ }
+
+ if ( $event->type == SDL_KEYDOWN ) {
+ if ( $event->key_sym == SDLK_ESCAPE ) {
+ $done = 1;
+ }
+ }
+ }
+ }
+
+
+
+
+
+
+#########################################################################
+#Pretty much in original form, but 'Perlised'
+
+
+
+
+
+sub InitGL
+ {
+ my ($Width, $Height)=@_;
+
+ glViewport(0, 0, $Width, $Height);
+ glClearColor(0.0, 0.0, 0.0, 0.0); # This Will Clear The Background Color To Black
+ glClearDepth(1.0); # Enables Clearing Of The Depth Buffer
+ glDepthFunc(GL_LESS); # The Type Of Depth Test To Do
+ glEnable(GL_DEPTH_TEST); # Enables Depth Testing
+ glShadeModel(GL_SMOOTH); # Enables Smooth Color Shading
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity(); # Reset The Projection Matrix
+
+ gluPerspective(45.0, $Width/$Height, 0.1, 100.0); # Calculate The Aspect Ratio Of The Window
+
+ glMatrixMode(GL_MODELVIEW);
+ }
+
+
+
+# The main drawing function.
+sub DrawGLScene
+ {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Clear The Screen And The Depth Buffer
+ glLoadIdentity(); # Reset The View
+
+ glTranslate(-1.5,0.0,-6.0); # Move Left 1.5 Units And Into The Screen 6.0
+
+ glRotate($rtri,0.0,1.0,0.0); # Rotate The Triangle On The Y axis
+ # draw a triangle (in smooth coloring mode)
+ glBegin(GL_POLYGON); # start drawing a polygon
+ glColor(1.0,0.0,0.0); # Set The Color To Red
+ glVertex( 0.0, 1.0, 0.0); # Top
+ glColor(0.0,1.0,0.0); # Set The Color To Green
+ glVertex( 1.0,-1.0, 0.0); # Bottom Right
+ glColor(0.0,0.0,1.0); # Set The Color To Blue
+ glVertex(-1.0,-1.0, 0.0); # Bottom Left
+ glEnd(); # we're done with the polygon (smooth color interpolation)
+
+ glLoadIdentity(); # make sure we're no longer rotated.
+ glTranslate(1.5,0.0,-6.0); # Move Right 3 Units, and back into the screen 6.0
+
+ glRotate($rquad,1.0,0.0,0.0); # Rotate The Quad On The X axis
+ # draw a square (quadrilateral)
+ glColor(0.5,0.5,1.0); # set color to a blue shade.
+ glBegin(GL_QUADS); # start drawing a polygon (4 sided)
+ glVertex(-1.0, 1.0, 0.0); # Top Left
+ glVertex( 1.0, 1.0, 0.0); # Top Right
+ glVertex( 1.0,-1.0, 0.0); # Bottom Right
+ glVertex(-1.0,-1.0, 0.0); # Bottom Left
+ glEnd(); # done with the polygon
+
+ $rtri+=15.0; # Increase The Rotation Variable For The Triangle
+ $rquad-=15.0; # Decrease The Rotation Variable For The Quad
+
+
+ }
+
+
+
+
--- /dev/null
+#!/usr/bin/perl
+# This code was created by Jeff Molofee '99
+# (ported to SDL by Sam Lantinga '2000)
+# (ported to Perl/SDL by Wayne Keenan '2000)
+#
+# If you've found this code useful, please let me know.
+#
+# Visit me at www.demonews.com/hosted/nehe
+
+use strict;
+use Getopt::Long;
+
+use SDL;
+use SDL::App;
+use SDL::OpenGL;
+use SDL::Event;
+use SDL::Cursor;
+
+my $arg_screen_width =640;
+my $arg_screen_height=512;
+my $arg_fullscreen=0;
+my $delay = 30;
+
+GetOptions(
+ "width:i" => \$arg_screen_width,
+ "height:i" => \$arg_screen_height,
+ "fullscreen!" => \$arg_fullscreen,
+ "delay:i" => \$delay,
+ ) or die $!;
+
+main();
+exit;
+
+
+sub main
+ {
+ my $done=0;
+
+ my $app = new SDL::App ( -title => "Jeff Molofee's GL Code Tutorial ... NeHe '99",
+ -icon => "icon.png",
+ -width => $arg_screen_width,
+ -height =>$arg_screen_height,
+ -opengl => 1,
+ );
+
+ $app->fullscreen if ($arg_fullscreen);
+
+ SDL::ShowCursor(0);
+
+ my $event = new SDL::Event;
+ $event->set(SDL_SYSWMEVENT(),SDL_IGNORE());#
+
+ InitGL($arg_screen_width, $arg_screen_height);
+
+ while ( ! $done ) {
+
+ DrawGLScene();
+
+ $app->sync();
+ $app->delay($delay);
+
+ $event->pump;
+ $event->poll;
+
+
+ if ( $event->type == SDL_QUIT() ) {
+ $done = 1;
+ }
+
+ if ( $event->type == SDL_KEYDOWN() ) {
+ if ( $event->key_sym == SDLK_ESCAPE() ) {
+ $done = 1;
+ }
+ }
+ }
+ }
+
+
+
+
+
+
+#########################################################################
+#Pretty much in original form, but 'Perlised'
+
+
+
+#/* rotation angle for the triangle. */
+my $rtri = 0.0;
+
+#/* rotation angle for the quadrilateral. */
+my $rquad = 0.0;
+
+
+sub InitGL
+ {
+ my ($Width, $Height)=@_;
+
+ glViewport(0, 0, $Width, $Height);
+ glClearColor(0.0, 0.0, 0.0, 0.0); # This Will Clear The Background Color To Black
+ glClearDepth(1.0); # Enables Clearing Of The Depth Buffer
+ glDepthFunc(GL_LESS); # The Type Of Depth Test To Do
+ glEnable(GL_DEPTH_TEST); # Enables Depth Testing
+ glShadeModel(GL_SMOOTH); # Enables Smooth Color Shading
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity(); # Reset The Projection Matrix
+
+ gluPerspective(45.0, $Width/$Height, 0.1, 100.0); # Calculate The Aspect Ratio Of The Window
+
+ glMatrixMode(GL_MODELVIEW);
+ }
+
+
+
+# The main drawing function.
+sub DrawGLScene
+ {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Clear The Screen And The Depth Buffer
+ glLoadIdentity(); # Reset The View
+
+ glTranslate(-1.5,0.0,-6.0); # Move Left 1.5 Units And Into The Screen 6.0
+
+ glRotate($rtri,0.0,1.0,0.0); # Rotate The Pyramid On The Y axis
+
+ # draw a pyramid (in smooth coloring mode)
+ glBegin(GL_POLYGON); # start drawing a pyramid
+
+ # front face of pyramid
+ glColor(1.0,0.0,0.0); # Set The Color To Red
+ glVertex(0.0, 1.0, 0.0); # Top of triangle (front)
+ glColor(0.0,1.0,0.0); # Set The Color To Green
+ glVertex(-1.0,-1.0, 1.0); # left of triangle (front)
+ glColor(0.0,0.0,1.0); # Set The Color To Blue
+ glVertex(1.0,-1.0, 1.0); # right of traingle (front)
+
+ # right face of pyramid
+ glColor(1.0,0.0,0.0); # Red
+ glVertex( 0.0, 1.0, 0.0); # Top Of Triangle (Right)
+ glColor(0.0,0.0,1.0); # Blue
+ glVertex( 1.0,-1.0, 1.0); # Left Of Triangle (Right)
+ glColor(0.0,1.0,0.0); # Green
+ glVertex( 1.0,-1.0, -1.0); # Right Of Triangle (Right)
+
+ # back face of pyramid
+ glColor(1.0,0.0,0.0); # Red
+ glVertex( 0.0, 1.0, 0.0); # Top Of Triangle (Back)
+ glColor(0.0,1.0,0.0); # Green
+ glVertex( 1.0,-1.0, -1.0); # Left Of Triangle (Back)
+ glColor(0.0,0.0,1.0); # Blue
+ glVertex(-1.0,-1.0, -1.0); # Right Of Triangle (Back)
+
+ # left face of pyramid.
+ glColor(1.0,0.0,0.0); # Red
+ glVertex( 0.0, 1.0, 0.0); # Top Of Triangle (Left)
+ glColor(0.0,0.0,1.0); # Blue
+ glVertex(-1.0,-1.0,-1.0); # Left Of Triangle (Left)
+ glColor(0.0,1.0,0.0); # Green
+ glVertex(-1.0,-1.0, 1.0); # Right Of Triangle (Left)
+
+ glEnd(); # Done Drawing The Pyramid
+
+ glLoadIdentity(); # make sure we're no longer rotated.
+ glTranslate(1.5,0.0,-7.0); # Move Right 3 Units, and back into the screen 7
+
+ glRotate($rquad,1.0,1.0,1.0); # Rotate The Cube On X, Y, and Z
+
+ # draw a cube (6 quadrilaterals)
+ glBegin(GL_QUADS); # start drawing the cube.
+
+ # top of cube
+ glColor(0.0,1.0,0.0); # Set The Color To Blue
+ glVertex( 1.0, 1.0,-1.0); # Top Right Of The Quad (Top)
+ glVertex(-1.0, 1.0,-1.0); # Top Left Of The Quad (Top)
+ glVertex(-1.0, 1.0, 1.0); # Bottom Left Of The Quad (Top)
+ glVertex( 1.0, 1.0, 1.0); # Bottom Right Of The Quad (Top)
+
+ # bottom of cube
+ glColor(1.0,0.5,0.0); # Set The Color To Orange
+ glVertex( 1.0,-1.0, 1.0); # Top Right Of The Quad (Bottom)
+ glVertex(-1.0,-1.0, 1.0); # Top Left Of The Quad (Bottom)
+ glVertex(-1.0,-1.0,-1.0); # Bottom Left Of The Quad (Bottom)
+ glVertex( 1.0,-1.0,-1.0); # Bottom Right Of The Quad (Bottom)
+
+ # front of cube
+ glColor(1.0,0.0,0.0); # Set The Color To Red
+ glVertex( 1.0, 1.0, 1.0); # Top Right Of The Quad (Front)
+ glVertex(-1.0, 1.0, 1.0); # Top Left Of The Quad (Front)
+ glVertex(-1.0,-1.0, 1.0); # Bottom Left Of The Quad (Front)
+ glVertex( 1.0,-1.0, 1.0); # Bottom Right Of The Quad (Front)
+
+ # back of cube.
+ glColor(1.0,1.0,0.0); # Set The Color To Yellow
+ glVertex( 1.0,-1.0,-1.0); # Top Right Of The Quad (Back)
+ glVertex(-1.0,-1.0,-1.0); # Top Left Of The Quad (Back)
+ glVertex(-1.0, 1.0,-1.0); # Bottom Left Of The Quad (Back)
+ glVertex( 1.0, 1.0,-1.0); # Bottom Right Of The Quad (Back)
+
+ # left of cube
+ glColor(0.0,0.0,1.0); # Blue
+ glVertex(-1.0, 1.0, 1.0); # Top Right Of The Quad (Left)
+ glVertex(-1.0, 1.0,-1.0); # Top Left Of The Quad (Left)
+ glVertex(-1.0,-1.0,-1.0); # Bottom Left Of The Quad (Left)
+ glVertex(-1.0,-1.0, 1.0); # Bottom Right Of The Quad (Left)
+
+ # Right of cube
+ glColor(1.0,0.0,1.0); # Set The Color To Violet
+ glVertex( 1.0, 1.0,-1.0); # Top Right Of The Quad (Right)
+ glVertex( 1.0, 1.0, 1.0); # Top Left Of The Quad (Right)
+ glVertex( 1.0,-1.0, 1.0); # Bottom Left Of The Quad (Right)
+ glVertex( 1.0,-1.0,-1.0); # Bottom Right Of The Quad (Right)
+ glEnd(); # Done Drawing The Cube
+
+ $rtri+=15.0; # Increase The Rotation Variable For The Triangle
+ $rquad-=15.0; # Decrease The Rotation Variable For The Quad
+
+
+ }
+
+
+
+
--- /dev/null
+#!/usr/bin/perl -w
+# This code was created by Jeff Molofee '99
+# (ported to SDL by Sam Lantinga '2000)
+# (ported to Perl/SDL by Wayne Keenan '2000)
+#
+# If you've found this code useful, please let me know.
+#
+# Visit me at www.demonews.com/hosted/nehe
+
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+use Benchmark;
+
+use SDL;
+use SDL::App;
+use SDL::OpenGL;
+use SDL::Event;
+
+my $arg_screen_width =640;
+my $arg_screen_height=512;
+my $arg_fullscreen=0;
+my $delay = 3;
+
+GetOptions(
+ "width:i" => \$arg_screen_width,
+ "height:i" => \$arg_screen_height,
+ "fullscreen!" => \$arg_fullscreen,
+ "delay:i" => \$delay,
+
+ ) or die $!;
+
+############################################################
+
+my ($xrot, $yrot, $zrot) = (0,0,0);
+
+main();
+exit;
+
+
+sub main
+ {
+ my $done=0;
+
+ my $app = new SDL::App ( -title => "Jeff Molofee's GL Code Tutorial ... NeHe '99",
+ -icon => "Data/perl.png",
+ -width => $arg_screen_width,
+ -height =>$arg_screen_height,
+ -opengl => 1,
+ );
+ $app->fullscreen() if $arg_fullscreen;
+
+ SDL::ShowCursor(0);
+
+ my $event = new SDL::Event;
+ $event->set(SDL_SYSWMEVENT,SDL_IGNORE);
+
+ InitGL($arg_screen_width, $arg_screen_height);
+
+
+ while ( not $done ) {
+
+ DrawGLScene();
+
+ $app->sync();
+
+ for (1 .. 10) {
+ $event->pump;
+ $event->poll;
+ $app->delay($delay);
+ }
+
+
+ if ( $event->type == SDL_QUIT ) {
+ $done = 1;
+ }
+
+ if ( $event->type == SDL_KEYDOWN ) {
+ if ( $event->key_sym == SDLK_ESCAPE ) {
+ $done = 1;
+ }
+ }
+ }
+ }
+
+
+
+
+
+
+#########################################################################
+#Pretty much in original form, but 'Perlised'
+
+
+
+
+sub InitGL
+ {
+ my ($Width, $Height) = @_;
+
+ glViewport(0, 0, $Width, $Height);
+
+ LoadGLTextures(); # Load The Texture(s)
+
+ glEnable(GL_TEXTURE_2D()); # Enable Texture Mapping
+
+ glClearColor(0.0, 0.0, 1.0, 0.0); # This Will Clear The Background Color To Black
+ glClearDepth(1.0); # Enables Clearing Of The Depth Buffer
+ glDepthFunc(GL_LESS); # The Type Of Depth Test To Do
+ glEnable(GL_DEPTH_TEST); # Enables Depth Testing
+ glShadeModel(GL_SMOOTH); # Enables Smooth Color Shading
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity(); # Reset The Projection Matrix
+
+ gluPerspective(45.0, $Width/$Height, 0.1, 100.0); # Calculate The Aspect Ratio Of The Window
+
+ glMatrixMode(GL_MODELVIEW);
+ }
+
+
+
+# The main drawing function.
+sub DrawGLScene
+ {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Clear The Screen And The Depth Buffer
+ glLoadIdentity(); # Reset The View
+
+
+ glTranslate(0.0,0.0,-5.0); # move 5 units into the screen.
+
+ glRotate($xrot,1.0,0.0,0.0); # Rotate On The X Axis
+ glRotate($yrot,0.0,1.0,0.0); # Rotate On The Y Axis
+ glRotate($zrot,0.0,0.0,1.0); # Rotate On The Z Axis
+
+ glBindTexture(GL_TEXTURE_2D, 1); # choose the texture to use.
+
+ glBegin(GL_QUADS); # begin drawing a cube
+
+ # Front Face (note that the texture's corners have to match the quad's corners)
+ glTexCoord(0.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, 1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, 1.0); # Top Left Of The Texture and Quad
+
+ # Back Face
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, -1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, -1.0); # Bottom Left Of The Texture and Quad
+
+ # Top Face
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex(-1.0, 1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex( 1.0, 1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+
+ # Bottom Face
+ glTexCoord(1.0, 1.0); glVertex(-1.0, -1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, -1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+
+ # Right face
+ glTexCoord(1.0, 0.0); glVertex( 1.0, -1.0, -1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, 1.0, 1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+
+ # Left Face
+ glTexCoord(0.0, 0.0); glVertex(-1.0, -1.0, -1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex(-1.0, 1.0, 1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+
+ glEnd(); # done with the polygon.
+
+ $xrot+=15.0; # X Axis Rotation
+ $yrot+=15.0; # Y Axis Rotation
+ $zrot+=15.0; # Z Axis Rotation
+
+
+ }
+
+#my $image1,$a; #this can cause a segfault in LoadGLTextures/glTexImage2D !!!
+
+
+sub LoadGLTextures
+ {
+ # Load Texture
+
+ #uncomment this for a different method of loading:
+ #my $img_data = read_gfx_file(FILENAME=>"../../ScrollerDemos/backdrop2.h");
+ #my $pixel_ptr = $img_data->{PIXEL_PTR};
+ #my $pic_info = $img_data->{INFO};
+ #my $width = $pic_info->{WIDTH};
+ #my $height = $pic_info->{HEIGHT};
+
+
+ #if you uncomment the bit above, comment this out:
+ #-snip-
+ my $surface=create_SDL_surface_from_file("Data/crate.png");
+ my $width=$surface->width();
+ my $height=$surface->height();
+ my $pitch = $surface->pitch();
+ my $bytespp= $surface->bytes_per_pixel();
+ my $size=$pitch*$height;
+ my $pixels = $surface->pixels();
+
+ # Create Texture
+ my $textures = glGenTextures(1); #name texture
+ die "Could not genereate textures" unless $$textures[0];
+
+ glBindTexture(GL_TEXTURE_2D, $$textures[0]); # 2d texture
+
+
+ glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); # scale linearly when image bigger than texture
+ glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); # scale linearly when image smalled than texture
+
+ glTexImage2D(GL_TEXTURE_2D(),
+ 0, #level (0 normal, heighr is form mip-mapping)
+ GL_RGB(), #internal format (3=GL_RGB)
+ $width,$height,
+ 0, # border
+ GL_RGB(), #format RGB color data
+ GL_UNSIGNED_BYTE(), #unsigned bye data
+ $pixels); #ptr to texture data
+
+ die "Problem setting up 2d Texture (dimensions not a power of 2?)):".glErrorString(glGetError())."\n" if glGetError();
+
+ }
+
+sub create_SDL_surface_from_file
+ {
+ my $filename=shift;
+
+ my $surface = new SDL::Surface( -name => $filename);
+
+ return $surface;
+
+ }
+
+
+
+
+
+###################
+#alternat loading support:
+
+#keep ref counts up:
+my @sprite_c_heap =();
+my @sprite_area =();
+
+sub read_gfx_file
+ {
+ my %args=(
+ TYPE => "GIMP_HEADER",
+ FILENAME => undef,
+ @_,
+ );
+
+ my $struct = read_gimp_header_image($args{FILENAME});
+ my $size = length $struct->{DATA};
+ my $c_array = new OpenGL::Array $size , GL_UNSIGNED_BYTE;
+
+ # c_array is the main reason to do the following ref count trickster:
+ # (otherwise the OpenGL:Array goes out of scope and the memory (image) is ZEROed out (and invalidated) by the DESTROY method
+ push @sprite_c_heap, $c_array;
+ push @sprite_area, $struct;
+
+ $c_array->assign_data(0, $struct->{DATA} ); #take a copy of the data
+
+ return {
+ PIXEL_PTR => $c_array->ptr(), #could return $c_array instead to kepe ref count alive
+ INFO => $struct,
+ };
+
+ #that all needs modularising.....
+
+ }
+
+
+#nasty fixed to 3 byte RGB
+sub read_gimp_header_image
+ {
+ my $file=shift;
+ my $cached_file="$file.cached-bin";
+
+ my ($width, $height,$pixel_format, $data)=(0,0,"RGB","");
+
+ #due to that fact that this aint the fastest code ever, we keep a cache.
+ if (-e $cached_file and (-C $file >= -C $cached_file))
+ {
+
+ print "Reading cached binary bitmap data : $cached_file\n";
+ open (FH, "<$file.cached-bin") or die "Open: $!";
+ my $line="";
+ $width=<FH>;
+ $height=<FH>;
+ $pixel_format=<FH>;
+ chomp $width;
+ chomp $height;
+ chomp $pixel_format; #but who cares? not here anyway!!!
+
+ #slurp in the rest of the file (its pixel data)
+ {
+ local $/;
+ undef $/;
+
+ my @lines= <FH>;
+ $data=join '', @lines;
+ }
+
+ close (FH);
+ }
+ else # there is no cached file, or the cached file is out of date.
+ {
+
+ open (FH, "<$file") or die "Open: $!";
+
+ my @data=();
+ my @pixel=();
+ while (defined (my $line=<FH>))
+ {
+ $width =$1 if ($line =~ /width\s*=\s*(\d+)/);
+ $height=$1 if ($line =~ /height\s*=\s*(\d+)/);
+ if ($line =~ /^\s+\"(.+)\"$/g)
+ {
+ my $c=$1;
+ $c =~ s/\\(.)/$1/g; #remove meta guard
+ $c =~
+ s/
+ \G
+ (.)(.)(.)(.)
+ /
+ @data=(ord($1),ord($2),ord($3),ord($4));
+
+ chr ( ( ( ( $data[0] - 33) << 2) | ( ($data[1] - 33) >> 4) ) ).
+ chr ( ( ( ( ( $data[1] - 33) & 0xF) << 4) | ( ($data[2] - 33) >> 2) ) ).
+ chr ( ( ( ( ( $data[2] - 33) & 0x3) << 6) | ( ($data[3] - 33) ) ) );
+ /gex;
+
+ $data.=$c ;
+ }
+ }
+
+
+ close(FH);
+
+ print "Writing cached binary bitmap data for: $file as $cached_file\n";
+
+ #create a binary cached copy
+ open (FH, ">$cached_file") or die "Open: $!";
+ binmode FH; #we might have to put up with weak OSes.
+ print FH "$width\n$height\n$pixel_format\n$data";
+
+ close(FH);
+ }
+
+
+
+
+ return {
+ WIDTH => $width,
+ HEIGHT => $height,
+ FORMAT => $pixel_format,
+ DATA => $data
+ };
+ }
+
+
--- /dev/null
+#!/usr/bin/perl
+# This code is based on the code by Jeff Molofee '99
+# and ported to SDL by Sam Lantinga '2000
+# Original ported to Perl/SDL by Wayne Keenan '2000
+# And updated by David Goehrig '02
+#
+#
+# Jeff's tutorials can be found at www.demonews.com/hosted/nehe
+
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+use Benchmark;
+
+use SDL;
+use SDL::App;
+use SDL::OpenGL;
+use SDL::Event;
+use SDL::Surface;
+use SDL::OpenGL;
+
+my $arg_screen_width =640;
+my $arg_screen_height=512;
+my $arg_fullscreen=0;
+
+GetOptions(
+ "width:i" => \$arg_screen_width,
+ "height:i" => \$arg_screen_height,
+ "fullscreen!" => \$arg_fullscreen,
+ ) or die $!;
+
+############################################################
+
+my $light = 0;
+
+my $xrot=0; # x rotation
+my $yrot=0; # y rotation
+my $xspeed=0; # x rotation speed
+my $yspeed=0; # y rotation speed
+
+my $z=-5.0; # depth into the screen.
+
+my $filter = 1; # Which Filter To Use (nearest/linear/mipmapped) */
+
+main();
+exit;
+
+sub main
+ {
+ my $done=0;
+ my $vidmode_flags= SDL_OPENGL;
+
+ $vidmode_flags|= SDL_FULLSCREEN if $arg_fullscreen;
+
+ my $app = new SDL::App ( -title => "Jeff Molofee's GL Code Tutorial ... NeHe '99",
+ -icon => "icon.png",
+ -flags => $vidmode_flags,
+ -width => $arg_screen_width,
+ -height =>$arg_screen_height,
+ -opengl => 1,
+ );
+
+ SDL::ShowCursor(0);
+
+ my $event = new SDL::Event;
+ $event->set(SDL_SYSWMEVENT,SDL_IGNORE);
+
+ InitGL($arg_screen_width, $arg_screen_height);
+
+ while ( not $done )
+ {
+
+ DrawGLScene();
+
+ $app->sync();
+
+ $event->pump;
+ $event->poll;
+
+ $done = 1 if ( $event->type == SDL_QUIT ) ;
+
+
+ if ( $event->type == SDL_KEYDOWN )
+ {
+ my $key= $event->key_sym;
+
+ $done = 1 if ( $key == SDLK_ESCAPE ) ;
+
+
+ if ($key==SDLK_l)
+ {
+ printf("Light was: %d\n", $light);
+ $light = $light ? 0 : 1; # switch the current value of light, between 0 and 1.
+ printf("Light is now: %d\n", $light);
+ if (!$light)
+ {
+ glDisable(GL_LIGHTING);
+ }
+ else
+ {
+ glEnable(GL_LIGHTING);
+ }
+
+ }
+ if ($key==SDLK_f)
+ {
+ printf("Filter was: %d\n", $filter);
+ $filter = 1+(($filter) % 3) ;
+ printf("Filter is now: %d\n", $filter);
+ }
+
+ #bit lax:
+ $z-=0.02 if ( $key == SDLK_PAGEUP );
+ $z+=0.02 if ( $key == SDLK_PAGEDOWN );
+ $xspeed+=0.02 if ( $key == SDLK_UP );
+ $xspeed-=0.02 if ( $key == SDLK_DOWN );
+ $yspeed-=0.01 if ( $key == SDLK_LEFT );
+ $yspeed+=0.01 if ( $key == SDLK_RIGHT );
+
+ }
+ }
+ }
+
+
+
+
+
+
+#########################################################################
+#Pretty much in original form, but 'Perlised'
+
+
+
+
+sub InitGL
+ {
+ my ($Width, $Height) = @_;
+
+ glViewport(0, 0, $Width, $Height);
+
+ LoadGLTextures(); # Load The Texture(s)
+
+ glEnable(GL_TEXTURE_2D); # Enable Texture Mapping
+
+
+ glClearColor(0.0, 0.0, 0.0, 0.0); # This Will Clear The Background Color To Black
+ glClearDepth(1.0); # Enables Clearing Of The Depth Buffer
+ glDepthFunc(GL_LESS); # The Type Of Depth Test To Do
+ glEnable(GL_DEPTH_TEST); # Enables Depth Testing
+ glShadeModel(GL_SMOOTH); # Enables Smooth Color Shading
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity(); # Reset The Projection Matrix
+
+ gluPerspective(45.0, $Width/$Height, 0.1, 100.0); # Calculate The Aspect Ratio Of The Window
+
+ glMatrixMode(GL_MODELVIEW);
+
+
+ my $LightAmbient = [ 0.5, 0.5, 0.5, 1.0 ]; # white ambient light at half intensity (rgba) */
+
+ my $LightDiffuse = [ 1.0, 1.0, 1.0, 1.0 ]; # super bright, full intensity diffuse light. */
+
+ my $LightPosition = [ 0.0 , 0.0, 2.0, 1.0 ]; # position of light (x, y, z, (position of light)) */
+
+
+
+ #hmm, undefine:
+ glLight(GL_LIGHT1, GL_AMBIENT, @$LightAmbient); # add lighting. (ambient)
+ glLight(GL_LIGHT1, GL_DIFFUSE, @$LightDiffuse); # add lighting. (diffuse).
+ glLight(GL_LIGHT1, GL_POSITION,@$LightPosition); # set light position.
+ glEnable(GL_LIGHT1); # turn light 1 on.
+ }
+
+
+
+# The main drawing function.
+sub DrawGLScene
+ {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Clear The Screen And The Depth Buffer
+ glLoadIdentity(); # Reset The View
+
+ glTranslate(0.0,0.0,$z); # move z units out from the screen.
+
+ glRotate($xrot,1.0,0.0,0.0); # Rotate On The X Axis
+ glRotate($yrot,0.0,1.0,0.0); # Rotate On The Y Axis
+
+ glBindTexture(GL_TEXTURE_2D, $filter); # choose the texture to use.
+
+ glBegin(GL_QUADS); # begin drawing a cube
+
+ # Front Face (note that the texture's corners have to match the quad's corners)
+ glNormal( 0.0, 0.0, 1.0); # front face points out of the screen on z.
+ glTexCoord(0.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, 1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, 1.0); # Top Left Of The Texture and Quad
+
+ # Back Face
+ glNormal( 0.0, 0.0,-1.0); # back face points into the screen on z.
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, -1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, -1.0); # Bottom Left Of The Texture and Quad
+
+ # Top Face
+ glNormal( 0.0, 1.0, 0.0); # top face points up on y.
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex(-1.0, 1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex( 1.0, 1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+
+ # Bottom Face
+ glNormal( 0.0, -1.0, 0.0); # bottom face points down on y.
+ glTexCoord(1.0, 1.0); glVertex(-1.0, -1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, -1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+
+ # Right face
+ glNormal( 1.0, 0.0, 0.0); # right face points right on x.
+ glTexCoord(1.0, 0.0); glVertex( 1.0, -1.0, -1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, 1.0, 1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+
+ # Left Face
+ glNormal(-1.0, 0.0, 0.0); # left face points left on x.
+ glTexCoord(0.0, 0.0); glVertex(-1.0, -1.0, -1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex(-1.0, 1.0, 1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+
+ glEnd(); # done with the polygon.
+
+ $xrot+=$xspeed; # X Axis Rotation
+ $yrot+=$yspeed; # Y Axis Rotation
+
+
+
+ }
+
+
+
+
+sub LoadGLTextures
+ {
+ # Load Texture
+
+
+ my ($pixels, $width, $height, $size)=ImageLoad("Data/crate.png");
+
+ # Create Texture
+
+ glGenTextures(3);
+
+ # texture 1 (poor quality scaling)
+ glBindTexture(GL_TEXTURE_2D, 1); # 2d texture (x and y size)
+
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); # cheap scaling when image bigger than texture
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); # cheap scaling when image smalled than texture
+
+ # 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image,
+ # border 0 (normal), rgb color data, unsigned byte data, and finally the data itself.
+ #glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->w, image1->h, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->pixels);
+
+ glTexImage2D(GL_TEXTURE_2D,
+ 0, #level (0 normal, heighr is form mip-mapping)
+ 3, #internal format (3=GL_RGB)
+ $width,$height,
+ 0, # border
+ GL_RGB, #format RGB color data
+ GL_UNSIGNED_BYTE, #unsigned bye data
+ $pixels); #ptr to texture data
+
+
+
+ # texture 2 (linear scaling)
+ glBindTexture(GL_TEXTURE_2D, 2); # 2d texture (x and y size)
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); # scale linearly when image bigger than texture
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); # scale linearly when image smalled than texture
+ #glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->w, image1->h, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->pixels);
+
+ glTexImage2D(GL_TEXTURE_2D,
+ 0, #level (0 normal, heighr is form mip-mapping)
+ 3, #internal format (3=GL_RGB)
+ $width,$height,
+ 0, # border
+ GL_RGB, #format RGB color data
+ GL_UNSIGNED_BYTE, #unsigned bye data
+ $pixels); #ptr to texture data
+
+
+
+
+ # texture 3 (mipmapped scaling)
+ glBindTexture(GL_TEXTURE_2D, 3); # 2d texture (x and y size)
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); # scale linearly when image bigger than texture
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); # scale linearly + mipmap when image smalled than texture
+ #glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->w, image1->h, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->pixels);
+
+ glTexImage2D(GL_TEXTURE_2D,
+ 0, #level (0 normal, heighr is form mip-mapping)
+ 3, #internal format (3=GL_RGB)
+ $width,$height,
+ 0, # border
+ GL_RGB, #format RGB color data
+ GL_UNSIGNED_BYTE, #unsigned bye data
+ $pixels); #ptr to texture data
+
+ # 2d texture, 3 colors, width, height, RGB in that order, byte data, and the data.
+ gluBuild2DMipmaps(GL_TEXTURE_2D, 3, $width, $height, GL_RGB, GL_UNSIGNED_BYTE, $pixels);
+
+ my $glerr=glGetError();
+ die "Problem setting up 2d Texture (dimensions not a power of 2?)):".gluErrorString($glerr)."\n" if $glerr;
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+#somthing needs to keep the ref count alive for objects which represents data in C space (they have no ref count):
+my @ref=();
+
+sub ImageLoad
+ {
+ my $filename=shift;
+
+ my $surface = new SDL::Surface( -name => $filename); #makes use of SDL: BMP loader.
+
+
+ my $width=$surface->width();
+ my $height=$surface->height();
+ my $bytespp= $surface->bytes_per_pixel();
+ my $size= $width*$height*$bytespp;
+
+ my $surface_pixels=$surface->pixels();
+ my $surface_size=$width*$height*$surface->bytes_per_pixel();
+ my $raw_pixels = $surface_pixels;
+
+
+
+ #do a conversion (the pixel data is accessable as a simple string)
+
+ my $pixels=$raw_pixels;
+ my $pre_conv= $pixels; #rotate image 180 degrees!
+ my $new_pixels="";
+ for (my $y=0; $y< $height; $y++)
+ {
+ my $y_pos=$y*$width*$bytespp; #calculate offset into the image (a string)
+ my $row=substr ($pre_conv, $y_pos, $width*$bytespp); #extract 1 pixel row
+ $row =~ s/\G(.)(.)(.)/$3$2$1/gms; #turn the BMP BGR order into OpenGL RGB order;
+ $new_pixels.= reverse $row;
+ }
+
+ $raw_pixels = $new_pixels; #put transformed data into C array.
+ push @ref, $raw_pixels, $surface;
+
+ #we could have created another SDL surface frm the '$raw_pixel's... oh well.
+ return ($raw_pixels, $width, $height, $size);
+ }
--- /dev/null
+#!/usr/bin/perl -w
+# This code was created by Jeff Molofee '99
+# (ported to SDL by Sam Lantinga '2000)
+# (ported to Perl/SDL by Wayne Keenan '2000)
+#
+# If you've found this code useful, please let me know.
+#
+# Visit me at www.demonews.com/hosted/nehe
+
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+use Benchmark;
+
+use SDL;
+use SDL::App;
+use SDL::OpenGL;
+use SDL::Event;
+use SDL::Surface;
+use SDL::Cursor;
+use SDL::OpenGL;
+
+my $arg_screen_width =640;
+my $arg_screen_height=512;
+my $arg_fullscreen=0;
+
+GetOptions(
+ "width:i" => \$arg_screen_width,
+ "height:i" => \$arg_screen_height,
+ "fullscreen!" => \$arg_fullscreen,
+
+ ) or die $!;
+
+############################################################
+
+my $light = 0;
+
+my $xrot=0; # x rotation
+my $yrot=0; # y rotation
+my $xspeed=0; # x rotation speed
+my $yspeed=0; # y rotation speed
+
+my $z=-5.0; # depth into the screen.
+
+my $filter = 1; # Which Filter To Use (nearest/linear/mipmapped) */
+my $blend = 1;
+
+
+print STDERR "Use b to toggle blend, page up/down to zoom, and arrow keys to rotate\n";
+
+main();
+exit;
+
+
+sub main
+ {
+ my $done=0;
+ my $vidmode_flags= SDL_OPENGL;
+
+ $vidmode_flags|= SDL_FULLSCREEN if $arg_fullscreen;
+
+ my $app = new SDL::App ( -title => "Jeff Molofee's GL Code Tutorial ... NeHe '99",
+ -icon => "icon.png",
+ -flags => $vidmode_flags,
+ -width => $arg_screen_width,
+ -height =>$arg_screen_height,
+ -opengl => 1,
+ );
+
+ SDL::ShowCursor(0);
+
+ my $event = new SDL::Event;
+ $event->set(SDL_SYSWMEVENT,SDL_IGNORE);
+
+ InitGL($arg_screen_width, $arg_screen_height);
+
+ glEnable(GL_BLEND); # Turn Blending On
+ glEnable(GL_LIGHTING);
+ glDisable(GL_DEPTH_TEST); # Turn Depth Testing Off
+
+ while ( not $done )
+ {
+
+ DrawGLScene();
+
+ $app->sync();
+
+ $event->pump;
+ $event->poll;
+
+ $done = 1 if ( $event->type == SDL_QUIT ) ;
+
+ if ( $event->type == SDL_KEYDOWN )
+ {
+ my $key= $event->key_sym;
+
+ $done = 1 if ( $key == SDLK_ESCAPE ) ;
+
+ if ($key==SDLK_f)
+ {
+ printf("Filter was: %d\n", $filter);
+ $filter = 1+(($filter) % 3) ;
+ printf("Filter is now: %d\n", $filter);
+ $app->delay(100);
+ }
+ if ($key == SDLK_b)
+ {
+ printf("Blend was: %d\n", $blend);
+ $blend = $blend ? 0 : 1;
+ printf("Blend is now: %d\n", $blend);
+ $app->delay(100);
+ if ($blend)
+ {
+ glEnable(GL_BLEND); # Turn Blending On
+ glEnable(GL_LIGHTING);
+ glDisable(GL_DEPTH_TEST); # Turn Depth Testing Off
+ }
+ else
+ {
+ glDisable(GL_BLEND); # Turn Blending Off
+ glDisable(GL_LIGHTING);
+ glEnable(GL_DEPTH_TEST); # Turn Depth Testing On
+ }
+ }
+ #bit lax:
+ $z-=0.02 if ( $key == SDLK_PAGEUP );
+ $z+=0.02 if ( $key == SDLK_PAGEDOWN );
+ $xspeed+=0.02 if ( $key == SDLK_UP );
+ $xspeed-=0.02 if ( $key == SDLK_DOWN );
+ $yspeed-=0.01 if ( $key == SDLK_LEFT );
+ $yspeed+=0.01 if ( $key == SDLK_RIGHT );
+
+ }
+ }
+ }
+
+
+
+
+
+
+#########################################################################
+#Pretty much in original form, but 'Perlised'
+
+
+
+
+sub InitGL
+ {
+ my ($Width, $Height) = @_;
+
+ glViewport(0, 0, $Width, $Height);
+
+ LoadGLTextures(); # Load The Texture(s)
+
+ glEnable(GL_TEXTURE_2D); # Enable Texture Mapping
+
+
+ glClearColor(0.0, 0.0, 0.0, 0.0); # This Will Clear The Background Color To Black
+ glClearDepth(1.0); # Enables Clearing Of The Depth Buffer
+ glDepthFunc(GL_LESS); # The Type Of Depth Test To Do
+ glEnable(GL_DEPTH_TEST); # Enables Depth Testing
+ glShadeModel(GL_SMOOTH); # Enables Smooth Color Shading
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity(); # Reset The Projection Matrix
+
+ gluPerspective(45.0, $Width/$Height, 0.1, 100.0); # Calculate The Aspect Ratio Of The Window
+
+ glMatrixMode(GL_MODELVIEW);
+
+
+ my $LightAmbient = [ 0.5, 0.5, 0.5, 1.0 ]; # white ambient light at half intensity (rgba) */
+
+ my $LightDiffuse = [ 1.0, 1.0, 1.0, 1.0 ]; # super bright, full intensity diffuse light. */
+
+ my $LightPosition = [ 0.0 , 0.0, 2.0, 1.0 ]; # position of light (x, y, z, (position of light)) */
+
+
+
+ #setup light number 1
+ glLight(GL_LIGHT1, GL_AMBIENT, @$LightAmbient); # add lighting. (ambient)
+ glLight(GL_LIGHT1, GL_DIFFUSE, @$LightDiffuse); # add lighting. (diffuse).
+ glLight(GL_LIGHT1, GL_POSITION,@$LightPosition); # set light position.
+ glEnable(GL_LIGHT1); # turn light 1 on.
+ #/* setup blending */
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE); # Set The Blending Function For Translucency
+ glColor(1.0, 1.0, 1.0, 0.5);
+
+
+ }
+
+
+
+# The main drawing function.
+sub DrawGLScene
+ {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Clear The Screen And The Depth Buffer
+ glLoadIdentity(); # Reset The View
+
+ glTranslate(0.0,0.0,$z); # move z units out from the screen.
+
+ glRotate($xrot,1.0,0.0,0.0); # Rotate On The X Axis
+ glRotate($yrot,0.0,1.0,0.0); # Rotate On The Y Axis
+
+ glBindTexture(GL_TEXTURE_2D, $filter); # choose the texture to use.
+
+ glBegin(GL_QUADS); # begin drawing a cube
+
+ # Front Face (note that the texture's corners have to match the quad's corners)
+ glNormal( 0.0, 0.0, 1.0); # front face points out of the screen on z.
+ glTexCoord(0.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, 1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, 1.0); # Top Left Of The Texture and Quad
+
+ # Back Face
+ glNormal( 0.0, 0.0,-1.0); # back face points into the screen on z.
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, -1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, -1.0); # Bottom Left Of The Texture and Quad
+
+ # Top Face
+ glNormal( 0.0, 1.0, 0.0); # top face points up on y.
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex(-1.0, 1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex( 1.0, 1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+
+ # Bottom Face
+ glNormal( 0.0, -1.0, 0.0); # bottom face points down on y.
+ glTexCoord(1.0, 1.0); glVertex(-1.0, -1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, -1.0, -1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+
+ # Right face
+ glNormal( 1.0, 0.0, 0.0); # right face points right on x.
+ glTexCoord(1.0, 0.0); glVertex( 1.0, -1.0, -1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex( 1.0, 1.0, -1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex( 1.0, 1.0, 1.0); # Top Left Of The Texture and Quad
+ glTexCoord(0.0, 0.0); glVertex( 1.0, -1.0, 1.0); # Bottom Left Of The Texture and Quad
+
+ # Left Face
+ glNormal(-1.0, 0.0, 0.0); # left face points left on x.
+ glTexCoord(0.0, 0.0); glVertex(-1.0, -1.0, -1.0); # Bottom Left Of The Texture and Quad
+ glTexCoord(1.0, 0.0); glVertex(-1.0, -1.0, 1.0); # Bottom Right Of The Texture and Quad
+ glTexCoord(1.0, 1.0); glVertex(-1.0, 1.0, 1.0); # Top Right Of The Texture and Quad
+ glTexCoord(0.0, 1.0); glVertex(-1.0, 1.0, -1.0); # Top Left Of The Texture and Quad
+
+ glEnd(); # done with the polygon.
+
+ $xrot+=$xspeed; # X Axis Rotation
+ $yrot+=$yspeed; # Y Axis Rotation
+
+
+
+ }
+
+
+
+
+sub LoadGLTextures
+ {
+ # Load Texture
+
+
+ my ($pixels, $width, $height, $size)=ImageLoad("Data/glass.bmp");
+
+ # Create Texture
+
+ glGenTextures(3);
+
+ # texture 1 (poor quality scaling)
+ glBindTexture(GL_TEXTURE_2D, 1); # 2d texture (x and y size)
+
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); # cheap scaling when image bigger than texture
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); # cheap scaling when image smalled than texture
+
+ # 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image,
+ # border 0 (normal), rgb color data, unsigned byte data, and finally the data itself.
+ #glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->w, image1->h, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->pixels);
+
+ glTexImage2D(GL_TEXTURE_2D,
+ 0, #level (0 normal, heighr is form mip-mapping)
+ 3, #internal format (3=GL_RGB)
+ $width,$height,
+ 0, # border
+ GL_RGB, #format RGB color data
+ GL_UNSIGNED_BYTE, #unsigned bye data
+ $pixels); #ptr to texture data
+
+
+
+ # texture 2 (linear scaling)
+ glBindTexture(GL_TEXTURE_2D, 2); # 2d texture (x and y size)
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); # scale linearly when image bigger than texture
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); # scale linearly when image smalled than texture
+ #glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->w, image1->h, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->pixels);
+
+ glTexImage2D(GL_TEXTURE_2D,
+ 0, #level (0 normal, heighr is form mip-mapping)
+ 3, #internal format (3=GL_RGB)
+ $width,$height,
+ 0, # border
+ GL_RGB, #format RGB color data
+ GL_UNSIGNED_BYTE, #unsigned bye data
+ $pixels); #ptr to texture data
+
+
+
+
+ # texture 3 (mipmapped scaling)
+ glBindTexture(GL_TEXTURE_2D, 3); # 2d texture (x and y size)
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); # scale linearly when image bigger than texture
+ glTexParameter(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); # scale linearly + mipmap when image smalled than texture
+ #glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->w, image1->h, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->pixels);
+
+ glTexImage2D(GL_TEXTURE_2D,
+ 0, #level (0 normal, heighr is form mip-mapping)
+ 3, #internal format (3=GL_RGB)
+ $width,$height,
+ 0, # border
+ GL_RGB, #format RGB color data
+ GL_UNSIGNED_BYTE, #unsigned bye data
+ $pixels); #ptr to texture data
+
+ # 2d texture, 3 colors, width, height, RGB in that order, byte data, and the data.
+ gluBuild2DMipmaps(GL_TEXTURE_2D, 3, $width, $height, GL_RGB, GL_UNSIGNED_BYTE, $pixels);
+
+ my $glerr=glGetError();
+ die "Problem setting up 2d Texture (dimensions not a power of 2?)):".gluErrorString($glerr)."\n" if $glerr;
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+#somthing needs to keep the ref count alive for objects which represents data in C space (they have no ref count):
+my @ref=();
+
+sub ImageLoad
+ {
+ my $filename=shift;
+
+ my $surface = new SDL::Surface( -name => $filename); #makes use of SDL: BMP loader.
+
+
+ my $width=$surface->width();
+ my $height=$surface->height();
+ my $bytespp= $surface->bytes_per_pixel();
+ my $size= $width*$height*$bytespp;
+
+ my $surface_pixels=$surface->pixels();
+ my $surface_size=$width*$height*$surface->bytes_per_pixel();
+ my $raw_pixels = reverse $surface_pixels;
+
+
+
+ #do a conversion (the pixel data is accessable as a simple string)
+
+ my $pixels=$raw_pixels;
+ my $pre_conv= $pixels;
+ my $new_pixels="";
+ for (my $y=0; $y< $height; $y++)
+ {
+ my $y_pos=$y*$width*$bytespp; #calculate offset into the image (a string)
+ my $row=substr ($pre_conv, $y_pos, $width*$bytespp); #extract 1 pixel row
+ $row =~ s/\G(.)(.)(.)/$3$2$1/gms; #turn the BMP BGR order into OpenGL RGB order;
+ $new_pixels.= reverse $row;
+ }
+
+ $raw_pixels = $new_pixels; #put transformed data into C array.
+ push @ref, $raw_pixels, $surface;
+
+ #we could have created another SDL surface frm the '$raw_pixel's... oh well.
+ return ($raw_pixels, $width, $height, $size);
+ }
--- /dev/null
+README
+
+The files in this directory are the test scripts used
+to both verify that nothing major is broken each release
+and to demonstrate how the SDLperl API can be used.
+
+Many of these scripts have been submitted by people who
+use SDLperl, and further submissions are more than welcome.
+Still, while these examples demonstrate how to use the
+API, they should not be taken as the best way to use it.
+There is more than one way to do it. Given the variety
+of styles presented in these scripts, there is probably
+something for everyone.
+
+Descriptions
+
+checkkeys.pl prints keys pressed to stdout
+graywin.pl creates colored rectangles where you click
+loopwave.pl plays a wav file using audio callback in perl!
+testconsole.pl creates a simple console interface
+testfonttool.pl displays a series of bitmapped and true type fonts
+testgfxprim.pl demonstrates some basic drawing primitives
+testgfxroto.pl rotates and caches an image (wait a few seconds)
+testjoystick.pl tests joystick movements
+testshell.pl experimental perl shell support
+testsprite.pl displays a wave of smilie faces
+testtimer.pl displays multiple, contemporary, timer callbacks in perl
+
--- /dev/null
+#!/usr/bin/env perl
+
+use SDL;
+use SDL::App;
+use SDL::Event;
+
+my %options;
+
+die <<USAGE if ( in $ARGV[0], qw/ -? -h --help /);
+usage: $0 [-hw] [-fullscreen] [-width 640] [-height 480] [-bpp 24]
+USAGE
+
+for ( 0 .. @ARGV-1 )
+{
+ $options{$ARGV[$_]} = $ARGV[$_ + 1] || 1;
+}
+
+$options{-flags} = SDL_SWSURFACE;
+$options{-flags} |= SDL_HWPALETTE if ( $options{-hw} );
+$options{-flags} |= SDL_FULLSCREEN if ( $options{-fullscreen} );
+
+$options{-title} = $0;
+
+$options{-width} ||= 640;
+$options{-height} ||= 480;
+$options{-depth} ||= $options{-bpp} || 24;
+
+my $app = new SDL::App %options;
+
+# SDL::EventState(SDL_KEYUP,SDL_DISABLE);
+
+sub print_modifiers
+{
+ $mod = SDL::GetModState();
+
+ print " modifiers:",
+ ($mod & KMOD_LSHIFT) ? " LSHIFT" : "",
+ ($mod & KMOD_RSHIFT) ? " RSHIFT" : "",
+ ($mod & KMOD_LCTRL) ? " LCTRL" : "",
+ ($mod & KMOD_RCTRL) ? " RCTRL" : "",
+ ($mod & KMOD_LALT) ? " LALT" : "",
+ ($mod & KMOD_RALT) ? " RALT" : "",
+ ($mod & KMOD_LMETA) ? " LMETA" : "",
+ ($mod & KMOD_RMETA) ? " RMETA" : "",
+ ($mod & KMOD_CAPS) ? " CAPS" : "",
+ ($mod & KMOD_NUM) ? " NUM" : "",
+ ($mod & KMOD_MODE) ? " MODE" : "",
+ "\n" ;
+}
+
+sub print_key
+{
+ my ($e) = @_;
+
+ print "pressed " if (SDL::KeyEventState($e) == SDL_PRESSED);
+ print "released " if ( SDL::KeyEventState($e) == SDL_RELEASED);
+
+ my $sym = SDL::KeyEventSym($e);
+
+ if ($sym) {
+ print SDL::GetKeyName($sym);
+ } else {
+ printf "Unknown Key (scancode = %d) ", SDL::KeyEventScanCode($e);
+ }
+
+}
+
+my $event = new SDL::Event;
+
+my $done = 0;
+
+$process_keys = sub {
+ print_key($_[0]);
+ print_modifiers();
+ };
+
+my %events = (
+ SDL_KEYUP() => $process_keys,
+ SDL_KEYDOWN() => $process_keys,
+ SDL_QUIT() => sub { $done = 1; },
+);
+
+while (!$done && $event->wait())
+{
+ if ( $events{$event->type()}) {
+ &{$events{$event->type()}}($$event);
+ }
+};
+
--- /dev/null
+#!/usr/bin/env perl
+#
+# graywin.pl
+#
+# adapted from SDL-1.2.x/test/graywin.c
+#
+
+use SDL;
+use SDL::App;
+use SDL::Rect;
+use SDL::Event;
+use SDL::Color;
+
+my %options;
+
+die <<USAGE if in($ARGV[0], qw/ -h --help -? /);
+usage: $0 [-hw] [-fullscreen] [-width 640] [-height 480] [-bpp 24]
+USAGE
+
+for ( 0 .. @ARGV-1 )
+{
+ $options{$ARGV[$_]} = $ARGV[$_ + 1] || 1;
+}
+
+$options{-flags} = SDL_SWSURFACE;
+$options{-flags} |= SDL_HWPALETTE if ( $options{-hw} );
+$options{-flags} |= SDL_FULLSCREEN if ( $options{-fullscreen} );
+
+$options{-title} = $0;
+
+$options{-width} ||= 640;
+$options{-height} ||= 480;
+$options{-depth} ||= $options{-bpp} || 8;
+
+my $app = new SDL::App %options;
+
+sub DrawBox {
+ my ($x,$y) = @_;
+
+ my ($w, $h) = ( int(rand(640)), int(rand(480)) );
+
+ my $rect = new SDL::Rect -width => $w, -height => $h,
+ -x => ($x - int($w/2)), -y => ($y - int($h/2));
+
+ my $color = new SDL::Color -r => rand(256), -g => rand(256), -b => rand(256);
+
+ $app->fill($rect,$color);
+ $app->update($rect);
+};
+
+$app->loop( {
+ SDL_MOUSEBUTTONDOWN() => sub {
+ my ($event) = @_;
+ DrawBox($event->button_x(),$event->button_y());
+ },
+ SDL_KEYDOWN() => sub {
+ my ($event) = @_;
+ $app->warp($options{-width}/2,$options{-height}/2)
+ if ($event->key_sym() == SDLK_SPACE);
+ $app->fullscreen()
+ if ($event->key_sym() == SDLK_f);
+ exit(0) if ($event->key_sym() == SDLK_ESCAPE);
+ },
+ SDL_QUIT() => sub { exit(0); }
+} );
+
+
--- /dev/null
+#!/usr/bin/env perl
+
+use SDL;
+
+die "Could not initialize SDL: ", SDL::GetError()
+ if ( 0 > SDL::Init(SDL_INIT_AUDIO()));
+
+$ARGV[0] ||= 'data/sample.wav';
+
+die "usage: $0 [wavefile]\n"
+ if ( in $ARGV[0], qw/ -h --help -? /);
+
+my ($wav_spec,$wav_buffer,$wav_len,$wav_pos) = (0,0,0,0);
+
+my $done = 0;
+
+$fillerup = sub {
+ my ($data,$len) = @_;
+
+ $wav_ptr = $wav_buffer + $wav_pos;
+ $wav_remainder = $wav_len - $wav_pos;
+
+ while ( $wav_remainder <= $len ) {
+ SDL::MixAudio($data,$wav_ptr,$wav_remainder,SDL_MIX_MAXVOLUME);
+ $data += $wav_remainder;
+ $len -= $wav_remainder;
+ $wav_ptr = $wav_buffer;
+ $wav_remainder = $wav_len;
+ $wav_pos = 0;
+ }
+ SDL::MixAudio($data,$wav_ptr,$len,SDL_MIX_MAXVOLUME);
+ $wav_pos += $len;
+};
+
+$poked = sub {
+ $done = 1;
+};
+
+$SIG{HUP} = $poked;
+$SIG{INT} = $poked;
+$SIG{QUIT} = $poked;
+$SIG{TERM} = $poked;
+
+$spec = SDL::NewAudioSpec(44100,AUDIO_S16,2,4096);
+
+$wave = SDL::LoadWAV($ARGV[0],$spec);
+
+($wav_spec,$wav_buffer,$wav_len) = @$wave;
+
+die "Could not load wav file $ARGV[0], ", SDL::GetError(), "\n" unless ( $wav_len );
+
+die "Could not open audio ", SDL::GetError()
+ if (0 > SDL::OpenAudio($wav_spec,$fillerup));
+
+SDL::PauseAudio(0);
+
+print "Using audio driver: ", SDL::AudioDriverName(), "\n";
+
+while (! $done && ( SDL::GetAudioStatus() == SDL_AUDIO_PLAYING())) {
+ SDL::Delay(1000);
+}
+
+
--- /dev/null
+#!/usr/bin/env perl
+#
+
+use SDL;
+use SDL::App;
+use SDL::Event;
+
+use vars qw/ $app /;
+
+print STDERR <<USAGE;
+ Right click on any pixel to get its color values
+ Left click on any pixel to set its value to the last selected
+USAGE
+
+$app = new SDL::App -width => 320, -height => 240, -depth => 8;
+
+my %colors = (
+ red => (new SDL::Color -r => 255, -g => 0, -b => 0 ),
+ green => (new SDL::Color -r => 0, -g => 255, -b => 0),
+ blue => (new SDL::Color -r => 0, -g => 0, -b => 255),
+ yellow => (new SDL::Color -r => 255, -g => 255, -b => 0),
+ purple => (new SDL::Color -r => 255, -g => 0, -b => 255),
+ white => (new SDL::Color -r => 255, -g => 255, -b => 255)
+);
+
+
+$x = 0; $y = 0;
+$rect = new SDL::Rect -x => $x, -y => $y,
+ -w => $app->width / scalar(keys %colors), -h => $app->height();
+
+print "Sorted colors:\n";
+
+for ( sort keys %colors ) {
+ print "$_ " . join (",",$colors{$_}->r(), $colors{$_}->g(),
+ $colors{$_}->b()) . "\n";
+}
+
+for ( sort keys %colors ) {
+ $rect->x($x);
+ $x += $rect->width();
+ $app->fill($rect,$colors{$_});
+}
+
+$app->sync();
+
+$last = new SDL::Color -r => 128, -g => 128, -b => 128;
+
+$app->sync();
+$app->loop( {
+ SDL_QUIT() => sub { exit(0); },
+ SDL_KEYDOWN() => sub { $app->fullscreen(); },
+ SDL_MOUSEBUTTONDOWN() => sub {
+ my $e = shift;
+ if ($e->button == 3) {
+ $last = $app->pixel($e->button_x(),$e->button_y());
+ print STDERR "X: ", $e->button_x(), " Y: ", $e->button_y(),
+ " R: ", $last->r(), " G: ", $last->g(),
+ " B: ", $last->b(), "\n";
+ } else {
+ $app->pixel($e->button_x(),$e->button_y(),$last);
+ }
+ },
+});
--- /dev/null
+#!/usr/bin/env perl
+
+use strict;
+use SDL;
+use SDL::App;
+use SDL::Event;
+use SDL::Tool::Font;
+use SDL::Color;
+
+my (%options,$app,$mode);
+
+die "usage: $0 [-hw] [-fullscreen] [-width 640] [-height 480] [-bpp 24]\n"
+ if ( SDL::in ($ARGV[0], qw/ -h -? --help/ ));
+
+chdir 'test' if -d 'test';
+die "$0 must be run in the SDL_perl/test/ directory!"
+ unless (-d 'data');
+
+for ( 0 .. @ARGV-1 )
+{
+ $options{$ARGV[$_]} = $ARGV[$_ + 1] || 1;
+}
+
+$options{-flags} = SDL_SWSURFACE;
+$options{-flags} |= SDL_HWPALETTE if ( $options{-hw} );
+$options{-flags} |= SDL_FULLSCREEN if ( $options{-fullscreen} );
+
+$options{-title} = $0;
+
+$options{-width} ||= 800;
+$options{-height} ||= 600;
+$options{-depth} ||= $options{-bpp} || 24;
+
+$app = new SDL::App %options;
+
+my %ttfonts = (
+ 'aircut3.ttf' => 0,
+ 'electrohar.ttf' => 0,
+);
+
+my %sfonts = (
+ '24P_Arial_NeonYellow.png' => 0,
+ '24P_Copperplate_Blue.png' => 0,
+);
+
+my @fonts;
+
+for ( reverse keys %ttfonts ) {
+ for $mode ( qw/ -normal -bold -italic -underline / ) {
+ if (-e "data/$_") {
+ print STDERR "Loading $_\n";
+ $ttfonts{"$_$mode"} = new SDL::Tool::Font
+ $mode => 1,
+ -ttfont => "data/$_",
+ -size => 20,
+ -fg => $SDL::Color::black,
+ -bg => $SDL::Color::black;
+ push @fonts, $ttfonts{"$_$mode"};
+ }
+ }
+}
+
+%ttfonts = reverse %ttfonts;
+
+for ( reverse keys %sfonts) {
+ if (-e "data/$_") {
+ print STDERR "Loading $_\n";
+ $sfonts{$_} = new SDL::Tool::Font -sfont => "data/$_";
+ push @fonts, $sfonts{$_};
+ }
+}
+
+%sfonts = reverse %sfonts;
+
+sub DrawFonts {
+ $app->fill(0,$SDL::Color::white);
+ my ($x,$y) = @_;
+ for my $font ( @fonts) {
+ $font->print($app,$x,$y,"SDLperl font test. ",
+ "This is " . ($ttfonts{$font} || $sfonts{$font}));
+ $y += 40;
+ }
+ $app->flip();
+}
+
+DrawFonts(10,10);
+
+$app->loop( {
+ SDL_KEYDOWN() => sub {
+ my ($event) = @_;
+ $app->warp($options{-width}/2,$options{-height}/2) if ($event->key_sym() == SDLK_SPACE);
+ $app->fullscreen() if ($event->key_sym() == SDLK_f);
+ exit(0) if ($event->key_sym() == SDLK_ESCAPE);
+ },
+ SDL_QUIT() => sub { exit(0); }
+} );
+
+
+
+
+
--- /dev/null
+#!/usr/bin/env perl
+#
+# testgfxprim.pl
+#
+# This tests low level usage of the SDL_gfx extension.
+# Therefore, you should *not* rely on *any* part of this API.
+# It is subject to change, and will eventually
+# be encapsulated by something such as SDL::GraphicTool
+#
+# (plus, it's a bitch to use like this anyway)
+#
+
+# Usage: testgfxprm.pl [-bpp N] [-hw] [-fast] [-fullscreen]
+
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+
+use SDL;
+use SDL::App;
+use SDL::Event;
+use SDL::Surface;
+use SDL::Color;
+use SDL::Rect;
+use SDL::Config;
+
+use vars qw/ $app $app_rect $background $event $sprite $sprite_rect $videoflags /;
+
+die "Your system is not configured with SDL_gfx support!\n"
+ unless (SDL::Config->has('SDL_gfx'));
+
+## User tweakable settings (via cmd-line)
+my %settings = (
+ 'numsprites' => 10,
+ 'screen_width' => 640,
+ 'screen_height' => 480,
+ 'video_bpp' => 8,
+ 'fast' => 0,
+ 'hw' => 0,
+ 'fullscreen' => 0,
+ 'bpp' => undef,
+);
+
+## Process commandline arguments
+
+sub get_cmd_args
+{
+ GetOptions( "width:i" => \$settings{screen_width},
+ "height:i" => \$settings{screen_height},
+ "bpp:i" => \$settings{bpp},
+ "fast!" => \$settings{fast},
+ "hw!" => \$settings{hw},
+ "fullscreen!" => \$settings{fullscreen},
+ "numsprites=i" => \$settings{numsprites},
+ );
+}
+
+## Initialize application options
+
+sub set_app_args
+{
+ $settings{bpp} ||= 8; # default to 8 bits per pix
+
+ $videoflags |= SDL_HWACCEL if $settings{hw};
+ $videoflags |= SDL_FULLSCREEN if $settings{fullscreen};
+}
+
+## Setup
+
+sub init_game_context
+{
+ $app = new SDL::App
+ -width => $settings{screen_width},
+ -height=> $settings{screen_height},
+ -title => "testsprite",
+ -icon => "data/icon.bmp",
+ -flags => $videoflags;
+
+ $app_rect= new SDL::Rect
+ -height => $settings{screen_height},
+ -width => $settings{screen_width};
+
+ $background = $SDL::Color::black;
+
+ $sprite = new SDL::Surface -name =>"data/icon.bmp";
+
+ # Set transparent pixel as the pixel at (0,0)
+ $sprite->set_color_key(SDL_SRCCOLORKEY,$sprite->pixel(0,0));
+
+ print STDERR "Got past that\n";
+
+ $sprite->display_format();
+
+ $sprite_rect = new SDL::Rect
+ -x => 0,
+ -y => 0,
+ -width => $sprite->width,
+ -height=> $sprite->height;
+
+ $event = new SDL::Event();
+}
+
+## Prints diagnostics
+
+sub instruments
+{
+ if ( ($app->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Screen is in video memory\n");
+ } else {
+ printf("Screen is in system memory\n");
+ }
+
+ if ( ($app->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ printf("Screen has double-buffering enabled\n");
+ }
+
+ if ( ($sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Sprite is in video memory\n");
+ } else {
+ printf("Sprite is in system memory\n");
+ }
+
+ # Run a sample blit to trigger blit (if posssible)
+ # acceleration before the check just after
+ $sprite->blit(0,$app,0);
+
+ if ( ($sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ printf("Sprite blit uses hardware acceleration\n");
+ }
+ if ( ($sprite->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ printf("Sprite blit uses RLE acceleration\n");
+ }
+
+}
+
+sub game_loop
+{
+ my $surf = $$app;
+ my $surfWidth=$settings{screen_width};
+ my $surfHeight=$settings{screen_height};
+ my $surfMidWidth=$settings{screen_width}>>1;;
+ my $surfMidHeight=$settings{screen_height}>>1;
+
+ $app->fill($app_rect, $background);
+
+ # TODO: polygon's, GFX*Color
+
+ #lines
+
+ SDL::GFXHlineRGBA($surf,
+ 0,$surfWidth,
+ $surfMidHeight,
+ 255,255,255,255);
+
+ SDL::GFXVlineRGBA($surf,
+ $surfMidWidth,
+ 0,$surfHeight,
+ 255,255,255,255);
+
+ # rectangles
+
+ SDL::GFXRectangleRGBA($surf,
+ 0,0,
+ $surfMidWidth/2,$surfMidHeight/2,
+ 255,0,0,255);
+
+ SDL::GFXBoxRGBA($surf,
+ 0,0,
+ $surfMidWidth/3,$surfMidHeight/3,
+ 0,255,0,255);
+
+ SDL::GFXLineRGBA($surf,
+ 0,0,
+ $surfWidth,$surfHeight,
+ 0,255,255,255);
+
+ SDL::GFXAalineRGBA($surf, $surfWidth,0,0,$surfHeight,0,255,255,255);
+
+ # circles
+
+ SDL::GFXCircleRGBA( $surf,$surfMidWidth*.3, $surfMidHeight,
+ $surfMidWidth*.3, 255,255,0,255);
+
+
+ SDL::GFXAacircleRGBA($surf, $surfMidWidth*.6, $surfMidHeight,
+ $surfMidWidth*.3, 255,255,0,255);
+
+
+ SDL::GFXFilledCircleRGBA($surf,$surfMidWidth*.3, $surfMidHeight,
+ $surfMidWidth*.25,255,255,0,255);
+
+
+ # ellipses
+
+ SDL::GFXEllipseRGBA($surf,$surfWidth- $surfMidWidth*.3, $surfMidHeight,
+ $surfMidWidth*.3,$surfMidHeight*.15, 255,255,0,255);
+
+ SDL::GFXAaellipseRGBA($surf,$surfWidth- $surfMidWidth*.6, $surfMidHeight,
+ $surfMidWidth*.3,$surfMidHeight*.15,255,255,0,255);
+
+ SDL::GFXFilledEllipseRGBA($surf,$surfWidth- $surfMidWidth*.3, $surfMidHeight,
+ $surfMidWidth*.25,$surfMidHeight*.10,255,255,0,255);
+
+ # pie slices
+ SDL::GFXFilledpieRGBA($surf,$surfMidWidth,$surfMidHeight, $surfMidWidth*.1,
+ 0,90,0,0,255,255);
+
+ SDL::GFXFilledpieRGBA($surf,$surfMidWidth,$surfMidHeight, $surfMidWidth*.1,
+ 180,270,0,0,255,255);
+
+ # polygons
+
+ # TBD...
+
+
+ # characters & strings
+
+ SDL::GFXCharacterRGBA($surf,$surfMidWidth,0,
+ "!",255,255,255,255);
+
+ SDL::GFXStringRGBA($surf,$surfMidWidth,$surfHeight*.75,
+ "SDL_Perl Primitive Test.",255,255,255,255);
+
+ $app->flip();
+
+ $app->loop({
+ SDL_QUIT() => sub { exit(0); },
+ SDL_KEYDOWN() => sub { exit(0) if (SDL::GetKeyState(SDLK_ESCAPE)); },
+ });
+}
+
+## Main program loop
+
+get_cmd_args();
+set_app_args();
+init_game_context();
+instruments();
+game_loop();
+
--- /dev/null
+#!/usr/bin/env perl
+#
+# testgfxroto.pl
+#
+# *** WARNING ***
+#
+# This tests low level usage of the SDL_gfx extension.
+# Therefore, you should *not* rely on *any* part of this API.
+# It is subject to change, and will eventually
+# be encapsulated by something such as SDL::Surface.
+#
+# Usage: testsprite.pl [-bpp N] [-hw] [-flip] [-fast] [-fullscreen] [-numsprites=X]
+
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+
+use SDL;
+use SDL::App;
+use SDL::Event;
+use SDL::Surface;
+use SDL::Color;
+use SDL::Rect;
+use SDL::Config;
+
+use vars qw/ $app $app_rect $background $event $sprite $sprite_rect $videoflags /;
+
+## Test for SDL_gfx support
+
+die "Your system was not configured with SDL_gfx support!\n"
+ unless SDL::Config->has('SDL_gfx');
+
+
+## User tweakable settings (via cmd-line)
+my %settings = (
+ 'numsprites' => 10,
+ 'screen_width' => 800,
+ 'screen_height' => 600,
+ 'video_bpp' => 8,
+ 'fast' => 0,
+ 'hw' => 0,
+ 'flip' => 1,
+ 'fullscreen' => 0,
+ 'bpp' => undef,
+);
+
+## Process commandline arguments
+
+sub get_cmd_args
+{
+ GetOptions("width:i" => \$settings{screen_width},
+ "height:i" => \$settings{screen_height},
+ "bpp:i" => \$settings{bpp},
+ "fast!" => \$settings{fast},
+ "hw!" => \$settings{hw},
+ "flip!" => \$settings{flip},
+ "fullscreen!" => \$settings{fullscreen},
+ "numsprites=i" => \$settings{numsprites},
+ );
+}
+
+## Initialize application options
+
+sub set_app_args
+{
+ $settings{bpp} ||= 8; # default to 8 bits per pix
+
+ $videoflags |= SDL_HWACCEL if $settings{hw};
+ $videoflags |= SDL_DOUBLEBUF if $settings{flip};
+ $videoflags |= SDL_FULLSCREEN if $settings{fullscreen};
+}
+
+## Setup
+
+sub init_game_context
+{
+ $app = new SDL::App (
+ -width => $settings{screen_width},
+ -height=> $settings{screen_height},
+ -title => "testsprite",
+ -icon => "data/logo.png",
+ -flags => $videoflags,
+ );
+
+ $app_rect= new SDL::Rect(
+ -height => $settings{screen_height},
+ -width => $settings{screen_width},
+ );
+
+ $background = $SDL::Color::black;
+
+ $sprite = new SDL::Surface -name =>"data/logo.png";
+
+ $sprite->display_format();
+
+ $sprite_rect = new SDL::Rect(-x => 0,
+ -y => 0,
+ -width => $sprite->width,
+ -height=> $sprite->height,
+ );
+
+ $event = new SDL::Event();
+}
+
+## Prints diagnostics
+
+sub instruments
+{
+ if ( ($app->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Screen is in video memory\n");
+ } else {
+ printf("Screen is in system memory\n");
+ }
+
+ if ( ($app->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ printf("Screen has double-buffering enabled\n");
+ }
+
+ if ( ($sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Sprite is in video memory\n");
+ } else {
+ printf("Sprite is in system memory\n");
+ }
+
+ # Run a sample blit to trigger blit (if posssible)
+ # acceleration before the check just after
+ put_sprite_rotated($sprite,
+ $settings{screen_width}/2, $settings{screen_height}/2,
+ 0,0,0);
+
+ if ( ($sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ printf("Sprite blit uses hardware acceleration\n");
+ }
+ if ( ($sprite->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ printf("Sprite blit uses RLE acceleration\n");
+ }
+
+}
+
+
+
+
+# this can get silly in terms of
+# memory usage, and maybe key lookup.
+# it would be better to 'tie' the hash
+# to an object which can
+# better manage memory usage.
+
+my %rotate_cache =();
+
+sub generate_sprite_rotated
+{
+ my ($surface, $angle, $zoom, $smooth) = @_;
+
+ $angle %= 360;
+ my $key = "$surface$angle$zoom$smooth";
+
+ if ( $rotate_cache{$key} )
+ {
+ return $rotate_cache{$key};
+ }
+ else
+ {
+ my $sur = SDL::GFXRotoZoom($surface, $angle, $zoom, $smooth);
+
+ $rotate_cache{$key}= SDL::DisplayFormat($sur);
+ }
+ return $rotate_cache{$key};
+}
+
+sub put_sprite_rotated
+{
+ my ($surface, $x, $y, $angle, $zoom, $smooth) = @_;
+
+ my $roto = generate_sprite_rotated($$surface, $angle, $zoom, $smooth);
+
+ die "Failed to create rotozoom surface" unless $roto;
+
+ my ($w,$h) = (SDL::SurfaceW($roto),SDL::SurfaceH($roto));;
+
+
+ my $dest_rect = new SDL::Rect
+ -x => $x - ($w/2),
+ -y => $y - ($h/2),
+ -width => $w,
+ -height => $h;
+
+ SDL::SetColorKey($roto, SDL_SRCCOLORKEY, SDL::SurfacePixel($roto,$w/2,$h/2));
+
+ SDL::BlitSurface($roto, 0, $$app, $$dest_rect);
+}
+
+
+sub game_loop
+{
+ my $ox=$settings{screen_width}>>1;;
+ my $oy=$settings{screen_height}>>1;
+ my $sectors = 12;
+ my $angleDelta = 360/$sectors;;
+ my $zoom = 1;
+ my $smooth =1;
+
+ my $angle =0;
+ my $radius =128;
+
+ FRAME:
+ while (1)
+ {
+ # process event queue
+ $event->pump;
+ if ($event->poll)
+ {
+ my $etype=$event->type();
+
+ # handle quit events
+ last FRAME if ($etype == SDL_QUIT() );
+ last FRAME if (SDL::GetKeyState(SDLK_ESCAPE));
+ }
+
+ # needed for HW surface locking
+ #$app->lock() if $app->lockp();
+ #$app->unlock();
+ $app->flip if $settings{flip};
+
+ ################################################
+ # do some drawing
+
+ $app->fill($app_rect, $background);
+
+ $angle += 16;
+
+ put_sprite_rotated($sprite,
+ $settings{screen_width}/2, $settings{screen_height}/2,
+ $angle, $zoom, $smooth);
+
+ }
+ print "Cache entries: " . scalar(keys %rotate_cache) . "\n";
+}
+
+
+
+## Main program loop
+
+get_cmd_args();
+set_app_args();
+init_game_context();
+instruments();
+game_loop();
+exit(0);
+
--- /dev/null
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use SDL;
+use SDL::Surface;
+use SDL::App;
+use SDL::Tool::Graphic;
+
+my $app = new SDL::App(-title => "Graphic Tool Test",
+ -width => 640,
+ -height => 480,
+ -depth => 16,
+ -fullscreen => 0);
+my $app_rect = new SDL::Rect( -x=>0,
+ -y=>0,
+ -width=>$app->width,
+ -height=>$app->height);
+
+my $sprite = new SDL::Surface(-name => "data/logo.png");
+$sprite->display_format();
+
+#Test Zoom
+my $graphicTool = new SDL::Tool::Graphic();
+$graphicTool->zoom($sprite, .5, .5, 1);
+
+my $sprite_rect = new SDL::Rect( -x=>0,
+ -y=>0,
+ -width=>$sprite->width,
+ -height=>$sprite->height);
+$sprite->blit($sprite_rect, $app, $sprite_rect);
+$app->flip();
+sleep 4;
+$app->fill($app_rect, $SDL::Color::black);
+
+
+#Test Rotate
+$graphicTool->rotoZoom($sprite, 90, 1, 1);
+
+$sprite_rect = new SDL::Rect( -x=>0,
+ -y=>0,
+ -width=>$sprite->width,
+ -height=>$sprite->height);
+$sprite->blit($sprite_rect, $app, $sprite_rect);
+$app->flip();
+sleep 4;
+
++print "GrayScaling\n";
++$app->fill($app_rect, $SDL::Color::black);
+
+#Test GrayScale
+$graphicTool->grayScale($sprite);
+
+$sprite->blit($sprite_rect, $app, $sprite_rect);
+$app->flip();
+sleep 4;
+
+
+
--- /dev/null
+#!/usr/bin/env perl
+#
+#
+# testjoystick.pl
+#
+# adapted from SDL-1.2.x/test/testjoystick.c
+
+use strict;
+#use warnings;
+
+use SDL;
+use SDL::App;
+use SDL::Rect;
+use SDL::Event;
+
+
+sub WatchJoystick($){
+ (my $joystick) = @_;
+ my $screenWidth = 640;
+ my $screenHeight = 480;
+
+ my $app = new SDL::App(-title => "Joystick Test",
+ -width => $screenWidth,
+ -height => $screenHeight,
+ -depth=> 16 );
+ #Print information about the joystick we are watching
+ my $name = SDL::JoystickName(SDL::JoystickIndex($joystick));
+ print "Watching joystick ".SDL::JoystickIndex($joystick).
+ ": (".($name ? $name : "Unknown Joystick" ).")\n";
+ print "Joystick has ".SDL::JoystickNumAxes($joystick)." axes, ".
+ SDL::JoystickNumHats($joystick)." hats, ".
+ SDL::JoystickNumBalls($joystick)." balls, and ".
+ SDL::JoystickNumButtons($joystick)." buttons\n";
+
+ my $event = new SDL::Event;
+ my $done = 0;
+ my $colorWhite = new SDL::Color(-r=>255, -g=>255, -b=>255);
+ my $colorBlack = new SDL::Color();
+ my @axisRect = ();
+ my $numAxes=SDL::JoystickNumAxes($joystick);
+
+
+ while(!$done)
+ {
+ while($event->poll())
+ {
+ if($event->type() eq SDL::JOYAXISMOTION())
+ {
+ print "Joystick ".SDL::JoyAxisEventWhich($$event).
+ " axis ".SDL::JoyAxisEventAxis($$event).
+ " value: ".SDL::JoyAxisEventValue($$event)."\n";
+ }
+ elsif($event->type() eq SDL::JOYHATMOTION())
+ {
+ print "Joystick ".SDL::JoyHatEventWhich($$event).
+ " hat ".SDL::JoyHatEventHat($$event);
+ if(SDL::JoyHatEventValue($$event) == SDL::HAT_CENTERED() )
+ {
+ print " centered";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_UP() ) {
+ print " up";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_RIGHT() ) {
+ print " right";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_DOWN() ) {
+ print " down";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_LEFT()) {
+ print " left";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_RIGHTUP() ) {
+ print " right & up";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_RIGHTDOWN() ) {
+ print " right & down";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_LEFTDOWN() ) {
+ print " left & down";
+ } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_LEFTUP()) {
+ print " left & up";
+ }
+ print "\n";
+ } elsif($event->type() eq SDL::JOYBALLMOTION()){
+ print "Joystick ".SDL::JoyBallEventWhich($$event).
+ " ball ".SDL::JoyBallEventBall($$event).
+ " delta: (".SDL::JoyBallEventXrel($$event).
+ ",".SDL::JoyBallEventYrel($$event)."\n";
+ } elsif($event->type() eq SDL::JOYBUTTONDOWN()){
+ print "Joystick ".SDL::JoyButtonEventWhich($$event).
+ " button ".SDL::JoyButtonEventButton($$event)." down\n";
+ } elsif($event->type() eq SDL::JOYBUTTONUP()){
+ print "Joystick ".SDL::JoyButtonEventWhich($$event).
+ " button ".SDL::JoyButtonEventButton($$event)." up\n";
+ } elsif($event->type() eq SDL_QUIT() or
+ ($event->type() eq SDL_KEYDOWN() and
+ $event->key_sym() == SDLK_ESCAPE)){
+ $done = 1;
+ }
+
+
+
+ #Update visual joystick state
+ for(my $i =0; $i < SDL::JoystickNumButtons($joystick); $i++)
+ {
+ my $rect = new SDL::Rect( -width => 32,
+ -height => 32,
+ -x => $i*34,
+ -y => $screenHeight-34);
+ if(SDL::JoystickGetButton($joystick, $i) eq SDL::PRESSED())
+ {
+ $app->fill($rect, $colorWhite);
+ } else {
+ $app->fill($rect, $colorBlack);
+ }
+ $app->update($rect);
+ }
+
+
+ for (my $i = 0; $i < $numAxes; $i+=1)
+ {
+ #Remove previous axis box
+ if($axisRect[$i]){
+ $app->fill($axisRect[$i], $colorBlack);
+ $app->update($axisRect[$i]);
+ }
+ # Draw the axis
+ my $ox = SDL::JoystickGetAxis($joystick, $i);
+ my $x= abs ($ox/256);
+ if( $x < 0) {
+ $x=0;
+ } elsif ( $x > ($screenWidth-16) ){
+ $x = $screenWidth-16;
+ }
+
+
+ if ($ox < 0)
+ {
+ $axisRect[$i] = new SDL::Rect( -width=> $x,
+ -height=> 32,
+ -x => ($screenWidth/2) - $x,
+ -y => $i*34
+ );
+ }
+ else
+ {
+ $axisRect[$i] = new SDL::Rect( -width=> $x,
+ -height=> 32,
+ -x => $screenWidth/2 ,
+ -y => $i*34
+ );
+ }
+
+
+ $app->fill($axisRect[$i], $colorWhite);
+ $app->update($axisRect[$i]);
+ }
+ }
+ }
+ }
+
+die "Could not initialize SDL: ", SDL::GetError()
+ if( 0 > SDL::Init(SDL_INIT_JOYSTICK()));
+
+printf "There are %d joysticks attched\n", SDL::NumJoysticks();
+for(my $i = 0; $i < SDL::NumJoysticks(); $i++){
+ my $name = SDL::JoystickName($i);
+ print "Joystick ".$i.": ".($name ? $name : "Unknown Joystick")."\n";
+}
+
+if ( $ARGV[0] ne undef){
+ my $joystick = SDL::JoystickOpen($ARGV[0]);
+ if(!$joystick){
+ print "Couldn't open joystick ".$ARGV[0].": ".SDL::GetError()."\n";
+ } else {
+ WatchJoystick($joystick);
+ SDL::JoystickClose($joystick);
+ }
+ SDL::QuitSubSystem(SDL_INIT_JOYSTICK());
+}
+
+
+exit;
+
+sub draw_axis_method_2()
+{
+}
+
+__DATA__
+sub draw_axis_method_1()
+{
+ for (my $i = 0; $i < ($numAxes/2); $i+=2)
+ {
+ #Remove previous axis box
+ if($axisRect[$i]){
+ $app->fill($axisRect[$i], $colorBlack);
+ $app->update($axisRect[$i]);
+ }
+ # Draw the X/Y axis
+ my $x = SDL::JoystickGetAxis($joystick, $i)+32768;
+ $x *= $screenWidth;
+ $x /= 65535;
+ if( $x < 0) {
+ $x=0;
+ } elsif ( $x > ($screenWidth-16) ){
+ $x = $screenWidth-16;
+ }
+ my $y = SDL::JoystickGetAxis($joystick, $i+1)+32768;
+ $y *= $screenHeight;
+ $y /= 65535;
+ if( $y < 0) {
+ $y=0;
+ } elsif ( $y > ($screenHeight-16) ){
+ $y = $screenHeight-16;
+ }
+ $axisRect[$i] = new SDL::Rect( -width=> 16,
+ -height=> 16,
+ -x => $x,
+ -y => $y);
+ $app->fill($axisRect[$i], $colorWhite);
+ $app->update($axisRect[$i]);
+ }
+ }
+
+}
--- /dev/null
+#!/usr/bin/env perl
+
+use SDL;
+use SDL::App;
+use SDL::Surface;
+use SDL::Rect;
+use SDL::Event;
+
+my $menu = new SDL::Surface -name => 'data/menu.png';
+
+my $app = new SDL::App -w => $menu->width(), -h => $menu->height(), -resizeable => 1;
+
+my $hilight = new SDL::Surface -name => 'data/highlight.png';
+
+my %menu = (
+ 'start' => [ 115, 30, 160, 40 ],
+ 'help' => [ 120, 100, 120, 40 ],
+ 'giveup' => [ 120, 230, 120, 40 ],
+ 'spawnserver' => [ 115, 170, 165, 40 ],
+ 'credits' => [ 115, 285, 160, 40 ],
+);
+
+my $needblit;
+sub drawMenu {
+ my ($a,$dx,$dy,$no,$hi,%m) = @_;
+ for (keys %m) {
+ my ($x,$y,$w,$h) = @{$m{$_}};
+ next unless $dx >= $x && $dx <= $x+$w
+ && $dy >= $y && $dy <= $y+$h;
+ unless ($needblit) {
+ my $rect = new SDL::Rect -w => $w, -h => $h,
+ -x => $x, -y => $y;
+ $hi->blit($rect,$a,$rect);
+ $needblit = 1;
+ }
+ return $_;
+ }
+ $no->blit(NULL,$a,NULL) if $needblit;
+ $needblit = 0;
+ return 0;
+}
+
+sub help {
+ print STDERR <<USAGE;
+This should print a help message
+
+USAGE
+
+}
+
+sub credits {
+ print STDERR <<CREDITS;
+David J. Goehrig
+
+CREDITS
+
+}
+
+sub spawnserver {
+ print STDERR <<SPAWN;
+Spawinging new server...
+
+SPAWN
+
+}
+
+sub start {
+ print STDERR <<START;
+This should start the game
+
+START
+
+}
+
+sub giveup {
+ print STDERR <<GIVEUP;
+Giving up
+
+GIVEUP
+
+ exit(0);
+}
+
+my %events = (
+ SDL_MOUSEMOTION() => sub {
+ my ($e) = @_;
+ drawMenu($app,
+ $e->motion_x(),
+ $e->motion_y(),
+ $menu,
+ $hilight,
+ %menu);
+ },
+ SDL_MOUSEBUTTONUP() => sub {
+ my ($e) = @_;
+ my $routine = drawMenu($app,
+ $e->motion_x(),
+ $e->motion_y(),
+ $menu,
+ $hilight,
+ %menu);
+ &{$routine} if ($routine);
+ },
+ SDL_QUIT() => sub { exit(0); },
+ SDL_KEYDOWN() => sub {
+ my ($e) = @_;
+ exit(0) if ($e->key_sym() == SDLK_ESCAPE);
+ },
+);
+
+$menu->blit(NULL,$app,NULL);
+$app->sync();
+$app->loop(\%events);
+
+
--- /dev/null
+#!/usr/bin/env perl
+#
+# testspite.pl
+#
+# adapted from SDL-1.2.x/test/testsprite.c
+
+# Usage: testsprite.pl [-bpp N] [-hw] [-flip] [-fast] [-fullscreen] [numsprites]
+
+use strict;
+use Getopt::Long;
+use Data::Dumper;
+
+use SDL;
+use SDL::App;
+use SDL::Event;
+use SDL::Surface;
+use SDL::Color;
+use SDL::Rect;
+
+use vars qw/ $app $app_rect $background $event $sprite $sprite_rect $videoflags /;
+
+## User tweakable settings (via cmd-line)
+my %settings = (
+ 'numsprites' => 75,
+ 'screen_width' => 640,
+ 'screen_height' => 480,
+ 'video_bpp' => 8,
+ 'fast' => 0,
+ 'hw' => 0,
+ 'flip' => 1,
+ 'fullscreen' => 0,
+ 'bpp' => undef,
+);
+
+## Process commandline arguments
+
+sub get_cmd_args
+{
+ GetOptions("width:i" => \$settings{screen_width},
+ "height:i" => \$settings{screen_height},
+ "bpp:i" => \$settings{bpp},
+ "fast!" => \$settings{fast},
+ "hw!" => \$settings{hw},
+ "flip!" => \$settings{flip},
+ "fullscreen!" => \$settings{fullscreen},
+ "numsprites=i" => \$settings{numsprites},
+ );
+}
+
+## Initialize application options
+
+sub set_app_args
+{
+ $settings{bpp} ||= 8; # default to 8 bits per pix
+
+ $videoflags |= SDL_HWACCEL if $settings{hw};
+ $videoflags |= SDL_DOUBLEBUF if $settings{flip};
+ $videoflags |= SDL_FULLSCREEN if $settings{fullscreen};
+}
+
+## Setup
+
+sub init_game_context
+{
+ $app = new SDL::App (
+ -width => $settings{screen_width},
+ -height=> $settings{screen_height},
+ -title => "testsprite",
+ -icon => "data/icon.bmp",
+ -flags => $videoflags,
+ );
+
+ $app_rect= new SDL::Rect(
+ -height => $settings{screen_height},
+ -width => $settings{screen_width},
+ );
+
+ $background = $SDL::Color::black;
+
+ $sprite = new SDL::Surface(-name =>"data/icon.bmp");
+
+ # Set transparent pixel as the pixel at (0,0)
+
+ $sprite->display_format();
+
+ $sprite->set_color_key(SDL_SRCCOLORKEY,$sprite->pixel(0,0)); # sets the transparent color to that at (0,0)
+
+
+ $sprite_rect = new SDL::Rect(-x => 0,
+ -y => 0,
+ -width => $sprite->width,
+ -height=> $sprite->height,
+ );
+
+ $event = new SDL::Event();
+}
+
+## Prints diagnostics
+
+sub instruments
+{
+ if ( ($app->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Screen is in video memory\n");
+ } else {
+ printf("Screen is in system memory\n");
+ }
+
+ if ( ($app->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ printf("Screen has double-buffering enabled\n");
+ }
+
+ if ( ($sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Sprite is in video memory\n");
+ } else {
+ printf("Sprite is in system memory\n");
+ }
+
+ # Run a sample blit to trigger blit (if posssible)
+ # acceleration before the check just after
+ put_sprite(0,0);
+
+ if ( ($sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ printf("Sprite blit uses hardware acceleration\n");
+ }
+ if ( ($sprite->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ printf("Sprite blit uses RLE acceleration\n");
+ }
+
+}
+
+
+
+
+sub put_sprite
+{
+ my ($x,$y) = @_;
+
+ my $dest_rect = new SDL::Rect(-x => $x,
+ -y => $y,
+ -width => $sprite->width,
+ -height => $sprite->height,
+ );
+ $sprite->blit($sprite_rect, $app, $dest_rect);
+}
+
+
+
+sub game_loop
+{
+ my $x=0;
+ my $y=$settings{screen_height}>>1;
+ my $i=0;
+
+ while (1)
+ {
+ # process event queue
+ $event->pump;
+ $event->poll;
+ my $etype=$event->type;
+
+ # handle user events
+ last if ($etype eq SDL_QUIT );
+ last if (SDL::GetKeyState(SDLK_ESCAPE));
+
+ #$app->lock() if $app->lockp();
+
+ # page flip
+
+ # __draw gfx
+
+ $app->fill($app_rect, $background);
+
+ foreach (1..$settings{numsprites})
+ {
+ put_sprite( $_*8, $y + (sin(($i+$_)*0.2)*($settings{screen_height}/3)));
+ }
+ $i+=30;
+
+ # __graw gfx end
+ #$app->unlock();
+ $app->flip if $settings{flip};
+ }
+}
+
+## Main program loop
+
+get_cmd_args();
+set_app_args();
+init_game_context();
+instruments();
+game_loop();
+exit(0);
+
--- /dev/null
+#!/usr/bin/env perl
+
+use SDL;
+use SDL::Timer;
+
+die "usage: $0\n" if in($ARGV[0], qw/ -? -h --help/);
+
+SDL::Init(SDL_INIT_EVERYTHING());
+
+print STDERR "Waiting 4 seconds\n";
+SDL::Delay(4000);
+
+$a = new SDL::Timer sub { my $timer = shift;
+ print STDERR "Timer A: $$timer{-times} runs\n" },
+ -delay => 1000,
+ -times => 10;
+
+$b = new SDL::Timer sub { print STDERR "Timer B: ", ++$i,"\n" }, -delay => 3000;
+
+$c = new SDL::Timer sub { print STDERR "Timer C: restarting Timer A\n"; $a->run(1000,10) },
+ -delay => 19000,
+ -times => 1;
+
+SDL::Delay(30000);
+
+print STDERR "Cleaning up...\n";
+SDL::Delay(300);
+
+SDL::Quit();
+
--- /dev/null
+TYPEMAP
+const Uint16 * T_PTR
+Uint8 T_U_CHAR
+Uint8 * T_PTR
+Uint8 ** T_PTR
+Uint16 T_UV
+Uint16 * T_PTR
+Uint32 T_UV
+Uint32 * T_PTR
+SDLKey T_UV
+Sint16 T_IV
+Sint16 * T_PTR
+Sint32 T_IV
+Sint32 * T_PTR
+SDL_Event * T_PTR
+SDL_Surface * T_PTR
+SDL_SysWMmsg * T_PTR
+SDL_CD * T_PTR
+SDL_CDtrack * T_PTR
+SDL_TimerCallback T_PTR
+SDL_Rect * T_PTR
+SDL_Color * T_PTR
+SDL_Palette * T_PTR
+SDL_PixelFormat * T_PTR
+SDL_Cursor * T_PTR
+SDL_AudioSpec * T_PTR
+SDL_AudioCVT * T_PTR
+Mix_Fading T_UV
+Mix_Chunk * T_PTR
+Mix_Music * T_PTR
+SDL_GLattr T_IV
+int * T_PTR
+void * T_PTR
+SDL_TimerID T_PTR
+SDL_NewTimerCallback T_PTR
+SDL_Joystick * T_PTR
+SDLNet_SocketSet T_PTR
+TCPsocket T_PTR
+UDPsocket T_PTR
+UDPpacket * T_PTR
+UDPpacket ** T_PTR
+IPaddress* T_PTR
+SDLNet_GenericSocket T_PTR
+TTF_Font * T_PTR
+SDL_Overlay * T_PTR
+SMPEG_Info * T_PTR
+SMPEG * T_PTR
+SMPEGstatus T_IV
+SDL_mutex * T_PTR
+GLbitfield T_IV
+GLenum T_IV
+ConsoleInformation * T_PTR
+GLboolean T_U_CHAR
+GLUnurbsObj * T_PTR
+GLUtesselator * T_PTR
+GLuint T_UV
+GLint* T_PTR
+float * T_PTR
+float T_NV
+GLfloat T_NV
+Sound_DecoderInfo * T_PTR
+const Sound_DecoderInfo * T_PTR
+Sound_Sample * T_PTR
+Sound_AudioInfo * T_PTR