From: Kartik Thakore Date: Tue, 4 Aug 2009 22:17:02 +0000 (-0400) Subject: Applied patch ready for merge X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b6a53a1f5064ca5b8ab0243f7bcf6209e6bf5a4;p=sdlgit%2FSDL_perl.git Applied patch ready for merge --- diff --git a/Build.PL b/Build.PL index 6bed354..c841997 100644 --- a/Build.PL +++ b/Build.PL @@ -1,8 +1,33 @@ -#! perl -w +#!/usr/bin/env perl # -# Copyright (C) 2003 chromatic -# Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# Build.PL +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + use strict; use warnings; @@ -11,7 +36,6 @@ use lib 'make/lib'; use SDL::Build; use YAML; -use YAML::Node; my $sdl_compile_flags = `sdl-config --cflags`; my $sdl_link_flags = `sdl-config --libs`; @@ -37,22 +61,22 @@ my %subsystems = SDL => { file => { from => 'src/SDL.xs', - to => './SDL_perl.xs', + to => 'src/SDL_perl.xs', }, - libraries => [qw( SDL SDL_image SDL_mixer SDL_net SDL_ttf SDL_gfx - png jpeg smpeg )], + libraries => [qw( SDL SDL_image SDL_mixer SDL_sound SDL_net SDL_ttf + SDL_gfx SDL_svg png jpeg smpeg )], }, OpenGL => { file => { from => 'src/OpenGL.xs', - to => 'SDL/OpenGL.xs', + to => 'src/SDL/OpenGL.xs', }, libraries => [qw( SDL GL GLU )], }, SFont => { file => { from => 'src/SFont.xs', - to => 'SDL/SFont.xs', + to => 'src/SDL/SFont.xs', }, libraries => [qw( SDL SDL_image )], }, @@ -71,6 +95,10 @@ my %libraries = ( define => 'HAVE_SDL_MIXER', header => 'SDL_mixer.h' }, + SDL_sound => { + define => 'HAVE_SDL_SOUND', + header => 'SDL_sound.h' + }, SDL_net => { define => 'HAVE_SDL_NET', header => 'SDL_net.h' @@ -83,6 +111,10 @@ my %libraries = ( define => 'HAVE_SDL_GFX', header => 'SDL_gfxPrimitives.h' }, + SDL_svg => { + define => 'HAVE_SDL_SVG', + header => 'SDL_svg.h' + }, png => { define => 'HAVE_PNG', header => 'png.h', @@ -109,6 +141,8 @@ my %libraries = ( # see build/lib/SDL/Build/*pm my $arch = SDL::Build->get_arch( $^O ); +print "[Build.PL] arch $arch\n"; + # see which subsystems can be built -- do we have headers for them? my $build_systems = $arch->find_subsystems( \%subsystems, \%libraries ); @@ -116,15 +150,18 @@ my $build_systems = $arch->find_subsystems( \%subsystems, \%libraries ); $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 ); +my $defines = $arch->build_defines( \%libraries, $build_systems ); +my $includes = $arch->build_includes( \%libraries, $build_systems ); +my $links = $arch->build_links( \%libraries, $build_systems ); +my $c_sources = $arch->build_c_sources( \%libraries, $build_systems ); +my $c_source = $arch->build_c_source( \%libraries, $build_systems ); +my $install_base = $arch->build_install_base( \%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( - module_name => 'SDL', dist_name => 'SDL_Perl', license => 'lgpl', dist_version_from => 'lib/SDL.pm', @@ -137,9 +174,11 @@ my $build = SDL::Build->new( { 'Pod::ToDemo' => '0.20', }, - c_source => 'src', + c_source => $c_source, + c_sources => $c_sources, xs_files => \%xs, dist_author => 'David J. Goehrig ', + install_base => $install_base ); # and here's where the real (and ugly) magic works... see SDL::Build diff --git a/CHANGELOG b/CHANGELOG index 4804b02..95d64ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,14 +1,27 @@ Revision history for Perl extension SDL_perl. -* Aug 2 2009 Kartik Thakore - - Added patches - - Verified and Tested patches - - Clean bugs -* Mar 3 2006 Tels 77 Tests - - Color.pm: add rgb(), and make new($r,$g,$b) work for speed - - add ColorRGB() to src/SDL.xs +* Jul 8 2006 David J. Goehrig + - finished embedding data in example scripts + - fixed Mac OS X file associations -* Oct 4 2004 David J. Goehrig +* Mar 15 2006 David J. Goehrig + - fixed OpenGL examples to work under MacOS X using the SDL Perl.app bundle + +* Oct 12 2005 David J. Goehrig + - Fixed bug where SDL::App frees underlying Surface via DESTROY + - Added SDL_svg support + - cleaned up SDL_gfx support in SDL.xs + - cleaned up smpeg support in SDL.xs + - Added more SDL_sound support + - Added basic SDL_RWops support (TODO - perl callback for user defined) + +* Oct 6 2005 David J. Goehrig + - Changed constructors to die upon invalid initialization + +* Oct 5 2005 David J. Goehrig + - Updated the copyright notices as per the LGPL guidelines + +* Oct 4 2005 David J. Goehrig - Patched Cygwin.pm - Fixed SDL::Rect documentation - Fixed Freebsd build module package designation diff --git a/META.yml b/META.yml index e4cb842..0e83a56 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SDL_Perl -version: 2.1.3 +version: 2.2.0 author: - David J. Goehrig abstract: Simple DirectMedia Layer for Perl @@ -11,7 +11,7 @@ build_requires: provides: SDL: file: lib/SDL.pm - version: 2.1.3 + version: 2.2.0 SDL::App: file: lib/SDL/App.pm SDL::Cdrom: @@ -46,8 +46,6 @@ provides: 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: @@ -58,12 +56,14 @@ provides: 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::Tutorial:Drawing: + file: lib/SDL/Tutorial/Drawing.pm SDL::Video: file: lib/SDL/Video.pm + SDL:TTFont: + file: lib/SDL/TTFont.pm SDL_perl: file: lib/SDL_perl.pm Walker: diff --git a/README b/README index e3902cd..cd87cf5 100644 --- a/README +++ b/README @@ -1,19 +1,72 @@ -README for SDL_Perl-2.2 +README for SDL_Perl-2.2.0 -First step is to make SDL perl pass all tests in -t/. +What's New in 2.2.0: -I will add these as a issue. +SDL_Perl-2.2.0 adds support for a few new modules, fixes a few more +bugs, and improves the error handling of the object layer. Additional +support for SDL_sound, SDL_svg, and SDL_vnc has been added. In the +OO layer, all constructors now die when they fail to construct an object +with a valid underlying datastructure pointer. -Simple Run: -perl Build.PL -perl Build -perl Build test -perl Build install +Prerequisites: -There are more test scripts in test/ +SDL Perl recommends installing the following libraries available +from http://www.libsdl.org/ prior to installing: -Disclaimer: This might be moved to CPAN when I get access + SDL-1.2.8 + smpeg-0.4.5 + SDL_image-1.2.4 + SDL_mixer-1.2.6 + SDL_sound-1.0.1 + SDL_net-1.2.5 + SDL_gfx-2.0.13 + SDL_ttf-2.0.7 + SDL_svg-1.1.9 + SDL_vnc-1.0.0 + +Additionally the following Perl modules should be installed: + + Module-Build-0.22 + Test-Simple-0.62 + +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 -kthakore -1 August 2009 diff --git a/TODO b/TODO index 50bbfcd..b7f85ef 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,10 @@ TODO for SDL_perl o Add SDL_EventFilter support + o fix OpenGL build without glu.h + o fix openFile: support on Mac (SDL patch) + o add Windows application bundle support + o add Linux application bundle support + o add embedded media module diff --git a/lib/SDL.pm b/lib/SDL.pm index 0fdf435..6f012ba 100644 --- a/lib/SDL.pm +++ b/lib/SDL.pm @@ -1,5 +1,31 @@ +#!/usr/bin/env perl # -# Copyright (C) 2004 David J. Goehrig +# SDL.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # Copyright (C) 2009 Kartik Thakore package SDL; @@ -19,14 +45,10 @@ 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'; +$VERSION = '2.2.1'; print "$VERSION" if (defined($ARGV[0]) && ($ARGV[0] eq '--SDLperl')); @@ -76,7 +98,6 @@ the C subroutine. This routine takes a mode flag constructed through the bitwise OR product of the following functions: =over 4 - =item * INIT_AUDIO() diff --git a/lib/SDL/App.pm b/lib/SDL/App.pm index 6a3fa1f..b35d41e 100644 --- a/lib/SDL/App.pm +++ b/lib/SDL/App.pm @@ -1,10 +1,33 @@ -# App.pm +#!/usr/bin/env perl # -# The application object, sort of like a surface +# App.pm # -# Copyright (C) 2000,2002,2003,2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# Copyright (C) 2005 David J. Goehrig # +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::App; use strict; @@ -15,6 +38,10 @@ use SDL::Event; use SDL::Surface; use SDL::Rect; +sub DESTROY { + +} + our @ISA = qw(SDL::Surface); sub new { @@ -29,13 +56,10 @@ sub new { -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 -init + -asyncblit / ) if ($SDL::DEBUG); - # SDL_INIT_VIDEO() is 0, so check defined instead of truth. - my $init = defined $options{-init} ? $options{-init} : SDL_INIT_EVERYTHING(); - - SDL::Init($init); + SDL::Init(SDL::SDL_INIT_EVERYTHING()); my $t = $options{-title} || $options{-t} || $0; my $it = $options{-icon_title} || $options{-it} || $t; @@ -64,26 +88,26 @@ sub new { $f |= SDL::SDL_DOUBLEBUF() if ($db); $f |= SDL::SDL_ASYNCBLIT() if ($async); - if ($f & SDL_OPENGL()) { + if ($f & SDL::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::SDL_GL_RED_SIZE(),$r) if ($r); + SDL::GLSetAttribute(SDL::SDL_GL_GREEN_SIZE(),$g) if ($g); + SDL::GLSetAttribute(SDL::SDL_GL_BLUE_SIZE(),$b) if ($b); + SDL::GLSetAttribute(SDL::SDL_GL_ALPHA_SIZE(),$a) if ($a); + + SDL::GLSetAttribute(SDL::SDL_GL_RED_ACCUM_SIZE(),$ras) if ($ras); + SDL::GLSetAttribute(SDL::SDL_GL_GREEN_ACCUM_SIZE(),$gas) if ($gas); + SDL::GLSetAttribute(SDL::SDL_GL_BLUE_ACCUM_SIZE(),$bas) if ($bas); + SDL::GLSetAttribute(SDL::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); + SDL::GLSetAttribute(SDL::SDL_GL_DOUBLEBUFFER(),$db) if ($db); + SDL::GLSetAttribute(SDL::SDL_GL_BUFFER_SIZE(),$bs) if ($bs); + SDL::GLSetAttribute(SDL::SDL_GL_DEPTH_SIZE(),$d); } else { $SDL::App::USING_OPENGL = 0; } - my $self = \SDL::SetVideoMode($w,$h,$d,$f); - $$self + + my $self = \SDL::SetVideoMode($w,$h,$d,$f) or croak SDL::GetError(); if ($ic and -e $ic) { @@ -102,7 +126,7 @@ sub resize ($$$) { my $flags = SDL::SurfaceFlags($$self); if ( $flags & SDL::SDL_RESIZABLE()) { my $bpp = SDL::SurfaceBitsPerPixel($$self); - $$self = SDL::SetVideoMode($w,$h,$bpp,$flags); + $self = \SDL::SetVideoMode($w,$h,$bpp,$flags); } } diff --git a/lib/SDL/Cdrom.pm b/lib/SDL/Cdrom.pm index 1ad2471..d7fcbfc 100644 --- a/lib/SDL/Cdrom.pm +++ b/lib/SDL/Cdrom.pm @@ -1,8 +1,31 @@ -# Cdrom.pm +#!/usr/bin/env perl # -# a SDL cdrom manipluation module +# Cdrom.pm # -# Copyright (C) 2000,2002 David J. Goehrig +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL::Cdrom; diff --git a/lib/SDL/Color.pm b/lib/SDL/Color.pm index 6a8f36f..287a3ca 100644 --- a/lib/SDL/Color.pm +++ b/lib/SDL/Color.pm @@ -1,8 +1,32 @@ -# Color.pm +#!/usr/bin/env perl # -# A package for manipulating SDL_Color * +# Color.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2002,2003,2004 David J. Goehrig package SDL::Color; @@ -14,11 +38,8 @@ use SDL; sub new { my $proto = shift; my $class = ref($proto) || $proto; - - # called like SDL::Color->new($red,$green,$blue); - return bless \SDL::NewColor(@_), $class if (@_ == 3); - my $self; + my (%options) = @_; verify (%options, qw/ -color -surface -pixel -r -g -b /) if $SDL::DEBUG; @@ -38,7 +59,8 @@ sub new { } croak "Could not create color, ", SDL::GetError(), "\n" unless ($$self); - bless $self, $class; + bless $self,$class; + return $self; } sub DESTROY { @@ -60,24 +82,19 @@ sub b { SDL::ColorB($$self,@_); } -sub rgb { - my $self = shift; - SDL::ColorRGB($$self,@_); -} - sub pixel { croak "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 = SDL::Color->new(0,0,0); -$SDL::Color::white = SDL::Color->new(255,255,255); -$SDL::Color::red = SDL::Color->new(255,0,0); -$SDL::Color::blue = SDL::Color->new(0,0,255); -$SDL::Color::green = SDL::Color->new(0,255,0); -$SDL::Color::purple = SDL::Color->new(255,0,255); -$SDL::Color::yellow = SDL::Color->new(255,255,0); +$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; @@ -91,8 +108,6 @@ SDL::Color - a SDL perl extension =head1 SYNOPSIS - $color = SDL::Color->new($red,$green,$blue); # fastest - $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); @@ -100,18 +115,13 @@ SDL::Color - a SDL perl extension =head1 DESCRIPTION C is a wrapper for display format independent color -representations. +representations, with the same interface as L. =head2 new ( -color => ) C with a C<-color> option will construct a new object referencing the passed SDL_Color*. -=head2 new ($r, $g, $b) - -C with three color values will construct both a SDL_Color -structure, and the associated object with the specified values. - =head2 new (-r => , -g => , -b => ) C with C<-r,-g,-b> options will construct both a SDL_Color @@ -129,13 +139,6 @@ C 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 rgb ( $red, $green, $blue ) - -C is an accessor method for the red, green, and blue components -in one go. It will return a list of three values. - -The color value can be set by passing a byte value (0-255) for each color component. - =head2 pixel ( surface ) C takes a C object and r,g,b values, and @@ -145,10 +148,8 @@ returns the integer representation of the closest color for the given surface. David J. Goehrig -Additions by Tels 2006. - =head1 SEE ALSO -L and L. +L L =cut diff --git a/lib/SDL/Constants.pm b/lib/SDL/Constants.pm index c8445f0..fedd9d1 100644 --- a/lib/SDL/Constants.pm +++ b/lib/SDL/Constants.pm @@ -1,32 +1,35 @@ -# SDL::Constants +#!/usr/bin/env perl # -# This is an automatically generated file, don't bother editing +# Constants.pm # -# Copyright (C) 2003,2004 David J. Goehrig +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# 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 @@ -60,7 +63,6 @@ use vars qw( MIX_FADING_OUT MIX_MAX_VOLUME MIX_NO_FADING - MIX_CHANNEL_POST SDLK_0 SDLK_1 SDLK_2 @@ -294,10 +296,20 @@ use vars qw( UTF8_BLENDED UTF8_SHADED UTF8_SOLID + SDL_SVG_FLAG_DIRECT + SDL_SVG_FLAG_COMPOSITE + SDL_SAMPLEFLAG_NONE + SDL_SAMPLEFLAG_CANSEEK + SDL_SAMPLEFLAG_EOF + SDL_SAMPLEFLAG_ERROR + SDL_SAMPLEFLAG_EAGAIN ); +for (@EXPORT) { + *{"SDL::" . $_} = *{$_}; + *{"main::" . $_} = *{$_}; +} -__DATA__ sub AUDIO_S16 {32784} sub AUDIO_S16MSB {36880} sub AUDIO_S8 {32776} @@ -330,7 +342,6 @@ sub MIX_FADING_IN {2} sub MIX_FADING_OUT {1} sub MIX_MAX_VOLUME {128} sub MIX_NO_FADING {0} -sub MIX_CHANNEL_POST {2} sub SDLK_0 {48} sub SDLK_1 {49} sub SDLK_2 {50} @@ -564,4 +575,12 @@ sub UNICODE_SOLID {64} sub UTF8_BLENDED {32} sub UTF8_SHADED {16} sub UTF8_SOLID {8} +sub SDL_SVG_FLAG_DIRECT {0} +sub SDL_SVG_FLAG_COMPOSITE {1} +sub SDL_SAMPLEFLAG_NONE {0} +sub SDL_SAMPLEFLAG_CANSEEK {1} +sub SDL_SAMPLEFLAG_EOF {1<<29} +sub SDL_SAMPLEFLAG_ERROR {1<<30} +sub SDL_SAMPLEFLAG_EAGAIN {1<<31} +1; diff --git a/lib/SDL/Cursor.pm b/lib/SDL/Cursor.pm index 34598b7..a8aee2a 100644 --- a/lib/SDL/Cursor.pm +++ b/lib/SDL/Cursor.pm @@ -1,6 +1,31 @@ +#!/usr/bin/env perl +# # Cursor.pm # -# Copyright (C) 2000,2002 David J. Goehrig +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL::Cursor; @@ -15,6 +40,7 @@ sub new { verify (%options, qw/ -data -mask -x -y /) if $SDL::DEBUG; + die SDL::GetError() unless $$self; my $self = \SDL::NewCursor($options{-data},$options{-mask}, $options{-x},$options{-y}); bless $self, $class; diff --git a/lib/SDL/Event.pm b/lib/SDL/Event.pm index 00da15e..df0be5b 100644 --- a/lib/SDL/Event.pm +++ b/lib/SDL/Event.pm @@ -1,13 +1,35 @@ -# Event.pm +#!/usr/bin/env perl # -# A package for handling SDL_Event * +# Event.pm # -# Copyright (C) 2000,2001,2002 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore -# see the file COPYING for terms of use +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL::Event; + use strict; use warnings; use Carp; @@ -45,12 +67,6 @@ sub poll { return SDL::PollEvent($$self); } -sub peep($$$$) -{ - my ($event, $numEvents, $action, $mask) = @_; - return SDL::PeepEvents($$event, $numEvents, $action, $mask); -} - sub push { my $self = shift; return SDL::PushEvent($$self); @@ -231,25 +247,8 @@ available. =head2 pump() -Pumps the event loop, gathering events from the input devices. - =head2 poll() -Polls for currently pending events - -=head2 peep() - -Checks the event queue for messages and optionally returns them. - -If action is SDL_ADDEVENT, up to numevents events will be added to the back of the event queue. - -If action is SDL_PEEKEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will not be removed from the queue. - -If action is SDL_GETEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will be removed from the queue. - -The mask parameter is a bitwise OR of SDL_EVENTMASK(event_type), for all event types you are interested in - - =head2 wait() Waits for an event end returns then. Always returns true. diff --git a/lib/SDL/Font.pm b/lib/SDL/Font.pm index c49a982..6a8aeda 100644 --- a/lib/SDL/Font.pm +++ b/lib/SDL/Font.pm @@ -1,11 +1,35 @@ -# Font.pm +#!/usr/bin/env perl # -# a SDL perl extension for SFont support +# Font.pm # -# Copyright (C) David J. Goehrig 2000,2002 +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL::Font; + use strict; use warnings; use Carp; diff --git a/lib/SDL/MPEG.pm b/lib/SDL/MPEG.pm index bf16eab..50442bf 100644 --- a/lib/SDL/MPEG.pm +++ b/lib/SDL/MPEG.pm @@ -1,9 +1,32 @@ +#!/usr/bin/env perl # -# MPEG.pm +# MPEG.pm # -# A package for manipulating MPEG video +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2004 David J. Goehrig package SDL::MPEG; diff --git a/lib/SDL/Mixer.pm b/lib/SDL/Mixer.pm index 94d0fb4..593f47a 100644 --- a/lib/SDL/Mixer.pm +++ b/lib/SDL/Mixer.pm @@ -1,11 +1,35 @@ -# Mixer.pm +#!/usr/bin/env perl +# +# Mixer.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# a SDL module for manipulating the SDL_mixer lib. -# -# Copyright (C) 2000,2002 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore package SDL::Mixer; + use strict; use warnings; use Carp; @@ -127,12 +151,6 @@ sub music_volume ($$) { return SDL::MixVolumeMusic($volume); } -sub mix_set_panning($$$$) { - my ($self,$channel,$left,$right) = @_; - return SDL::MixSetPanning($channel,$left,$right); - } - - sub halt_channel ($$) { my ($self,$channel) = @_; return SDL::MixHaltChannel($channel); @@ -212,11 +230,6 @@ sub playing ($$) { return SDL::MixPlaying($channel); } -sub mix_volume_chunk($$$) { - my ($self, $chunk, $volume) = @_; - return SDL::MixVolumeChunk($chunk, $volume); -} - sub playing_music () { return SDL::MixPlayingMusic(); } @@ -396,17 +409,8 @@ Return true when the channel is currently playing. Return true when the music is currently playing. -=head2 sub mix_set_panning(channel,left,right) - -Set panning for mixer, Use MIX_CHANNEL_POST to process the postmix stream - -Volume for the left channel, range is 0(silence) to 255(loud) - -Volume for the right channel, range is 0(silence) to 255(loud) - =head1 AUTHORS -Kartik Thakore David J. Goehrig, basic doc added by Tels . =head1 SEE ALSO diff --git a/lib/SDL/Music.pm b/lib/SDL/Music.pm index d9b6f66..711c321 100644 --- a/lib/SDL/Music.pm +++ b/lib/SDL/Music.pm @@ -1,10 +1,35 @@ -# Music.pm +#!/usr/bin/env perl # -# a SDL_mixer data module +# Music.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2000,2002 David J. Goehrig package SDL::Music; + use strict; use warnings; use Carp; @@ -13,6 +38,7 @@ use SDL; sub new { my $proto = shift; my $class = ref($proto) || $proto; + die SDL::GetError() unless $$self; my $filename = shift; my $self = \SDL::MixLoadMusic($filename); bless $self,$class; diff --git a/lib/SDL/OpenGL.pm b/lib/SDL/OpenGL.pm index 4064186..9a849f2 100644 --- a/lib/SDL/OpenGL.pm +++ b/lib/SDL/OpenGL.pm @@ -1,8 +1,31 @@ -# SDL::OpenGL.pm +#!/usr/bin/env perl # -# A simplified OpenGL wrapper +# OpenGL.pm # -# Copyright (C) 2002, 2003, 2004 David J. Goehrig +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL::OpenGL; @@ -20,7 +43,6 @@ use vars qw( @ISA=qw(Exporter DynaLoader); use SDL; -use SDL::OpenGL::Constants; bootstrap SDL::OpenGL; @@ -30,11 +52,7 @@ for ( keys %SDL::OpenGL:: ) { } } -# export all GL constants -for (@SDL::OpenGL::Constants::EXPORT) { - push @EXPORT, $_; -} - +use SDL::OpenGL::Constants; 1; diff --git a/lib/SDL/OpenGL/Constants.pm b/lib/SDL/OpenGL/Constants.pm index 7d2c5d0..5a4223e 100644 --- a/lib/SDL/OpenGL/Constants.pm +++ b/lib/SDL/OpenGL/Constants.pm @@ -1,22 +1,35 @@ -# SDL::OpenGL::Constants +#!/usr/bin/env perl # -# This is an autogenerate file, don't bother editing +# Constants.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2003 David J. Goehrig 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 @@ -1585,7 +1598,11 @@ use vars qw( GL_ZOOM_Y ); -__DATA__ +for (@EXPORT) { + *{"SDL::" . $_} = *{$_}; + *{"main::" . $_} = *{$_}; +} + sub GLU_AUTO_LOAD_MATRIX {100200} sub GLU_CULLING {100201} sub GLU_DISPLAY_MODE {100204} @@ -3151,3 +3168,5 @@ sub GL_YCRYCB_422_NVX {0x600B} sub GL_ZERO {0} sub GL_ZOOM_X {0x0D16} sub GL_ZOOM_Y {0x0D17} + +1; diff --git a/lib/SDL/Palette.pm b/lib/SDL/Palette.pm index 40ea970..59868d9 100644 --- a/lib/SDL/Palette.pm +++ b/lib/SDL/Palette.pm @@ -1,9 +1,36 @@ +#!/usr/bin/env perl # -# Palette.pm +# Palette.pm # -# a module for manipulating SDL_Palette * +# Copyright (C) 2005 David J. Goehrig # -# Copyright (C) 2000,2002 David J. Goehrig +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + +# 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! package SDL::Palette; use strict; @@ -23,6 +50,7 @@ sub new { $image = shift; $self = \$image->palette(); } else { + die SDL::GetError() unless $$self; $self = \SDL::NewPalette(256); } bless $self, $class; diff --git a/lib/SDL/Rect.pm b/lib/SDL/Rect.pm index 13f05d2..298c03e 100644 --- a/lib/SDL/Rect.pm +++ b/lib/SDL/Rect.pm @@ -1,11 +1,35 @@ +#!/usr/bin/env perl # -# Rect.pm +# Rect.pm # -# A package for manipulating SDL_Rect * +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2003 David J. Goehrig package SDL::Rect; + use strict; use warnings; use Carp; @@ -22,6 +46,7 @@ sub new { my $y = $options{-y} || 0; my $w = $options{-width} || $options{-w} || 0; my $h = $options{-height} || $options{-h} || 0; + die SDL::GetError() unless $$self; my $self = \SDL::NewRect($x,$y,$w,$h); bless $self,$class; diff --git a/lib/SDL/SFont.pm b/lib/SDL/SFont.pm index 3ede187..3efe1e7 100644 --- a/lib/SDL/SFont.pm +++ b/lib/SDL/SFont.pm @@ -1,8 +1,32 @@ -# SDL::OpenGL.pm +#!/usr/bin/env perl # -# SFont bitmat font support +# SFont.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2004 David J. Goehrig package SDL::SFont; diff --git a/lib/SDL/Sound.pm b/lib/SDL/Sound.pm index 6b2eff6..28ebe56 100644 --- a/lib/SDL/Sound.pm +++ b/lib/SDL/Sound.pm @@ -1,9 +1,32 @@ +#!/usr/bin/env perl # -# Sound.pm +# Sound.pm # -# a SDL_mixer data module +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2000,2002 David J. Goehrig package SDL::Sound; use strict; @@ -13,6 +36,7 @@ sub new { my $proto = shift; my $class = ref($proto) || $proto; my $filename = shift; + die SDL::GetError() unless $$self; my $self = \SDL::MixLoadWAV($filename); bless $self,$class; return $self; diff --git a/lib/SDL/Surface.pm b/lib/SDL/Surface.pm index 95b07f1..16eaefb 100644 --- a/lib/SDL/Surface.pm +++ b/lib/SDL/Surface.pm @@ -1,9 +1,32 @@ +#!/usr/bin/env perl +# +# Surface.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. # -# Surface.pm +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: # -# A package for manipulating SDL_Surface * +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2003 David J. Goehrig package SDL::Surface; diff --git a/lib/SDL/TTFont.pm b/lib/SDL/TTFont.pm index ab9387e..5aab81e 100644 --- a/lib/SDL/TTFont.pm +++ b/lib/SDL/TTFont.pm @@ -1,8 +1,31 @@ -# TTFont.pm +#!/usr/bin/env perl # -# a SDL perl extension for SDL_ttf support +# TTFont.pm # -# Copyright (C) David J. Goehrig 2002 +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL::TTFont; @@ -23,7 +46,7 @@ sub new { my $self = {}; my %options; (%options) = @_; - $self->{-mode} = $options{-mode} || $options{-m} || TEXT_SHADED(); + $self->{-mode} = $options{-mode} || $options{-m} || SDL::TEXT_SHADED(); $self->{-name} = $options{-name} || $options{-n}; $self->{-size} = $options{-size} || $options{-s}; $self->{-fg} = $options{-foreground} || $options{-fg} || $SDL::Color::black; @@ -88,68 +111,68 @@ sub descent { sub normal { my ($self) = @_; - SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_NORMAL()); + SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_NORMAL()); } sub bold { my ($self) = @_; - SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_BOLD()); + SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_BOLD()); } sub italic { my ($self) = @_; - SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_ITALIC()); + SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_ITALIC()); } sub underline { my ($self) = @_; - SDL::TTFSetFontStyle($$self{-font},TTF_STYLE_UNDERLINE()); + SDL::TTFSetFontStyle($$self{-font},SDL::TTF_STYLE_UNDERLINE()); } sub text_shaded { my ($self) = @_; - $$self{-mode} = TEXT_SHADED(); + $$self{-mode} = SDL::TEXT_SHADED(); } sub text_solid { my ($self) = @_; - $$self{-mode} = TEXT_SOLID(); + $$self{-mode} = SDL::TEXT_SOLID(); } sub text_blended { my ($self) = @_; - $$self{-mode} = TEXT_BLENDED(); + $$self{-mode} = SDL::TEXT_BLENDED(); } sub utf8_shaded { my ($self) = @_; - $$self{-mode} = UTF8_SHADED(); + $$self{-mode} = SDL::UTF8_SHADED(); } sub utf8_solid { my ($self) = @_; - $$self{-mode} = UTF8_SOLID(); + $$self{-mode} = SDL::UTF8_SOLID(); } sub utf8_blended { my ($self) = @_; - $$self{-mode} = UTF8_BLENDED(); + $$self{-mode} = SDL::UTF8_BLENDED(); } sub unicode_shaded { my ($self) = @_; - $$self{-mode} = UNICODE_SHADED(); + $$self{-mode} = SDL::UNICODE_SHADED(); } sub unicode_solid { my ($self) = @_; - $$self{-mode} = UNICODE_SOLID(); + $$self{-mode} = SDL::UNICODE_SOLID(); } sub unicode_blended { my ($self) = @_; - $$self{-mode} = UNICODE_BLENDED(); + $$self{-mode} = SDL::UNICODE_BLENDED(); } croak "Could not initialize True Type Fonts\n" diff --git a/lib/SDL/Timer.pm b/lib/SDL/Timer.pm index aaacdd3..eea0f27 100644 --- a/lib/SDL/Timer.pm +++ b/lib/SDL/Timer.pm @@ -1,10 +1,35 @@ -# Timer.pm +#!/usr/bin/env perl # -# A package for manipulating SDL_Timer * +# Timer.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2002 David J. Goehrig package SDL::Timer; + use strict; use warnings; use Carp; diff --git a/lib/SDL/Tool/Font.pm b/lib/SDL/Tool/Font.pm index 637e5ab..f22be01 100644 --- a/lib/SDL/Tool/Font.pm +++ b/lib/SDL/Tool/Font.pm @@ -1,7 +1,32 @@ +#!/usr/bin/env perl # -# SDL::Tool::Font - format agnostic font tool +# Font.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2002 David J. Goehrig package SDL::Tool::Font; @@ -50,7 +75,7 @@ sub DESTROY { sub print { my ($self,$surface,$x,$y,@text) = @_; croak "Tool::Font::print requires a SDL::Surface\n" - unless ($surface->isa('SDL::Surface')); + unless ($SDL::DEBUG && $surface->isa('SDL::Surface')); if ($$self{-font}->isa('SDL::Font')) { $$self{-font}->use(); SDL::SFont::PutString( $$surface, $x, $y, join('',@text)); diff --git a/lib/SDL/Tool/Graphic.pm b/lib/SDL/Tool/Graphic.pm index 780fdc2..45b8278 100644 --- a/lib/SDL/Tool/Graphic.pm +++ b/lib/SDL/Tool/Graphic.pm @@ -1,8 +1,32 @@ +#!/usr/bin/env perl # -# SDL::GraphicTool - zooming and rotating graphic tool +# Graphic.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2002 Russell E. Valentine -# Copyright (C) 2002 David J. Goehrig package SDL::Tool::Graphic; diff --git a/lib/SDL/Tutorial.pm b/lib/SDL/Tutorial.pm index 6e3327a..6d151f7 100644 --- a/lib/SDL/Tutorial.pm +++ b/lib/SDL/Tutorial.pm @@ -1,6 +1,37 @@ +#!/usr/bin/env perl +# +# Tutorial.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Tutorial; -use Pod::ToDemo <<'END_HERE'; +use strict; +use SDL; use SDL::App; # change these values as necessary diff --git a/lib/SDL/Tutorial/Animation.pm b/lib/SDL/Tutorial/Animation.pm index 2edb675..16f8c84 100644 --- a/lib/SDL/Tutorial/Animation.pm +++ b/lib/SDL/Tutorial/Animation.pm @@ -1,6 +1,37 @@ +#!/usr/bin/env perl +# +# Animation.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Tutorial::Animation; -use Pod::ToDemo <<'END_HERE'; +use strict; +use SDL; use SDL::App; use SDL::Rect; use SDL::Color; diff --git a/lib/SDL/Tutorial/Drawing.pm b/lib/SDL/Tutorial/Drawing.pm index 5a4e750..c071306 100644 --- a/lib/SDL/Tutorial/Drawing.pm +++ b/lib/SDL/Tutorial/Drawing.pm @@ -1,6 +1,37 @@ -package SDL::Tutorial::Drawing; - -use Pod::ToDemo <<'END_HERE'; +#!/usr/bin/env perl +# +# Drawing.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + +package SDL::Tutorial:Drawing; + +use strict; +use SDL; use SDL::App; use SDL::Rect; use SDL::Color; diff --git a/lib/SDL/Tutorial/Images.pm b/lib/SDL/Tutorial/Images.pm index 0dca2e4..007b632 100644 --- a/lib/SDL/Tutorial/Images.pm +++ b/lib/SDL/Tutorial/Images.pm @@ -1,6 +1,37 @@ +#!/usr/bin/env perl +# +# Images.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Tutorial::Images; use strict; +use SDL; use warnings; my %images; diff --git a/lib/SDL/Video.pm b/lib/SDL/Video.pm index 516dd1f..001624c 100644 --- a/lib/SDL/Video.pm +++ b/lib/SDL/Video.pm @@ -1,9 +1,32 @@ +#!/usr/bin/env perl # -# Video.pm +# Video.pm # -# A package for manipulating MPEG video +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # -# Copyright (C) 2004 David J. Goehrig package SDL::Video; @@ -24,6 +47,7 @@ sub new { my $n = $options{-name} || croak "SDL::Video must supply a filename to SDL::Video::new\n"; my $a = $options{'-audio'} ? 1 : 0; my $info = new SDL::MPEG(); + die SDL::GetError() unless $$self; my $self = \SDL::NewSMPEG($n,$$info,$a); bless $self,$class; diff --git a/lib/SDL_perl.pm b/lib/SDL_perl.pm index 6498973..69c9559 100644 --- a/lib/SDL_perl.pm +++ b/lib/SDL_perl.pm @@ -1,5 +1,31 @@ +#!/usr/bin/env perl +# +# SDL_perl.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. # -# Copyright (C) 2004 David J. Goehrig +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL_perl; diff --git a/make/lib/SDL/Build.pm b/make/lib/SDL/Build.pm index 0186412..2d7aebb 100644 --- a/make/lib/SDL/Build.pm +++ b/make/lib/SDL/Build.pm @@ -1,6 +1,31 @@ +#!/usr/bin/env perl # -# Copyright (C) 2004 chromatic -# Copyright (C) 2004 David J. Goehrig +# Build.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org # package SDL::Build; @@ -19,14 +44,15 @@ use Config; 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 @@ -147,7 +173,7 @@ sub set_flags @{ $includes->{$subsystem} }, split(' ',$sdl_compile), @{ $defines->{$subsystem} }, - ( defined $Config{usethreads} ? ('-DUSE_THREADS', '-fPIC') : '-fPIC' ), + ( defined $Config{usethreads} ? ('-DUSE_THREADS', '-fPIC') : ('-fPIC' )), ], extra_linker_flags => [ @@ -200,4 +226,44 @@ sub write_sdl_config print $file $text; } +# Subclass Darwin to build Objective-C addons + +sub filter_support { + my $self = shift; + print STDERR "[SDL::Build] generic filter\n"; + return (); +} + +sub process_support_files { + my $self = shift; + my $p = $self->{properties}; + return unless $p->{c_source}; + return unless $p->{c_sources}; + + push @{$p->{include_dirs}}, $p->{c_source}; + unless ( $p->{extra_compiler_flags} && $p->{extra_compiler_flags} =~ /DARCHNAME/) { + $p->{extra_compiler_flags} .= " -DARCHNAME=" . $self->{config}{archname}; + } + print STDERR "[SDL::Build] extra compiler flags" . $p->{extra_compiler_flags} . "\n"; + + foreach my $file (map($p->{c_source} . "/$_", @{$p->{c_sources}})) { + push @{$p->{objects}}, $self->compile_c($file); + } +} + +# Override to create a MacOS Bundle +sub build_bundle +{ + return; +} + +# Override Install method for darwin +sub ACTION_install { + my ($self) = @_; + require ExtUtils::Install; + $self->depends_on('build'); + $self->get_arch($^O)->build_bundle(); + ExtUtils::Install::install($self->install_map, 1, 0, $self->{args}{uninst}||0); +} + 1; diff --git a/make/lib/SDL/Build/Cygwin.pm b/make/lib/SDL/Build/Cygwin.pm index f12bd4e..4258925 100644 --- a/make/lib/SDL/Build/Cygwin.pm +++ b/make/lib/SDL/Build/Cygwin.pm @@ -1,3 +1,33 @@ +#!/usr/bin/env perl +# +# Cygwin.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Build::Cygwin; use base 'SDL::Build'; diff --git a/make/lib/SDL/Build/Darwin.pm b/make/lib/SDL/Build/Darwin.pm index 7f2898f..18d5b1e 100644 --- a/make/lib/SDL/Build/Darwin.pm +++ b/make/lib/SDL/Build/Darwin.pm @@ -1,3 +1,33 @@ +#!/usr/bin/env perl +# +# Darwin.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Build::Darwin; use base 'SDL::Build'; @@ -15,30 +45,51 @@ sub fetch_includes '/usr/local/include/gl' => '/usr/local/lib', '/usr/include/GL' => '/usr/lib', '/usr/include/gl' => '/usr/lib', - - '/Library/Frameworks/SDL.framework/Headers' => '../../lib', - '/Library/Frameworks/SDL_mixer.framework/Headers' => '../../lib', - '/Library/Frameworks/SDL_image.framework/Headers' => '../../lib', - '/Library/Frameworks/SDL_net.framework/Headers' => '../../lib', - '/Library/Frameworks/SDL_ttf.framework/Headers' => '../../lib', - '/Library/Frameworks/SDL_gfx.framework/Headers' => '../../lib', - '/Library/Frameworks/libogg.framework/Headers' => '../../lib', - '/Library/Frameworks/libvorbis.framework/Headers' => '../../lib', - '/Frameworks/libvorbisfile.framework/Headers' => '../../lib', - '/Library/Frameworks/libvorbisenc.framework/Headers' => '../../lib', - '../../include' => '../../lib', - '/System/Library/Frameworks/OpenGL.framework/Headers' => - '/System/Library/Frameworks/OpenGL.framework/Libraries', + + '/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', ); } -sub build_defines +sub build_c_sources { - my $self = shift; - my $defines = $self->SUPER::build_defines(@_); + return [qw/ + launcher.m + /]; +} - push @{$defines->{SDL}}, "-Ddarwin", "-DMACOSX"; +sub build_c_source +{ + return 'MacOSX'; +} - return $defines; +sub build_install_base +{ + return "SDL Perl.app/Contents/Resources"; } + +sub build_bundle +{ + $bundle_contents="SDL Perl.app/Contents"; + system "mkdir -p \"$bundle_contents\""; + mkdir "$bundle_contents/MacOS",0755; + $libs = `sdl-config --libs`; + chomp($libs); + $libs =~ s/-lSDLmain//g; + system "gcc $libs -framework Cocoa `perl -MExtUtils::Embed -e ldopts` MacOSX/launcher.o -o \"$bundle_contents/MacOS/SDL Perl\""; + + mkdir "$bundle_contents/Resources",0755; + system "echo \"APPL????\" > \"$bundle_contents/PkgInfo\""; + system "cp MacOSX/Info.plist \"$bundle_contents/\""; + system "cp \"MacOSX/SDL Perl.icns\" \"$bundle_contents/Resources\""; +} + 1; diff --git a/make/lib/SDL/Build/Freebsd.pm b/make/lib/SDL/Build/Freebsd.pm index 665f16d..4b1a0fb 100644 --- a/make/lib/SDL/Build/Freebsd.pm +++ b/make/lib/SDL/Build/Freebsd.pm @@ -1,3 +1,33 @@ +#!/usr/bin/env perl +# +# Freebsd.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Build::Freebsd; use base 'SDL::Build'; diff --git a/make/lib/SDL/Build/Linux.pm b/make/lib/SDL/Build/Linux.pm index 1f07149..0a8ec4a 100644 --- a/make/lib/SDL/Build/Linux.pm +++ b/make/lib/SDL/Build/Linux.pm @@ -1,3 +1,33 @@ +#!/usr/bin/env perl +# +# Linux.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Build::Linux; use base 'SDL::Build'; diff --git a/make/lib/SDL/Build/MSWin32.pm b/make/lib/SDL/Build/MSWin32.pm index 232a3c7..d1dcbbb 100644 --- a/make/lib/SDL/Build/MSWin32.pm +++ b/make/lib/SDL/Build/MSWin32.pm @@ -1,3 +1,33 @@ +#!/usr/bin/env perl +# +# MSWin32.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Build::MSWin32; use strict; diff --git a/make/lib/SDL/Build/Netbsd.pm b/make/lib/SDL/Build/Netbsd.pm index 56fd107..90ab477 100644 --- a/make/lib/SDL/Build/Netbsd.pm +++ b/make/lib/SDL/Build/Netbsd.pm @@ -1,6 +1,36 @@ +#!/usr/bin/env perl +# +# Netbsd.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig@cpan.org +# + package SDL::Build::Netbsd; -use base 'SDL::Build'; +use strict; sub fetch_includes { diff --git a/src/OpenGL.xs b/src/OpenGL.xs index 5dddb06..4c54228 100644 --- a/src/OpenGL.xs +++ b/src/OpenGL.xs @@ -1,6 +1,31 @@ -// SDL::OpenGL // -// Copyright (C) 2002,2003,2004 David J. Goehrig +// OpenGL.xs +// +// Copyright (C) 2005 David J. Goehrig +// +// ------------------------------------------------------------------------------ +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// ------------------------------------------------------------------------------ +// +// Please feel free to send questions, suggestions or improvements to: +// +// David J. Goehrig +// dgoehrig@cpan.org +// #include "EXTERN.h" #include "perl.h" @@ -14,7 +39,6 @@ #include #include -#include #ifdef USE_THREADS #define HAVE_TLS_CONTEXT @@ -24,7 +48,7 @@ #define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFF #endif /* GL_ALL_CLIENT_BITS */ -#include "defines.h" +#include "../defines.h" SV* sdl_perl_nurbs_error_hook; void @@ -670,7 +694,6 @@ glGet ( param ) case GL_MAX_ATTRIB_STACK_DEPTH: case GL_POLYGON_SMOOTH_HINT: case GL_ACCUM_GREEN_BITS: - case GL_MAX_TEXTURE_UNITS_ARB: { GLint ret[1]; int i; @@ -710,12 +733,6 @@ glGet ( param ) croak("Unknown glGet parameter!"); } -const char * glGetString ( name ) - GLenum name - CODE: - RETVAL = (const char *)glGetString (name); - OUTPUT: - RETVAL Uint32 glIsEnabled ( cap ) @@ -1233,24 +1250,16 @@ glCallListsString ( string ) glCallLists(len,GL_BYTE,str); void -glRasterPos ( x, y, ... ) +glRasterPos ( x, y, z, ... ) double x double y + double z CODE: - if (items == 2) - { - glRasterPos2d (x,y); - } - else if (items == 3) - { - double z = SvNV (ST(2)); - glRasterPos3d (x,y,z); - } - else if (items == 4) - { - double z = SvNV (ST(2)); - double w = SvNV (ST(3)); - glRasterPos4d (x,y,z,w); + if ( items == 4 ) { + double w = SvNV(ST(3)); + glRasterPos4d(x,y,z,w); + } else { + glRasterPos3d(x,y,z); } void @@ -1734,9 +1743,9 @@ AV* glGenTextures ( n ) Uint32 n; CODE: - Uint32 i; - Uint32 *names; - names = (Uint32*)safemalloc(sizeof(Uint32)*n); + GLsizei i; + GLuint* names; + names = (GLuint*)safemalloc(sizeof(GLuint)*n); RETVAL = newAV(); glGenTextures(n,names); for ( i = 0; i < n; i++ ) { @@ -1764,9 +1773,9 @@ glBindTexture ( target, texture ) void glDeleteTextures ( ... ) CODE: - Uint32 *textures; + GLuint* textures; int i; - textures = (Uint32*)safemalloc(sizeof(Uint32) * items); + textures = (GLuint*)safemalloc(sizeof(GLuint) * items); if ( textures ) { for ( i = 0; i < items; i++ ) { textures[i] = SvIV(ST(i)); @@ -1778,11 +1787,11 @@ glDeleteTextures ( ... ) AV* glAreTexturesResident ( ... ) CODE: - Uint32 *textures; + GLuint* textures; GLboolean *homes; int i; RETVAL = newAV(); - textures = (Uint32*)safemalloc(sizeof(Uint32) * items); + textures = (GLuint*)safemalloc(sizeof(GLuint) * items); homes = (GLboolean*)safemalloc(sizeof(GLboolean) * items); if ( textures ) { for ( i = 0; i < items; i++ ) { @@ -2719,87 +2728,5 @@ gluTessVertex ( tessobj, coords, vd ) #endif -GLUquadric * -gluNewQuadric () - CODE: - RETVAL = gluNewQuadric (); - OUTPUT: - RETVAL - -void -gluDeleteQuadric (quad) - GLUquadric *quad - CODE: - gluDeleteQuadric(quad); - -void -gluQuadricNormals ( quad, normal ) - GLUquadric *quad - GLenum normal - CODE: - gluQuadricNormals(quad, normal); - - -void -gluQuadricTexture ( quad, texture ) - GLUquadric *quad - GLboolean texture - CODE: - gluQuadricTexture ( quad, texture ); - -void -gluCylinder ( quad, base, top, height, slices, stacks ) - GLUquadric *quad - GLdouble base - GLdouble top - GLdouble height - GLint slices - GLint stacks - CODE: - gluCylinder ( quad, base, top, height, slices, stacks ); - -void -gluDisk ( quad, inner, outer, slices, loops ) - GLUquadric *quad - GLdouble inner - GLdouble outer - GLint slices - GLint loops - CODE: - gluDisk ( quad, inner, outer, slices, loops ); - -void -gluPartialDisk ( quad, inner, outer, slices, loops, start, sweep ) - GLUquadric *quad - GLdouble inner - GLdouble outer - GLint slices - GLint loops - GLdouble start - GLdouble sweep - - CODE: - gluPartialDisk ( quad, inner, outer, slices, loops, start, sweep ); - -void -gluSphere ( quad, radius, slices, stacks ) - GLUquadric *quad - GLdouble radius - GLint slices - GLint stacks - CODE: - gluSphere ( quad, radius, slices, stacks ); - - - -void -glXUseXFont ( font, first, count, list_base ) - Font font - int first - int count - int list_base - CODE: - glXUseXFont ( font, first, count, list_base ); - #endif diff --git a/src/SDL.xs b/src/SDL.xs index cff7e36..c327e5e 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -1,11 +1,31 @@ +// // SDL.xs // -// SDL Perl by David J. Goehrig +// Copyright (C) 2005 David J. Goehrig +// +// ------------------------------------------------------------------------------ +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// ------------------------------------------------------------------------------ +// +// Please feel free to send questions, suggestions or improvements to: +// +// David J. Goehrig +// dgoehrig@cpan.org // -// Copyright (C) 2000,2001,2002,2003,2004 David J. Goehrig -// Copyright (C) 2009 Kartik Thakore -// 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" @@ -17,6 +37,14 @@ #include +#ifdef HAVE_GL +#include +#endif + +#ifdef HAVE_GLU +#include +#endif + #ifdef HAVE_SDL_IMAGE #include #endif @@ -26,12 +54,8 @@ void (*mix_music_finished_cv)(); #endif -#ifdef HAVE_GL -#include -#endif - -#ifdef HAVE_GLU -#include +#ifdef HAVE_SDL_SOUND +#include #endif #ifdef HAVE_SDL_NET @@ -65,38 +89,16 @@ static int sdl_perl_use_smpeg_audio = 0; #include #endif +#ifdef HAVE_SDL_SVG +#include +#endif + #ifdef USE_THREADS #define HAVE_TLS_CONTEXT #endif #include "defines.h" -#ifdef MACOSX -#include -void CPSEnableForegroundOperation(ProcessSerialNumber* psn); -void NSApplicationLoad(); -void SDL_macosx_init(void) { - Boolean sameProc; - ProcessSerialNumber myProc, frProc; - if (GetFrontProcess(&frProc) == noErr) - if (GetCurrentProcess(&myProc) == noErr) - if (SameProcess(&frProc, &myProc, &sameProc) == noErr && sameProc == 0) { - /* - NSLog(@"creating bad autorelease pool"); - [[NSAutoreleasePool alloc] init]; - */ - NSApplicationLoad(); - CPSEnableForegroundOperation(&myProc); - } -} -void SDL_macosx_quit(void) { -} -#endif // MACOSX - - - - - Uint32 sdl_perl_timer_callback ( Uint32 interval, void* param ) { @@ -206,13 +208,15 @@ sdl_perl_music_finished_callback ( void ) #endif +#define INIT_NS_APPLICATION +#define QUIT_NS_APPLICATION + + void sdl_perl_atexit (void) { + QUIT_NS_APPLICATION SDL_Quit(); -#ifdef MACOSX - SDL_macosx_quit(); -#endif } void boot_SDL(); @@ -238,9 +242,7 @@ int Init ( flags ) Uint32 flags CODE: -#ifdef MACOSX - SDL_macosx_init(); -#endif + INIT_NS_APPLICATION RETVAL = SDL_Init(flags); #ifdef HAVE_TLS_CONTEXT Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0); @@ -267,11 +269,8 @@ QuitSubSystem ( flags ) void Quit () CODE: + QUIT_NS_APPLICATION SDL_Quit(); -#ifdef MACOSX - SDL_macosx_quit(); -#endif - int WasInit ( flags ) @@ -337,6 +336,103 @@ RemoveTimer ( id ) OUTPUT: RETVAL +SDL_RWops* +RWFromFile ( file, mode ) + char* file + char * mode + CODE: + RETVAL = SDL_RWFromFile(file,mode); + OUTPUT: + RETVAL + +SDL_RWops* +RWFromFP ( fp, autoclose ) + FILE* fp + int autoclose + CODE: + RETVAL = SDL_RWFromFP(fp,autoclose); + OUTPUT: + RETVAL + +SDL_RWops* +RWFromMem ( mem, size ) + char* mem + int size + CODE: + RETVAL = SDL_RWFromMem((void*)mem,size); + OUTPUT: + RETVAL + +SDL_RWops* +RWFromConstMem ( mem, size ) + const char* mem + int size + CODE: + RETVAL = SDL_RWFromConstMem((const void*)mem,size); + OUTPUT: + RETVAL + +SDL_RWops* +AllocRW () + CODE: + RETVAL = SDL_AllocRW(); + OUTPUT: + RETVAL + +void +FreeRW ( rw ) + SDL_RWops* rw + CODE: + SDL_FreeRW(rw); + +int +RWseek ( rw, off, whence ) + SDL_RWops* rw + int off + int whence + CODE: + RETVAL = SDL_RWseek(rw,off,whence); + OUTPUT: + RETVAL + +int +RWtell ( rw ) + SDL_RWops* rw + CODE: + RETVAL = SDL_RWtell(rw); + OUTPUT: + RETVAL + +int +RWread ( rw, mem, size, n ) + SDL_RWops* rw + char* mem + int size + int n + CODE: + RETVAL = SDL_RWread(rw,mem,size,n); + OUTPUT: + RETVAL + +int +RWwrite ( rw, mem, size, n ) + SDL_RWops* rw + char* mem + int size + int n + CODE: + RETVAL = SDL_RWwrite(rw,mem,size,n); + OUTPUT: + RETVAL + +int +RWclose ( rw ) + SDL_RWops* rw + CODE: + RETVAL = SDL_RWclose(rw); + OUTPUT: + RETVAL + int CDNumDrives () CODE: @@ -527,19 +623,6 @@ FreeEvent ( e ) CODE: safefree(e); - -int -PeepEvents( e, numevents, action, mask) - SDL_Event *e - int numevents - SDL_eventaction action - Uint32 mask - CODE: - RETVAL = (int)SDL_PeepEvents( e, numevents, action, mask); - OUTPUT: - RETVAL - - int PollEvent ( e ) SDL_Event *e @@ -1221,20 +1304,6 @@ ColorB ( color, ... ) RETVAL void -ColorRGB ( color, ... ) - SDL_Color *color - PPCODE: - if (items > 1 ) { - color->r = SvIV(ST(1)); - color->g = SvIV(ST(2)); - color->b = SvIV(ST(3)); - } - mXPUSHi( color->r ); - mXPUSHi( color->g ); - mXPUSHi( color->b ); - XSRETURN(3); - -void FreeColor ( color ) SDL_Color *color CODE: @@ -1938,17 +2007,6 @@ MixPlayChannel ( channel, chunk, loops ) RETVAL int -MixSetPanning ( channel, left, right ) - int channel - Uint8 left - Uint8 right - CODE: - RETVAL = Mix_SetPanning(channel,left, right); - OUTPUT: - RETVAL - - -int MixPlayChannelTimed ( channel, chunk, loops, ticks ) int channel Mix_Chunk *chunk @@ -2361,7 +2419,7 @@ JoyAxisEventValue ( e ) OUTPUT: RETVAL -Sint16 +Uint8 JoyButtonEventWhich ( e ) SDL_Event *e CODE: @@ -2516,7 +2574,7 @@ NetResolveIP ( address ) int NetResolveHost ( address, host, port ) IPaddress *address - char *host + const char *host Uint16 port CODE: RETVAL = SDLNet_ResolveHost(address,host,port); @@ -3313,13 +3371,13 @@ NewSMPEGInfo() void FreeSMPEGInfo ( info ) - SMPEG_Info *info; + SMPEG_Info *info CODE: safefree(info); int SMPEGInfoHasAudio ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->has_audio; OUTPUT: @@ -3327,7 +3385,7 @@ SMPEGInfoHasAudio ( info ) int SMPEGInfoHasVideo ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->has_video; OUTPUT: @@ -3335,7 +3393,7 @@ SMPEGInfoHasVideo ( info ) int SMPEGInfoWidth ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->width; OUTPUT: @@ -3343,7 +3401,7 @@ SMPEGInfoWidth ( info ) int SMPEGInfoHeight ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->height; OUTPUT: @@ -3351,7 +3409,7 @@ SMPEGInfoHeight ( info ) int SMPEGInfoCurrentFrame ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_frame; OUTPUT: @@ -3359,7 +3417,7 @@ SMPEGInfoCurrentFrame ( info ) double SMPEGInfoCurrentFPS ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_fps; OUTPUT: @@ -3367,7 +3425,7 @@ SMPEGInfoCurrentFPS ( info ) int SMPEGInfoCurrentAudioFrame ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->audio_current_frame; OUTPUT: @@ -3375,7 +3433,7 @@ SMPEGInfoCurrentAudioFrame ( info ) int SMPEGInfoCurrentOffset ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_offset; OUTPUT: @@ -3383,7 +3441,7 @@ SMPEGInfoCurrentOffset ( info ) int SMPEGInfoTotalSize ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->total_size; OUTPUT: @@ -3391,7 +3449,7 @@ SMPEGInfoTotalSize ( info ) double SMPEGInfoCurrentTime ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_time; OUTPUT: @@ -3399,7 +3457,7 @@ SMPEGInfoCurrentTime ( info ) double SMPEGInfoTotalTime ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->total_time; OUTPUT: @@ -3407,7 +3465,7 @@ SMPEGInfoTotalTime ( info ) char * SMPEGError ( mpeg ) - SMPEG* mpeg ; + SMPEG* mpeg CODE: RETVAL = SMPEG_error(mpeg); OUTPUT: @@ -3415,8 +3473,8 @@ SMPEGError ( mpeg ) SMPEG* NewSMPEG ( filename, info, use_audio ) - char* filename; - SMPEG_Info* info; + char* filename + SMPEG_Info* info int use_audio CODE: #ifdef HAVE_SDL_MIXER @@ -3429,14 +3487,14 @@ NewSMPEG ( filename, info, use_audio ) void FreeSMPEG ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_delete(mpeg); void SMPEGEnableAudio ( mpeg , flag ) - SMPEG* mpeg ; - int flag; + SMPEG* mpeg + int flag CODE: SMPEG_enableaudio(mpeg,flag); #ifdef HAVE_SDL_MIXER @@ -3445,44 +3503,44 @@ SMPEGEnableAudio ( mpeg , flag ) void SMPEGEnableVideo ( mpeg , flag ) - SMPEG* mpeg ; - int flag; + SMPEG* mpeg + int flag CODE: SMPEG_enablevideo(mpeg,flag); void SMPEGSetVolume ( mpeg , volume ) - SMPEG* mpeg ; - int volume; + SMPEG* mpeg + int volume CODE: SMPEG_setvolume(mpeg,volume); void SMPEGSetDisplay ( mpeg, dest, surfLock ) - SMPEG* mpeg; - SDL_Surface* dest; - SDL_mutex* 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; + SMPEG* mpeg + int w + int h CODE: SMPEG_scaleXY(mpeg,w,h); void SMPEGScale ( mpeg, scale ) - SMPEG* mpeg; + SMPEG* mpeg int scale CODE: SMPEG_scale(mpeg,scale); void SMPEGPlay ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SDL_AudioSpec audiofmt; Uint16 format; @@ -3503,7 +3561,7 @@ SMPEGPlay ( mpeg ) SMPEGstatus SMPEGStatus ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: RETVAL = SMPEG_status(mpeg); OUTPUT: @@ -3511,20 +3569,20 @@ SMPEGStatus ( mpeg ) void SMPEGPause ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_pause(mpeg); void SMPEGLoop ( mpeg, repeat ) - SMPEG* mpeg; + SMPEG* mpeg int repeat CODE: SMPEG_loop(mpeg,repeat); void SMPEGStop ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_stop(mpeg); #ifdef HAVE_SDL_MIXER @@ -3533,41 +3591,41 @@ SMPEGStop ( mpeg ) void SMPEGRewind ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_rewind(mpeg); void SMPEGSeek ( mpeg, bytes ) - SMPEG* mpeg; - int bytes; + SMPEG* mpeg + int bytes CODE: SMPEG_seek(mpeg,bytes); void SMPEGSkip ( mpeg, seconds ) - SMPEG* mpeg; - float seconds; + SMPEG* mpeg + float seconds CODE: SMPEG_skip(mpeg,seconds); void SMPEGSetDisplayRegion ( mpeg, rect ) - SMPEG* mpeg; - SDL_Rect* 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; + SMPEG* mpeg + int frame CODE: SMPEG_renderFrame(mpeg,frame); SMPEG_Info * SMPEGGetInfo ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info)); SMPEG_getinfo(mpeg,RETVAL); @@ -3581,555 +3639,654 @@ SMPEGGetInfo ( mpeg ) 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 * 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 - + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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_SVG + +SDL_svg_context * +SVG_Load ( filename ) + char* filename + CODE: + RETVAL = SVG_Load(filename); + OUTPUT: + RETVAL + +SDL_svg_context * +SVG_LoadBuffer ( data, len ) + char* data + int len + CODE: + RETVAL = SVG_LoadBuffer(data,len); + OUTPUT: + RETVAL + +int +SVG_SetOffset ( source, xoff, yoff ) + SDL_svg_context* source + double xoff + double yoff + CODE: + RETVAL = SVG_SetOffset(source,xoff,yoff); + OUTPUT: + RETVAL + +int +SVG_SetScale ( source, xscale, yscale ) + SDL_svg_context* source + double xscale + double yscale + CODE: + RETVAL = SVG_SetScale(source,xscale,yscale); + OUTPUT: + RETVAL + +int +SVG_RenderToSurface ( source, x, y, dest ) + SDL_svg_context* source + int x + int y + SDL_Surface* dest; + CODE: + RETVAL = SVG_RenderToSurface(source,x,y,dest); + OUTPUT: + RETVAL + +void +SVG_Free ( source ) + SDL_svg_context* source + CODE: + SVG_Free(source); + +void +SVG_Set_Flags ( source, flags ) + SDL_svg_context* source + Uint32 flags + CODE: + SVG_Set_Flags(source,flags); + +float +SVG_Width ( source ) + SDL_svg_context* source + CODE: + RETVAL = SVG_Width(source); + OUTPUT: + RETVAL + +float +SVG_HEIGHT ( source ) + SDL_svg_context* source + CODE: + RETVAL = SVG_Height(source); + OUTPUT: + RETVAL + +void +SVG_SetClipping ( source, minx, miny, maxx, maxy ) + SDL_svg_context* source + int minx + int miny + int maxx + int maxy + CODE: + SVG_SetClipping(source,minx,miny,maxx,maxy); + +int +SVG_Version ( ) + CODE: + RETVAL = SVG_Version(); + OUTPUT: + RETVAL + #endif @@ -4163,14 +4320,14 @@ AV* SoundDecoderInfoExtensions ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: - char **ext; + const char **ext; for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){ - av_push(RETVAL,sv_2mortal(newSVpv(*ext,0))); + av_push(RETVAL,newSVpv(*ext,0)); } OUTPUT: RETVAL -char* +const char* SoundDecoderInfoDescription ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: @@ -4178,7 +4335,7 @@ SoundDecoderInfoDescription ( decoderinfo ) OUTPUT: RETVAL -char* +const char* SoundDecoderInfoAuthor ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: @@ -4186,7 +4343,7 @@ SoundDecoderInfoAuthor ( decoderinfo ) OUTPUT: RETVAL -char* +const char* SoundDecoderInfoUrl ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: @@ -4230,7 +4387,7 @@ Uint32 SoundSampleBufferSize ( sample ) Sound_Sample* sample CODE: - RETVAL = sample->buffer; + RETVAL = sample->buffer_size; OUTPUT: RETVAL @@ -4242,7 +4399,134 @@ SoundSampleFlags ( sample ) OUTPUT: RETVAL +int +Sound_Init ( ) + CODE: + RETVAL = Sound_Init(); + OUTPUT: + RETVAL + +int +Sound_Quit ( ) + CODE: + RETVAL = Sound_Quit(); + OUTPUT: + RETVAL + +AV* +Sound_AvailableDecoders ( ) + CODE: + RETVAL = newAV(); + const Sound_DecoderInfo** sdi; + sdi = Sound_AvailableDecoders(); + if (sdi != NULL) { + for (;*sdi != NULL; ++sdi) { + av_push(RETVAL,sv_2mortal(newSViv(PTR2IV(*sdi)))); + } + } + OUTPUT: + RETVAL + +const char* +Sound_GetError ( ) + CODE: + RETVAL = Sound_GetError(); + OUTPUT: + RETVAL + +void +Sound_ClearError ( ) + CODE: + Sound_ClearError(); + +Sound_Sample* +Sound_NewSample ( rw, ext, desired, buffsize ) + SDL_RWops* rw + const char* ext + Sound_AudioInfo* desired + Uint32 buffsize + CODE: + RETVAL = Sound_NewSample(rw,ext,desired,buffsize); + OUTPUT: + RETVAL +Sound_Sample* +Sound_NewSampleFromMem ( data, size, ext, desired, buffsize ) + const Uint8 *data + Uint32 size + const char* ext + Sound_AudioInfo* desired + Uint32 buffsize + CODE: + RETVAL = Sound_NewSampleFromMem(data,size,ext,desired,buffsize); + OUTPUT: + RETVAL + +Sound_Sample* +Sound_NewSampleFromFile ( fname, desired, buffsize ) + const char* fname + Sound_AudioInfo* desired + Uint32 buffsize + CODE: + RETVAL = Sound_NewSampleFromFile(fname,desired,buffsize); + OUTPUT: + RETVAL + +void +Sound_FreeSample ( sample ) + Sound_Sample* sample + CODE: + Sound_FreeSample(sample); + +Sint32 +Sound_GetDuration ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_GetDuration(sample); + OUTPUT: + RETVAL + +int +Sound_SetBufferSize ( sample, size ) + Sound_Sample* sample + Uint32 size + CODE: + RETVAL = Sound_SetBufferSize(sample,size); + OUTPUT: + RETVAL + +Uint32 +Sound_Decode ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_Decode(sample); + OUTPUT: + RETVAL + +Uint32 +Sound_DecodeAll ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_DecodeAll(sample); + OUTPUT: + RETVAL + +int +Sound_Rewind ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_Rewind(sample); + OUTPUT: + RETVAL + +int +Sound_Seek ( sample, ms ) + Sound_Sample* sample + Uint32 ms + CODE: + RETVAL = Sound_Seek(sample,ms); + OUTPUT: + RETVAL #endif diff --git a/src/SFont.h b/src/SFont.h index 18a4a2f..1c9025f 100644 --- a/src/SFont.h +++ b/src/SFont.h @@ -1,12 +1,32 @@ -/************************************************************************ -* SFONT - SDL Font Library by Karl Bartel * -* * -* 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. * -* * -************************************************************************/ +// +// SFont.h +// +// Original SFont code Copyright (C) Karl Bartel +// Copyright (C) 2005 David J. Goehrig +// +// ------------------------------------------------------------------------------ +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// ------------------------------------------------------------------------------ +// +// Please feel free to send questions, suggestions or improvements to: +// +// David J. Goehrig +// dgoehrig@cpan.org +// #include "SDL.h" diff --git a/src/SFont.xs b/src/SFont.xs index 126ca58..2bd9899 100644 --- a/src/SFont.xs +++ b/src/SFont.xs @@ -1,10 +1,31 @@ -// SDL::SFont // -// SFont bitmap font support +// SFont.xs // -// SFont library code by Karl Bartel +// Original SFont code Copyright (C) Karl Bartel +// Copyright (C) 2005 David J. Goehrig // -// SFont.xs Copyright (C) 2004 David J. Goehrig +// ------------------------------------------------------------------------------ +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// ------------------------------------------------------------------------------ +// +// Please feel free to send questions, suggestions or improvements to: +// +// David J. Goehrig +// dgoehrig@cpan.org // #include "EXTERN.h" @@ -23,8 +44,8 @@ #define HAVE_TLS_CONTEXT #endif -#include "defines.h" -#include "SFont.h" +#include "../defines.h" +#include "../SFont.h" #ifdef HAVE_SDL_IMAGE #include diff --git a/src/defines.h b/src/defines.h index a018af6..5303315 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,6 +1,30 @@ // -// Copyright (C) 2004 David J. Goehrig +// defines.h // +// Copyright (C) 2005 David J. Goehrig +// +// ------------------------------------------------------------------------------ +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// ------------------------------------------------------------------------------ +// +// Please feel free to send questions, suggestions or improvements to: +// +// David J. Goehrig +// dgoehrig@cpan.org // #ifndef SDL_PERL_DEFINES_H diff --git a/t/apppm.t b/t/apppm.t index c13096d..c577511 100644 --- a/t/apppm.t +++ b/t/apppm.t @@ -2,11 +2,35 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::App BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/', 'blib/arch/auto/SDL/SFont'; + unshift @INC, 'blib/lib','blib/arch'; } use strict; diff --git a/t/cdrompm.t b/t/cdrompm.t index 50de41f..5c8c212 100644 --- a/t/cdrompm.t +++ b/t/cdrompm.t @@ -3,6 +3,30 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Cdrom BEGIN { diff --git a/t/colorpm.t b/t/colorpm.t index 4714d65..67dba94 100644 --- a/t/colorpm.t +++ b/t/colorpm.t @@ -1,8 +1,34 @@ #!/usr/bin/perl -w # -# Copyright (C) 2003,2006 Tels +# Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Color BEGIN { @@ -13,7 +39,7 @@ use strict; use Test::More; -plan ( tests => 15 ); +plan ( tests => 10 ); use_ok( 'SDL::Color' ); @@ -22,7 +48,6 @@ can_ok ('SDL::Color', qw/ r g b - rgb pixel /); # some basic tests: @@ -33,19 +58,9 @@ is ($color->r(),0, 'r is 0'); is ($color->g(),0, 'g is 0'); is ($color->b(),0, 'b is 0'); -is (join(":", $color->rgb()), '0:0:0', 'r, g and b are 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'); -is (join(":", $color->rgb()), '255:255:255', 'r, g and b are 255'); -is (join(":", $color->rgb(128,0,80)), '128:0:80', 'r, g and b are set'); -is (join(":", $color->rgb()), '128:0:80', 'r, g and b still set'); - -# test the new new($r,$g,$b) calling style -$color = SDL::Color->new( 255,70,128); -is (join(":", $color->rgb()), '255:70:128', 'r, g and b are set via new($r,$g,$b)'); - diff --git a/t/cursorpm.t b/t/cursorpm.t index 01c87f8..f6f4283 100644 --- a/t/cursorpm.t +++ b/t/cursorpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Cursor BEGIN { diff --git a/t/eventpm.t b/t/eventpm.t index 3a1da0f..3dca888 100644 --- a/t/eventpm.t +++ b/t/eventpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Event BEGIN { @@ -22,7 +48,6 @@ can_ok ('SDL::Event', qw/ type pump poll - peep wait set set_unicode @@ -43,8 +68,7 @@ can_ok ('SDL::Event', qw/ button button_state button_x - button_y - /); + button_y /); diff --git a/t/fontpm.t b/t/fontpm.t index adb8701..db1d7b8 100644 --- a/t/fontpm.t +++ b/t/fontpm.t @@ -2,11 +2,37 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Font BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/src/SDL/SFont'; + unshift @INC, 'blib/lib','blib/arch'; } use strict; diff --git a/t/mixerpm.t b/t/mixerpm.t index 39146da..0ad5dbe 100644 --- a/t/mixerpm.t +++ b/t/mixerpm.t @@ -2,7 +2,33 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Mixer BEGIN { @@ -58,8 +84,6 @@ can_ok ('SDL::Mixer', qw/ music_paused playing playing_music - mix_volume_chunk - mix_set_panning /); # these are exported by default, so main:: should know them: diff --git a/t/mpegpm.t b/t/mpegpm.t index 58ab377..348a31c 100644 --- a/t/mpegpm.t +++ b/t/mpegpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::MPEG BEGIN { diff --git a/t/musicpm.t b/t/musicpm.t index bb938db..a5ca6c6 100644 --- a/t/musicpm.t +++ b/t/musicpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Music BEGIN { diff --git a/t/opengl.t b/t/opengl.t index 4b51c0b..9c19e96 100644 --- a/t/opengl.t +++ b/t/opengl.t @@ -2,11 +2,37 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::OpenGL BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/src/SDL/OpenGL'; + unshift @INC, 'blib/lib','blib/arch'; } use strict; @@ -15,7 +41,7 @@ use SDL::Config; use Test::More; if ( SDL::Config->has('GL') && SDL::Config->has('GLU') ) { - plan ( tests => 4 ); + plan ( tests => 3 ); } else { plan ( skip_all => 'OpenGL support not compiled' ); } @@ -36,7 +62,6 @@ can_ok('main', qw/ glFrontFace glFrustum glGet - glGetString glLight glLoadIdentity glMap1 @@ -65,14 +90,4 @@ can_ok('main',qw/ gluNurbsCurve gluNurbsProperty gluNurbsSurface - gluPwlCurve - gluNewQuadric - gluDeleteQuadric - gluQuadricNormals - gluQuadricTexture - gluCylinder - gluDisk - gluPartialDisk - gluSphere /); - -can_ok('main',qw/glXUseXFont/); + gluPwlCurve /); diff --git a/t/palettepm.t b/t/palettepm.t index fa00ff1..3cc9cfc 100644 --- a/t/palettepm.t +++ b/t/palettepm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Palette BEGIN { diff --git a/t/rectpm.t b/t/rectpm.t index 7ebb7a5..422f64a 100644 --- a/t/rectpm.t +++ b/t/rectpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Rect BEGIN { diff --git a/t/sdlpm.t b/t/sdlpm.t index 325853e..9545b02 100644 --- a/t/sdlpm.t +++ b/t/sdlpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL BEGIN { diff --git a/t/soundpm.t b/t/soundpm.t index 6aef8bc..b63c397 100644 --- a/t/soundpm.t +++ b/t/soundpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Sound BEGIN { diff --git a/t/surfacepm.t b/t/surfacepm.t index dd74de3..9e698b3 100644 --- a/t/surfacepm.t +++ b/t/surfacepm.t @@ -2,11 +2,37 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Surface BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/src/SDL/SFont',; + unshift @INC, 'blib/lib','blib/arch'; } use strict; @@ -59,3 +85,29 @@ my $surface = SDL::Surface->new(); isa_ok($surface,'SDL::Surface'); +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# diff --git a/t/timerpm.t b/t/timerpm.t index 0f905fc..3e3624b 100644 --- a/t/timerpm.t +++ b/t/timerpm.t @@ -3,6 +3,32 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Timer BEGIN { diff --git a/t/toolfontpm.t b/t/toolfontpm.t index 62a2343..e7efa73 100644 --- a/t/toolfontpm.t +++ b/t/toolfontpm.t @@ -3,10 +3,36 @@ # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig # +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Tool::Font BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/src/SDL/SFont/'; + unshift @INC, 'blib/lib','blib/arch'; } use strict; diff --git a/t/toolgraphicpm.t b/t/toolgraphicpm.t index 85b1177..36dc0f7 100644 --- a/t/toolgraphicpm.t +++ b/t/toolgraphicpm.t @@ -2,11 +2,37 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::Tool::Graphic BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/src/SDL/SFont/'; + unshift @INC, 'blib/lib','blib/arch'; } use strict; diff --git a/t/ttfontpm.t b/t/ttfontpm.t index 33dcd92..823bea9 100644 --- a/t/ttfontpm.t +++ b/t/ttfontpm.t @@ -2,11 +2,37 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::TTFont BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/src/SDL/SFont'; + unshift @INC, 'blib/lib','blib/arch'; } use strict; diff --git a/t/videopm.t b/t/videopm.t index b76523b..31d40d6 100644 --- a/t/videopm.t +++ b/t/videopm.t @@ -2,11 +2,37 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# Copyright (C) 2009 Kartik Thakore +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# ------------------------------------------------------------------------------ +# +# Please feel free to send questions, suggestions or improvements to: +# +# David J. Goehrig +# dgoehrig\@cpan.org +# +# # basic testing of SDL::VIDEO BEGIN { - unshift @INC, 'blib/lib','blib/arch', 'blib/arch/auto/src/SDL/SFont'; + unshift @INC, 'blib/lib','blib/arch'; } use strict; diff --git a/typemap b/typemap index 0eb347c..392972f 100644 --- a/typemap +++ b/typemap @@ -2,6 +2,7 @@ TYPEMAP const Uint16 * T_PTR Uint8 T_U_CHAR Uint8 * T_PTR +const Uint8* T_PTR Uint8 ** T_PTR Uint16 T_UV Uint16 * T_PTR @@ -13,7 +14,6 @@ Sint16 * T_PTR Sint32 T_IV Sint32 * T_PTR SDL_Event * T_PTR -SDL_eventaction T_PTR SDL_Surface * T_PTR SDL_SysWMmsg * T_PTR SDL_CD * T_PTR @@ -55,15 +55,15 @@ GLboolean T_U_CHAR GLUnurbsObj * T_PTR GLUtesselator * T_PTR GLuint T_UV +GLuint* T_PTR GLint T_IV GLint* T_PTR float * T_PTR float T_NV GLfloat T_NV -GLUquadric * T_PTR -GLdouble T_NV Sound_DecoderInfo * T_PTR const Sound_DecoderInfo * T_PTR Sound_Sample * T_PTR Sound_AudioInfo * T_PTR -Font T_IV +SDL_RWops* T_PTR +SDL_svg_context* T_PTR