From: Kartik Thakore Date: Thu, 6 Aug 2009 00:04:38 +0000 (-0400) Subject: Removed unesscary files X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b67833ac2150fe5f9968be2656179ecdfa958e1c;p=sdlgit%2FSDL_perl.git Removed unesscary files --- diff --git a/lib/SDL/Tutorial/.svn/README.txt b/lib/SDL/Tutorial/.svn/README.txt deleted file mode 100644 index 271a8ce..0000000 --- a/lib/SDL/Tutorial/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/lib/SDL/Tutorial/.svn/dir-wcprops b/lib/SDL/Tutorial/.svn/dir-wcprops deleted file mode 100644 index 6ce67f3..0000000 --- a/lib/SDL/Tutorial/.svn/dir-wcprops +++ /dev/null @@ -1,5 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 36 -/sdlperl/!svn/ver/1/lib/SDL/Tutorial -END diff --git a/lib/SDL/Tutorial/.svn/empty-file b/lib/SDL/Tutorial/.svn/empty-file deleted file mode 100644 index e69de29..0000000 diff --git a/lib/SDL/Tutorial/.svn/entries b/lib/SDL/Tutorial/.svn/entries deleted file mode 100644 index 0bb58df..0000000 --- a/lib/SDL/Tutorial/.svn/entries +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - diff --git a/lib/SDL/Tutorial/.svn/format b/lib/SDL/Tutorial/.svn/format deleted file mode 100644 index b8626c4..0000000 --- a/lib/SDL/Tutorial/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/lib/SDL/Tutorial/.svn/prop-base/Animation.pm.svn-base b/lib/SDL/Tutorial/.svn/prop-base/Animation.pm.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/lib/SDL/Tutorial/.svn/prop-base/Animation.pm.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/lib/SDL/Tutorial/.svn/prop-base/Drawing.pm.svn-base b/lib/SDL/Tutorial/.svn/prop-base/Drawing.pm.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/lib/SDL/Tutorial/.svn/prop-base/Drawing.pm.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/lib/SDL/Tutorial/.svn/prop-base/Images.pm.svn-base b/lib/SDL/Tutorial/.svn/prop-base/Images.pm.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/lib/SDL/Tutorial/.svn/prop-base/Images.pm.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/lib/SDL/Tutorial/.svn/props/Animation.pm.svn-work b/lib/SDL/Tutorial/.svn/props/Animation.pm.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/lib/SDL/Tutorial/.svn/props/Animation.pm.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/lib/SDL/Tutorial/.svn/props/Drawing.pm.svn-work b/lib/SDL/Tutorial/.svn/props/Drawing.pm.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/lib/SDL/Tutorial/.svn/props/Drawing.pm.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/lib/SDL/Tutorial/.svn/props/Images.pm.svn-work b/lib/SDL/Tutorial/.svn/props/Images.pm.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/lib/SDL/Tutorial/.svn/props/Images.pm.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/lib/SDL/Tutorial/.svn/text-base/Animation.pm.svn-base b/lib/SDL/Tutorial/.svn/text-base/Animation.pm.svn-base deleted file mode 100644 index 16f8c84..0000000 --- a/lib/SDL/Tutorial/.svn/text-base/Animation.pm.svn-base +++ /dev/null @@ -1,282 +0,0 @@ -#!/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 strict; -use SDL; -use SDL::App; -use SDL::Rect; -use SDL::Color; - -# change these values as necessary -my $title = 'My SDL Animation'; -my ($width, $height, $depth) = ( 640, 480, 16 ); -my ($bg_r, $bg_g, $bg_b) = ( 0x00, 0x00, 0x00 ); -my ($rect_r, $rect_g, $rect_b) = ( 0x00, 0x00, 0xff ); -my ($rect_width, $rect_height, $rect_y) = ( 100, 100, 190 ); - -my $app = SDL::App->new( - -width => $width, - -height => $height, - -depth => $depth, -); - -my $color = SDL::Color->new( - -r => $rect_r, - -g => $rect_g, - -b => $rect_b, -); - -my $bg_color = SDL::Color->new( - -r => $bg_r, - -g => $bg_g, - -b => $bg_b, -); - -my $background = SDL::Rect->new( - -width => $width, - -height => $height, -); - -my $rect = create_rect(); - -# your code here, perhaps -for my $x (0 .. 640) -{ - $rect->x( $x ); - draw_frame( $app, - bg => $background, bg_color => $bg_color, - rect => $rect, rect_color => $color, - ); -} - -# remove this line -sleep 2; - -# XXX - if you know why I need to create a new rect here, please tell me! -$rect = create_rect(); -my $old_rect = create_rect(); - -# your code also here, perhaps -for my $x (0 .. 640) -{ - $rect->x( $x ); - draw_undraw_rect( $app, - rect => $rect, old_rect => $old_rect, - rect_color => $color, bg_color => $bg_color, - ); - $old_rect->x( $x ); -} - -# your code almost certainly follows; remove this line -sleep 2; - -sub create_rect -{ - return SDL::Rect->new( - -height => $rect_height, - -width => $rect_width, - -x => 0, - -y => $rect_y, - ); -} - -sub draw_frame -{ - my ($app, %args) = @_; - - $app->fill( $args{bg}, $args{bg_color} ); - $app->fill( $args{rect}, $args{rect_color} ); - $app->update( $args{bg} ); -} - -sub draw_undraw_rect -{ - my ($app, %args) = @_; - - $app->fill( $args{old_rect}, $args{bg_color} ); - $app->fill( $args{rect}, $args{rect_color} ); - $app->update( $args{old_rect} ); - $app->update( $args{rect} ); -} -END_HERE - -1; -__END__ - -=head1 NAME - -SDL::Tutorial::Animation - -=head1 SYNOPSIS - - # to read this tutorial - $ perldoc SDL::Tutorial::Animation - - # to create a demo animation program based on this tutorial - $ perl -MSDL::Tutorial::Animation=sdl_anim.pl -e 1 - -=head1 ANIMATING A RECTANGLE - -Now that you can display a rectangle on the screen, the next step is to animate -that rectangle. As with movies, there's no actual motion. Computer animations are just very very fast slideshows. The hard work is creating nearly identical images in every slide (or frame, in graphics terms). - -Okay, it's not that difficult. - -There is one small difficulty to address, however. Once you blit one surface -onto another, the destination is changed permanently. There's no concept of -layers here unless you write it yourself. If you fail to take this into -account (and just about everyone does at first), you'll end up with blurry -graphics moving around on the screen. - -There are two approaches to solve this problem, redrawing the screen on every -frame and saving and restoring the background for every object drawn. - -=head2 Redrawing the Screen - -Since you have to draw the screen in the right order once to start with it's -pretty easy to make this into a loop and redraw things in the right order for -every frame. Given a L object C<$app>, a L C<$rect>, and -a L C<$color>, you only have to create a new SDL::Rect C<$bg>, -representing the whole of the background surface and a new SDL::Color -C<$bg_color>, representing the background color. You can write a -C function as follows: - - sub draw_frame - { - my ($app, %args) = @_; - - $app->fill( $args{ bg }, $args{ bg_color } ); - $app->fill( $args{rect}, $args{rect_color} ); - $app->update( $args{bg} ); - } - -Since you can change the C and C coordinates of a rect with the C -and C methods, you can move a rectangle across the screen with a loop like -this: - - for my $x (0 .. 640) - { - $rect->x( $x ); - draw_frame( $app, - bg => $bg, bg_color => $bg_color, - rect => $rect, rect_color => $color, - ); - } - -If C<$rect>'s starting y position is 190 and its height and width are 100, the -rectangle (er, square) will move across the middle of the screen. - -Provided you can keep track of the proper order in which to redraw rectangles -and provided you don't need the optimal speed necessary (since blitting every -object takes more work than just blitting the portions you need), this works -quite well. - -=head2 Undrawing the Updated Rectangle - -If you need more speed or want to make a different complexity tradeoff, you can -take a snapshot of the destination rectangle I you blit onto it. That -way, when you need to redraw, you can blit the old snapshot back before -blitting to the new position. - -B I have no idea how this will work in the face of alpha blending, -which, admittedly, I haven't even mentioned yet. If you don't know what this -means, forget it. If you do know what this means and know why I'm waving my -hands here, feel free to explain what should and what does happen and why. :) - -With this technique, the frame-drawing subroutine has to be a little more -complicated. Instead of the background rect, it needs a rect for the previous -position. It also needs to do two updates (or must perform some scary math to -figure out the rectangle of the correct size to C. No thanks!). - - sub undraw_redraw_rect - { - my ($app, %args) = @_; - - $app->fill( $args{old_rect}, $args{bg_color} ); - $app->fill( $args{rect], $args{rect_color} ); - $app->update( $args{old_rect}, $args{rect} ); - } - -We'll need to create a new SDL::Rect, C<$old_rect>, that is a duplicate of -C<$rect>, at the same position at first. You should already know how to do -this. - -As before, the loop to call C would look something like: - - for my $x (0 .. 640) - { - $rect->x( $x ); - - undraw_redraw_rect( $app, - rect => $rect, old_rect => $old_rect, - rect_color => $color, bg_color => $bgcolor, - ); - - $old_rect->x( $x ); - } - -If you run this code, you'll probably notice that it's tremendously faster than -the previous version. It may be too fast, where the alternate technique was -just fast enough. There are a couple of good ways to set a fixed animation -speed regardless of the speed of the processor and graphics hardware (provided -they're good enough, which is increasingly often the case), and we'll get to -them soon. - -=head1 SEE ALSO - -=over 4 - -=item L - -basic drawing with SDL Perl - -=item L - -animating images - -=back - -=head1 AUTHOR - -chromatic, Echromatic@wgz.orgE - -Written for and maintained by the Perl SDL project, L. - -=head1 BUGS - -No known bugs. - -=head1 COPYRIGHT - -Copyright (c) 2003 - 2004, chromatic. All rights reserved. This module is -distributed under the same terms as Perl itself, in the hope that it is useful -but certainly under no guarantee. diff --git a/lib/SDL/Tutorial/.svn/text-base/Drawing.pm.svn-base b/lib/SDL/Tutorial/.svn/text-base/Drawing.pm.svn-base deleted file mode 100644 index c071306..0000000 --- a/lib/SDL/Tutorial/.svn/text-base/Drawing.pm.svn-base +++ /dev/null @@ -1,221 +0,0 @@ -#!/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; - -# change these values as necessary -my $title = 'My SDL Rectangle-Drawing App'; -my ($width, $height, $depth) = ( 640, 480, 16 ); -my ($red, $green, $blue) = ( 0x00, 0x00, 0xff ); -my ($rect_width, $rect_height) = ( 100, 100 ); -my ($rect_x, $rect_y) = ( 270, 190 ); - -my $app = SDL::App->new( - -width => $width, - -height => $height, - -depth => $depth, -); - -my $rect = SDL::Rect->new( - -height => $rect_height, - -width => $rect_width, - -x => $rect_x, - -y => $rect_y, -); - -my $color = SDL::Color->new( - -r => $red, - -g => $green, - -b => $blue, -); - -$app->fill( $rect, $color ); -$app->update( $rect ); - -# your code here; remove the next line -sleep 2; -END_HERE - -1; -__END__ - -=head1 NAME - -SDL::Tutorial::Drawing - basic drawing with Perl SDL - -=head1 SYNOPSIS - - # to read this tutorial - $ perldoc SDL::Tutorial::Drawing - - # to create a bare-bones SDL app based on this tutorial - $ perl -MSDL::Tutorial::Drawing=basic_app.pl -e 1 - -=head1 DRAWING BASICS - -As explained in L, all graphics in SDL live on a surface. -Consequently, all drawing operations operate on a surface, whether drawing on -it directly or blitting from another surface. The important modules for this -exercise are L and L. - -As usual, we'll start by creating a L object: - - use SDL::App; - - my $app = SDL::App->new( - -width => 640, - -height => 480, - -depth => 16, - ); - -=head2 Creating a New Surface with SDL::Rect - -A SDL::Rect object is an SDL surface, just as an SDL::App object is. As you'd -expect, you need to specify the size of this object as you create it. You can -also specify its coordinates relative to the origin. - -B The origin, or coordinates 0, 0, is at the upper left of the screen. - -Here's how to create a square 100 pixels by 100 pixels centered in the window: - - use SDL::Rect; - - my $rect = SDL::Rect->new( - -height => 100, - -width => 100, - -x => 270, - -y => 390, - ); - -This won't actually display anything yet, it just creates a rectangular -surface. Of course, even if it did display, you wouldn't see anything, as it -defaults to the background color just as C<$app> does. That's where SDL::Color -comes in. - -=head2 A Bit About Color - -SDL::Color objects represent colors in the SDL world. These colors are -additive, so they're represented as mixtures of Red, Green, and Blue -components. The color values are traditionally given in hexadecimal numbers. -If you're exceedingly clever or really like the math, you can figure out which -values are possible by comparing them to your current bit depth. SDL does a -lot of autoconversion for you, though, so unless extreme speed or pedantic -detail are important, you can get by without worrying too much. - -Creating a color object is reasonably easy. As the color scheme is additive, -the lower the number for a color component, the less of that color. The higher -the number, the higher the component. Experimentation may be your best bet, as -these aren't exactly the primary colors you learned as a child (since that's a -subtractive scheme). - -Let's create a nice, full blue: - - use SDL::Color; - - my $color = SDL::Color->new( - -r => 0x00, - -g => 0x00, - -b => 0xff, - ); - -B The numbers are in hex; if you've never used hex notation in Perl -before, the leading C<0x> just signifies that the rest of the number is in -base-16. In this case, the blue component has a value of 255 and the red and -green are both zero. - -=head2 Filling Part of a Surface - -The C method of SDL::Surface fills a given rectangular section of the -surface with the given color. Since we already have a rect and a color, it's -as easy as saying: - - $app->fill( $rect, $color ); - -That's a little subtle; it turns out that the SDL::Rect created earlier -represents a destination within the surface of the main window. It's not -attached to anything else. We could re-use it later, as necessary. - -=head2 Updating the Surface - -If you try the code so far, you'll notice that it still doesn't display. Don't -fret. All that's left to do is to call C on the appropriate surface. -As usual, C takes a Rect to control which part of the surface to -update. In this case, that's: - - $app->update( $rect ); - -This may seem like a useless extra step, but it can be quite handy. While -drawing to the screen directly seems like the fastest way to go, the -intricacies of working with hardware with the appropriate timings is tricky. - -=head2 Working With The App - -You can, of course, create all sorts of Rects with different sizes and -coordinates as well as varied colors and experiment to your heart's content -drawing them to the window. It's more fun when you can animate them smoothly, -though. - -That, as usual, is another tutorial. - -=head1 SEE ALSO - -=over 4 - -=item L - -the basics of Perl SDL. - -=item L - -basic animation techniques - -=back - -=head1 AUTHOR - -chromatic, Echromatic@wgz.orgE - -Written for and maintained by the Perl SDL project, L. - -=head1 BUGS - -No known bugs. - -=head1 COPYRIGHT - -Copyright (c) 2003 - 2004, chromatic. All rights reserved. This module is -distributed under the same terms as Perl itself, in the hope that it is useful -but certainly under no guarantee. diff --git a/lib/SDL/Tutorial/.svn/text-base/Images.pm.svn-base b/lib/SDL/Tutorial/.svn/text-base/Images.pm.svn-base deleted file mode 100644 index 007b632..0000000 --- a/lib/SDL/Tutorial/.svn/text-base/Images.pm.svn-base +++ /dev/null @@ -1,492 +0,0 @@ -#!/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; -BEGIN -{ - %images = ( - left => [qw( - 47 49 46 38 37 61 10 00 10 00 E7 00 00 00 00 00 01 01 01 02 02 02 03 03 - 03 04 04 04 05 05 05 06 06 06 07 07 07 08 08 08 09 09 09 0A 0A 0A 0B 0B - 0B 0C 0C 0C 0D 0D 0D 0E 0E 0E 0F 0F 0F 10 10 10 11 11 11 12 12 12 13 13 - 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 1A 1A 1A 1B 1B - 1B 1C 1C 1C 1D 1D 1D 1E 1E 1E 1F 1F 1F 20 20 20 21 21 21 22 22 22 23 23 - 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 29 29 29 2A 2A 2A 2B 2B - 2B 2C 2C 2C 2D 2D 2D 2E 2E 2E 2F 2F 2F 30 30 30 31 31 31 32 32 32 33 33 - 33 34 34 34 35 35 35 36 36 36 37 37 37 38 38 38 39 39 39 3A 3A 3A 3B 3B - 3B 3C 3C 3C 3D 3D 3D 3E 3E 3E 3F 3F 3F 40 40 40 41 41 41 42 42 42 43 43 - 43 44 44 44 45 45 45 46 46 46 47 47 47 48 48 48 49 49 49 4A 4A 4A 4B 4B - 4B 4C 4C 4C 4D 4D 4D 4E 4E 4E 4F 4F 4F 50 50 50 51 51 51 52 52 52 53 53 - 53 54 54 54 55 55 55 56 56 56 57 57 57 58 58 58 59 59 59 5A 5A 5A 5B 5B - 5B 5C 5C 5C 5D 5D 5D 5E 5E 5E 5F 5F 5F 60 60 60 61 61 61 62 62 62 63 63 - 63 64 64 64 65 65 65 66 66 66 67 67 67 68 68 68 69 69 69 6A 6A 6A 6B 6B - 6B 6C 6C 6C 6D 6D 6D 6E 6E 6E 6F 6F 6F 70 70 70 71 71 71 72 72 72 73 73 - 73 74 74 74 75 75 75 76 76 76 77 77 77 78 78 78 79 79 79 7A 7A 7A 7B 7B - 7B 7C 7C 7C 7D 7D 7D 7E 7E 7E 7F 7F 7F 80 80 80 81 81 81 82 82 82 83 83 - 83 84 84 84 85 85 85 86 86 86 87 87 87 88 88 88 89 89 89 8A 8A 8A 8B 8B - 8B 8C 8C 8C 8D 8D 8D 8E 8E 8E 8F 8F 8F 90 90 90 91 91 91 92 92 92 93 93 - 93 94 94 94 95 95 95 96 96 96 97 97 97 98 98 98 99 99 99 9A 9A 9A 9B 9B - 9B 9C 9C 9C 9D 9D 9D 9E 9E 9E 9F 9F 9F A0 A0 A0 A1 A1 A1 A2 A2 A2 A3 A3 - A3 A4 A4 A4 A5 A5 A5 A6 A6 A6 A7 A7 A7 A8 A8 A8 A9 A9 A9 AA AA AA AB AB - AB AC AC AC AD AD AD AE AE AE AF AF AF B0 B0 B0 B1 B1 B1 B2 B2 B2 B3 B3 - B3 B4 B4 B4 B5 B5 B5 B6 B6 B6 B7 B7 B7 B8 B8 B8 B9 B9 B9 BA BA BA BB BB - BB BC BC BC BD BD BD BE BE BE BF BF BF C0 C0 C0 C1 C1 C1 C2 C2 C2 C3 C3 - C3 C4 C4 C4 C5 C5 C5 C6 C6 C6 C7 C7 C7 C8 C8 C8 C9 C9 C9 CA CA CA CB CB - CB CC CC CC CD CD CD CE CE CE CF CF CF D0 D0 D0 D1 D1 D1 D2 D2 D2 D3 D3 - D3 D4 D4 D4 D5 D5 D5 D6 D6 D6 D7 D7 D7 D8 D8 D8 D9 D9 D9 DA DA DA DB DB - DB DC DC DC DD DD DD DE DE DE DF DF DF E0 E0 E0 E1 E1 E1 E2 E2 E2 E3 E3 - E3 E4 E4 E4 E5 E5 E5 E6 E6 E6 E7 E7 E7 E8 E8 E8 E9 E9 E9 EA EA EA EB EB - EB EC EC EC ED ED ED EE EE EE EF EF EF F0 F0 F0 F1 F1 F1 F2 F2 F2 F3 F3 - F3 F4 F4 F4 F5 F5 F5 F6 F6 F6 F7 F7 F7 F8 F8 F8 F9 F9 F9 FA FA FA FB FB - FB FC FC FC FD FD FD FE FE FE FF FF FF 2C 00 00 00 00 10 00 10 00 00 08 - 36 00 FF 09 1C 48 B0 A0 C1 83 08 13 22 04 C0 10 80 C2 7F 0C 05 46 4C E8 - 70 60 C5 85 15 27 52 6C A8 30 E3 45 8C 0D 39 76 FC 38 F2 A1 44 91 1B 4F - 82 24 88 D2 64 C1 80 00 3B - )], - center => [qw( - 47 49 46 38 37 61 10 00 10 00 E7 00 00 00 00 00 01 01 01 02 02 02 03 03 - 03 04 04 04 05 05 05 06 06 06 07 07 07 08 08 08 09 09 09 0A 0A 0A 0B 0B - 0B 0C 0C 0C 0D 0D 0D 0E 0E 0E 0F 0F 0F 10 10 10 11 11 11 12 12 12 13 13 - 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 1A 1A 1A 1B 1B - 1B 1C 1C 1C 1D 1D 1D 1E 1E 1E 1F 1F 1F 20 20 20 21 21 21 22 22 22 23 23 - 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 29 29 29 2A 2A 2A 2B 2B - 2B 2C 2C 2C 2D 2D 2D 2E 2E 2E 2F 2F 2F 30 30 30 31 31 31 32 32 32 33 33 - 33 34 34 34 35 35 35 36 36 36 37 37 37 38 38 38 39 39 39 3A 3A 3A 3B 3B - 3B 3C 3C 3C 3D 3D 3D 3E 3E 3E 3F 3F 3F 40 40 40 41 41 41 42 42 42 43 43 - 43 44 44 44 45 45 45 46 46 46 47 47 47 48 48 48 49 49 49 4A 4A 4A 4B 4B - 4B 4C 4C 4C 4D 4D 4D 4E 4E 4E 4F 4F 4F 50 50 50 51 51 51 52 52 52 53 53 - 53 54 54 54 55 55 55 56 56 56 57 57 57 58 58 58 59 59 59 5A 5A 5A 5B 5B - 5B 5C 5C 5C 5D 5D 5D 5E 5E 5E 5F 5F 5F 60 60 60 61 61 61 62 62 62 63 63 - 63 64 64 64 65 65 65 66 66 66 67 67 67 68 68 68 69 69 69 6A 6A 6A 6B 6B - 6B 6C 6C 6C 6D 6D 6D 6E 6E 6E 6F 6F 6F 70 70 70 71 71 71 72 72 72 73 73 - 73 74 74 74 75 75 75 76 76 76 77 77 77 78 78 78 79 79 79 7A 7A 7A 7B 7B - 7B 7C 7C 7C 7D 7D 7D 7E 7E 7E 7F 7F 7F 80 80 80 81 81 81 82 82 82 83 83 - 83 84 84 84 85 85 85 86 86 86 87 87 87 88 88 88 89 89 89 8A 8A 8A 8B 8B - 8B 8C 8C 8C 8D 8D 8D 8E 8E 8E 8F 8F 8F 90 90 90 91 91 91 92 92 92 93 93 - 93 94 94 94 95 95 95 96 96 96 97 97 97 98 98 98 99 99 99 9A 9A 9A 9B 9B - 9B 9C 9C 9C 9D 9D 9D 9E 9E 9E 9F 9F 9F A0 A0 A0 A1 A1 A1 A2 A2 A2 A3 A3 - A3 A4 A4 A4 A5 A5 A5 A6 A6 A6 A7 A7 A7 A8 A8 A8 A9 A9 A9 AA AA AA AB AB - AB AC AC AC AD AD AD AE AE AE AF AF AF B0 B0 B0 B1 B1 B1 B2 B2 B2 B3 B3 - B3 B4 B4 B4 B5 B5 B5 B6 B6 B6 B7 B7 B7 B8 B8 B8 B9 B9 B9 BA BA BA BB BB - BB BC BC BC BD BD BD BE BE BE BF BF BF C0 C0 C0 C1 C1 C1 C2 C2 C2 C3 C3 - C3 C4 C4 C4 C5 C5 C5 C6 C6 C6 C7 C7 C7 C8 C8 C8 C9 C9 C9 CA CA CA CB CB - CB CC CC CC CD CD CD CE CE CE CF CF CF D0 D0 D0 D1 D1 D1 D2 D2 D2 D3 D3 - D3 D4 D4 D4 D5 D5 D5 D6 D6 D6 D7 D7 D7 D8 D8 D8 D9 D9 D9 DA DA DA DB DB - DB DC DC DC DD DD DD DE DE DE DF DF DF E0 E0 E0 E1 E1 E1 E2 E2 E2 E3 E3 - E3 E4 E4 E4 E5 E5 E5 E6 E6 E6 E7 E7 E7 E8 E8 E8 E9 E9 E9 EA EA EA EB EB - EB EC EC EC ED ED ED EE EE EE EF EF EF F0 F0 F0 F1 F1 F1 F2 F2 F2 F3 F3 - F3 F4 F4 F4 F5 F5 F5 F6 F6 F6 F7 F7 F7 F8 F8 F8 F9 F9 F9 FA FA FA FB FB - FB FC FC FC FD FD FD FE FE FE FF FF FF 2C 00 00 00 00 10 00 10 00 00 08 - 36 00 FF 09 1C 48 B0 A0 C1 83 08 13 26 04 C0 10 80 C2 7F 0C 05 46 5C 48 - D0 E1 42 8B 13 2F 66 54 B8 F1 60 C3 8F 16 2F 3E 1C D8 11 E1 C7 87 13 4B - 4A DC D8 70 E4 C1 80 00 3B - )], - right => [qw( - 47 49 46 38 37 61 10 00 10 00 E7 00 00 00 00 00 01 01 01 02 02 02 03 03 - 03 04 04 04 05 05 05 06 06 06 07 07 07 08 08 08 09 09 09 0A 0A 0A 0B 0B - 0B 0C 0C 0C 0D 0D 0D 0E 0E 0E 0F 0F 0F 10 10 10 11 11 11 12 12 12 13 13 - 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 1A 1A 1A 1B 1B - 1B 1C 1C 1C 1D 1D 1D 1E 1E 1E 1F 1F 1F 20 20 20 21 21 21 22 22 22 23 23 - 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 29 29 29 2A 2A 2A 2B 2B - 2B 2C 2C 2C 2D 2D 2D 2E 2E 2E 2F 2F 2F 30 30 30 31 31 31 32 32 32 33 33 - 33 34 34 34 35 35 35 36 36 36 37 37 37 38 38 38 39 39 39 3A 3A 3A 3B 3B - 3B 3C 3C 3C 3D 3D 3D 3E 3E 3E 3F 3F 3F 40 40 40 41 41 41 42 42 42 43 43 - 43 44 44 44 45 45 45 46 46 46 47 47 47 48 48 48 49 49 49 4A 4A 4A 4B 4B - 4B 4C 4C 4C 4D 4D 4D 4E 4E 4E 4F 4F 4F 50 50 50 51 51 51 52 52 52 53 53 - 53 54 54 54 55 55 55 56 56 56 57 57 57 58 58 58 59 59 59 5A 5A 5A 5B 5B - 5B 5C 5C 5C 5D 5D 5D 5E 5E 5E 5F 5F 5F 60 60 60 61 61 61 62 62 62 63 63 - 63 64 64 64 65 65 65 66 66 66 67 67 67 68 68 68 69 69 69 6A 6A 6A 6B 6B - 6B 6C 6C 6C 6D 6D 6D 6E 6E 6E 6F 6F 6F 70 70 70 71 71 71 72 72 72 73 73 - 73 74 74 74 75 75 75 76 76 76 77 77 77 78 78 78 79 79 79 7A 7A 7A 7B 7B - 7B 7C 7C 7C 7D 7D 7D 7E 7E 7E 7F 7F 7F 80 80 80 81 81 81 82 82 82 83 83 - 83 84 84 84 85 85 85 86 86 86 87 87 87 88 88 88 89 89 89 8A 8A 8A 8B 8B - 8B 8C 8C 8C 8D 8D 8D 8E 8E 8E 8F 8F 8F 90 90 90 91 91 91 92 92 92 93 93 - 93 94 94 94 95 95 95 96 96 96 97 97 97 98 98 98 99 99 99 9A 9A 9A 9B 9B - 9B 9C 9C 9C 9D 9D 9D 9E 9E 9E 9F 9F 9F A0 A0 A0 A1 A1 A1 A2 A2 A2 A3 A3 - A3 A4 A4 A4 A5 A5 A5 A6 A6 A6 A7 A7 A7 A8 A8 A8 A9 A9 A9 AA AA AA AB AB - AB AC AC AC AD AD AD AE AE AE AF AF AF B0 B0 B0 B1 B1 B1 B2 B2 B2 B3 B3 - B3 B4 B4 B4 B5 B5 B5 B6 B6 B6 B7 B7 B7 B8 B8 B8 B9 B9 B9 BA BA BA BB BB - BB BC BC BC BD BD BD BE BE BE BF BF BF C0 C0 C0 C1 C1 C1 C2 C2 C2 C3 C3 - C3 C4 C4 C4 C5 C5 C5 C6 C6 C6 C7 C7 C7 C8 C8 C8 C9 C9 C9 CA CA CA CB CB - CB CC CC CC CD CD CD CE CE CE CF CF CF D0 D0 D0 D1 D1 D1 D2 D2 D2 D3 D3 - D3 D4 D4 D4 D5 D5 D5 D6 D6 D6 D7 D7 D7 D8 D8 D8 D9 D9 D9 DA DA DA DB DB - DB DC DC DC DD DD DD DE DE DE DF DF DF E0 E0 E0 E1 E1 E1 E2 E2 E2 E3 E3 - E3 E4 E4 E4 E5 E5 E5 E6 E6 E6 E7 E7 E7 E8 E8 E8 E9 E9 E9 EA EA EA EB EB - EB EC EC EC ED ED ED EE EE EE EF EF EF F0 F0 F0 F1 F1 F1 F2 F2 F2 F3 F3 - F3 F4 F4 F4 F5 F5 F5 F6 F6 F6 F7 F7 F7 F8 F8 F8 F9 F9 F9 FA FA FA FB FB - FB FC FC FC FD FD FD FE FE FE FF FF FF 2C 00 00 00 00 10 00 10 00 00 08 - 3A 00 FF 09 1C 48 B0 A0 C1 83 08 13 2A 04 C0 10 80 C2 7F 0C 05 46 4C E8 - 70 60 45 84 13 27 52 6C F8 50 62 C5 8B 05 1B 8A 04 79 50 E3 43 93 1B 51 - 1A CC 48 D2 A2 49 8E 1D 0B 06 04 00 3B - )], -); -} - -use Pod::ToDemo sub -{ - (undef, my $filename) = @_; - (my $imagebase = $filename) =~ s/\.\w+$//; - my @img_files = map { $imagebase . "_$_.gif" } - qw( left center right ); - my $demo_source = <<'END_HERE'; -package Walker; - -sub new -{ - my ($class, @images) = @_; - my @frames = map { SDL::Surface->new( -name => $_ ) } @images; - my $frame_rect = SDL::Rect->new( - -height => $frames[0]->height(), - -width => $frames[0]->width(), - -x => 0, - -y => 0, - ); - my $self = - { - frames => \@frames, - frame_rect => $frame_rect, - }; - bless $self, $class; -} - -sub frames -{ - my $self = shift; - $self->{frames} = shift if @_; - $self->{frames}; -} - -sub frame_rect -{ - my $self = shift; - $self->{frame_rect} = shift if @_; - $self->{frame_rect}; -} - -sub next_frame -{ - my $self = shift; - my $frames = $self->frames(); - my $frame = shift @$frames; - - push @$frames, $frame; - $self->frames( $frames ); - - return $frame; -} - -package main; - -use strict; - -use SDL; -use SDL::App; -use SDL::Surface; -use SDL::Color; - -# change these values as necessary -my $title = 'My SDL Animation'; -my ($width, $height, $depth) = ( 640, 480, 16 ); -my ($bg_r, $bg_g, $bg_b) = ( 0xff, 0xff, 0xff ); -my ($start_x, $end_x) = ( 20, 600 ); -my $sleep_msec = 0.05; - -my $app = SDL::App->new( - -width => $width, - -height => $height, - -depth => $depth, -); - -my $bg_color = SDL::Color->new( - -r => $bg_r, - -g => $bg_g, - -b => $bg_b, -); - -my $background = SDL::Rect->new( - -width => $width, - -height => $height, -); - -my $pos = SDL::Rect->new( - -width => 16, - -height => 16, - -x => 0, - -y => 240, -); - -my $walker = Walker->new(qw( -END_HERE - -$demo_source .= join( ' ', @img_files ) . "));" . <<'END_HERE'; - -for my $x ( $start_x .. $end_x ) -{ - draw_background( $app, $background, $bg_color ); - $pos->x( $x ); - draw_walker( $walker, $app, $pos ); - $app->update( $background ); - select( undef, undef, undef, $sleep_msec ); -} - -# you'll want to remove this -sleep 2; - -sub draw_background -{ - my ($app, $background, $bg_color) = @_; - $app->fill( $background, $bg_color ); -} - -sub draw_walker -{ - my ($walker, $app, $pos) = @_; - my $frame = $walker->next_frame(); - my $frame_rect = $walker->frame_rect(); - $frame->blit( $frame_rect, $app, $pos ); -} -END_HERE - - Pod::ToDemo::write_demo( $filename, "#$^X\n$demo_source" ); - write_files( $imagebase ); -}; - -sub write_files -{ - my $imagebase = shift; - - for my $image (qw( left center right )) - { - my $file = join('', map { chr( hex( $_ ) ) } @{ $images{ $image } }); - write_file( $imagebase . "_$image" . '.gif', $file ); - } -} - -sub write_file -{ - my ($file, $contents) = @_; - - die "Cowardly refusing to overwrite '$file'\n" if -e $file; - open my $out, '>', $file or die "Cannot write '$file': $!\n"; - binmode $out; - print $out $contents; -} - -__END__ - -=head1 NAME - -SDL::Tutorial::Images - -=head1 SYNOPSIS - - # to read this tutorial - $ perldoc SDL::Tutorial::Images - - # to create a demo animation program based on this tutorial - $ perl -MSDL::Tutorial::Images=sdl_images.pl -e 1 - -=head1 ANIMATING IMAGES - -Since you're already familiar with the concepts behind animation, it's time to -learn how to work with images. As usual, the important point is that computer animation is just I motion by painting several slightly different frames to the screen every second. - -There are two ways to vary an image on screen. One is to change its -coordinates so it's at a slightly different position. This is very easy to do; -it's just like animating a rectangle. The other way is to change the image -itself so it's slightly different. This is a little more difficult, as you'll -need to draw the alternate image beforehand somehow. - -=head2 Loading Images - -As usual, start with an L object representing the image window. Then -preload the image file. This is easy; just pass the C parameter to the -L constructor: - - use SDL::Surface; - - my $frame = SDL::Surface->new( -name => 'frame1.png' ); - -B you'll need to have compiled SDL Perl (and probably SDL) to support -JPEG and PNG files for this to work. - -That's it; now you have an SDL::Surface object containing the image. You can -use the C, C, and C methods to retrieve its height, -width, and bits per pixel, if you need them. - -=head2 Displaying Images - -Drawing an image onto the screen requires blitting it from one surface to -another. (Remember, "blitting" means copying bits in memory.) The C -method of SDL::Surface objects comes in handy. Its arguments are a little odd, -though. Assuming C<$app> is the SDL::App object, as usual: - - use SDL::Rect; - - my $frame_rect = SDL::Rect->new( - -height => $frame->height(), - -width => $frame->width(), - -x => 0, - -y => 0, - ); - - my $dest_rect = SDL::Rect->new( - -height => $frame->height(), - -width => $frame->width(), - -x => 0, - -y => 0, - ); - - $frame->blit( $frame_rect, $app, $dest_rect ); - $app->update( $dest_rect ); - -Here we have two L objects which represent rectangular regions of a -Surface. C<$frame_rect> represents the entire area of C<$frame>, while -C<$dest_rect> represents the area of the main window in which to blit the -frame. This may be clearer with more descriptive variable names: - - $source_surface->blit( - $area_of_source_to_blit, - $destination_surface, - $destination_area - ); - -As usual, call C on C<$app> to see the change. - -Requiring the source and destination Rect objects may seem tedious in this -simple example, but it's highly useful for copying only part of surface to part -of another. For example, animating this image is a matter of changing the C -and C coordinates of C<$dest_rect>: - - for my $x ( 1 .. 100 ) - { - $dest_rect->x( $x ); - $frame->blit( $frame_rect, $app, $dest_rect ); - $app->update( $dest_rect ); - } - -Of course, you'll have to redraw all or part of the screen to avoid artifacts, -as discussed in the previous tutorial. - -=head2 Multi-Image Animation - -That covers moving a single image around the screen. What if you want -something more? For example, what if you want to animate a stick figure -walking? - -You'll need several frames, just as in a flip-book. Each frame should be slightly different than the one before it. It's probably handy to encapsulate all of this in a C class: - - package Walker; - - use SDL::Surface; - - sub new - { - my ($class, @images) = @_; - my $self = [ map { SDL::Surface->new( -name => $_ ) } @images ]; - - bless $self, $class; - } - - sub next_frame - { - my $self = shift; - my $frame = shift @$self; - - push @$self, $frame; - return $frame; - } - -To use this class, instantiate an object: - - my $walker = Walker->new( 'frame1.png', 'frame2.png', 'frame3.png' ); - -Then call C within the loop: - - for my $x ( 1 .. 100 ) - { - my $frame = $walker->next_frame(); - - $dest_rect->x( $x ); - $frame->blit( $frame_rect, $app, $dest_rect ); - $app->update( $dest_rect ); - } - -Again, the rest of the frame drawing is missing from this example so as not to -distract from this technique. You'll probably want to abstract the undrawing -and redrawing into a separate subroutine so you don't have to worry about it -every time. - -It'd be easy to make C much smarter, selecting an image -appropriate to the direction of travel, using a bored animation when the -character is no longer moving, or adding other characteristics to the -character. As you can see, the hard part of this technique is generating the -images beforehand. That can add up to a tremendous amount of art and that's -one reason for the popularity of 3D models... but that's another tutorial much -further down the road. - -More importantly, it's time to discuss how to make these animations run more -smoothly. More on that next time. - -=head1 SEE ALSO - -=over 4 - -=item L - -basic SDL tutorial - -=item L - -non-image animation - -=back - -=head1 AUTHOR - -chromatic, Echromatic@wgz.orgE - -Written for and maintained by the Perl SDL project, L. - -=head1 BUGS - -No known bugs. - -=head1 COPYRIGHT - -Copyright (c) 2004, chromatic. All rights reserved. This module is -distributed under the same terms as Perl itself, in the hope that it is useful -but certainly under no guarantee. diff --git a/lib/SDL/Tutorial/.svn/wcprops/Animation.pm.svn-work b/lib/SDL/Tutorial/.svn/wcprops/Animation.pm.svn-work deleted file mode 100644 index 44644f2..0000000 --- a/lib/SDL/Tutorial/.svn/wcprops/Animation.pm.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 49 -/sdlperl/!svn/ver/1/lib/SDL/Tutorial/Animation.pm -END diff --git a/lib/SDL/Tutorial/.svn/wcprops/Drawing.pm.svn-work b/lib/SDL/Tutorial/.svn/wcprops/Drawing.pm.svn-work deleted file mode 100644 index 87ceb50..0000000 --- a/lib/SDL/Tutorial/.svn/wcprops/Drawing.pm.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 47 -/sdlperl/!svn/ver/1/lib/SDL/Tutorial/Drawing.pm -END diff --git a/lib/SDL/Tutorial/.svn/wcprops/Images.pm.svn-work b/lib/SDL/Tutorial/.svn/wcprops/Images.pm.svn-work deleted file mode 100644 index 285afe8..0000000 --- a/lib/SDL/Tutorial/.svn/wcprops/Images.pm.svn-work +++ /dev/null @@ -1,5 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 46 -/sdlperl/!svn/ver/1/lib/SDL/Tutorial/Images.pm -END diff --git a/src/SDL/OpenGL.bs b/src/SDL/OpenGL.bs deleted file mode 100644 index e69de29..0000000 diff --git a/src/SDL/OpenGL.c b/src/SDL/OpenGL.c deleted file mode 100644 index 170bb2c..0000000 --- a/src/SDL/OpenGL.c +++ /dev/null @@ -1,4851 +0,0 @@ -/* - * This file was generated automatically by xsubpp version 1.9508 from the - * contents of OpenGL.xs. Do not edit this file, edit OpenGL.xs instead. - * - * ANY CHANGES MADE HERE WILL BE LOST! - * - */ - -#line 1 "OpenGL.xs" -// -// 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" -#include "XSUB.h" - -#ifndef aTHX_ -#define aTHX_ -#endif - -#include - -#include -#include - -#ifdef USE_THREADS -#define HAVE_TLS_CONTEXT -#endif - -#ifndef GL_ALL_CLIENT_ATTRIB_BITS -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFF -#endif /* GL_ALL_CLIENT_BITS */ - -#include "../defines.h" - -SV* sdl_perl_nurbs_error_hook; -void -sdl_perl_nurbs_error_callback ( GLenum errorCode ) -{ - ENTER_TLS_CONTEXT - dSP; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(errorCode))); - PUTBACK; - - call_sv(sdl_perl_nurbs_error_hook,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_nurbs_being_callback ( GLenum type, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(type))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_nurbs_multi_callback ( GLfloat *vec, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(PTR2IV(vec)))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_nurbs_end_callback ( void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_end_callback ( void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_BEGIN))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_begin_callback ( GLenum type, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_BEGIN))); - XPUSHs(sv_2mortal(newSViv(type))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_error_callback ( GLenum type, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_ERROR))); - XPUSHs(sv_2mortal(newSViv(type))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_edge_flag_callback ( GLenum flag, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_EDGE_FLAG))); - XPUSHs(sv_2mortal(newSViv(flag))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_vertex_callback ( double *vd, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_VERTEX))); - XPUSHs(sv_2mortal(newSVnv(vd[0]))); - XPUSHs(sv_2mortal(newSVnv(vd[1]))); - XPUSHs(sv_2mortal(newSVnv(vd[2]))); - XPUSHs(sv_2mortal(newSVnv(vd[3]))); - XPUSHs(sv_2mortal(newSVnv(vd[4]))); - XPUSHs(sv_2mortal(newSVnv(vd[5]))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_combine_callback ( GLdouble coords[3], double *vd[4], GLfloat weight[4], - GLdouble **out, void *cb ) -{ - SV *cmd; - double *data; - int width; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_COMBINE))); - XPUSHs(sv_2mortal(newSVpvn((char*)coords,sizeof(GLdouble)*3))); - XPUSHs(sv_2mortal(newSVpvn((char*)vd,sizeof(GLdouble*)*4))); - XPUSHs(sv_2mortal(newSVpvn((char*)weight,sizeof(GLfloat)*4))); - PUTBACK; - - if ( 1 != call_sv(cmd,G_SCALAR) ) { - Perl_croak(aTHX_ "sdl_perl_tess_combine_callback failed"); - } - - data = (double*)POPp; - width = (int)POPi; - *out = (double*)malloc(sizeof(double)*width); - memcpy(*out,data,sizeof(double)*width); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -#line 299 "OpenGL.c" -#ifdef HAVE_GL -#define XSubPPtmpAAAA 1 - -XS(XS_SDL__OpenGL_glClearColor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glClearColor) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glClearColor(r, g, b, a)"); - { - double r = (double)SvNV(ST(0)); - double g = (double)SvNV(ST(1)); - double b = (double)SvNV(ST(2)); - double a = (double)SvNV(ST(3)); -#line 301 "OpenGL.xs" - glClearColor((GLfloat)r,(GLfloat)g,(GLfloat)b,(GLfloat)a); -#line 316 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glClearIndex); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glClearIndex) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glClearIndex(index)"); - { - double index = (double)SvNV(ST(0)); -#line 307 "OpenGL.xs" - glClearIndex(index); -#line 331 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glClearDepth); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glClearDepth) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glClearDepth(depth)"); - { - double depth = (double)SvNV(ST(0)); -#line 313 "OpenGL.xs" - glClearDepth(depth); -#line 346 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glClearStencil); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glClearStencil) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glClearStencil(s)"); - { - int s = (int)SvIV(ST(0)); -#line 319 "OpenGL.xs" - glClearStencil(s); -#line 361 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glClearAccum); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glClearAccum) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glClearAccum(r, g, b, a)"); - { - double r = (double)SvNV(ST(0)); - double g = (double)SvNV(ST(1)); - double b = (double)SvNV(ST(2)); - double a = (double)SvNV(ST(3)); -#line 328 "OpenGL.xs" - glClearAccum((GLfloat)r,(GLfloat)g,(GLfloat)b,(GLfloat)a); -#line 379 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glClear); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glClear) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glClear(m)"); - { - GLbitfield m = (GLbitfield)SvIV(ST(0)); -#line 334 "OpenGL.xs" - glClear(m); -#line 394 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glFlush); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glFlush) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glFlush()"); - { -#line 339 "OpenGL.xs" - glFlush(); -#line 408 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glFinish); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glFinish) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glFinish()"); - { -#line 344 "OpenGL.xs" - glFinish(); -#line 422 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glRect); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glRect) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glRect(r)"); - { - SDL_Rect* r = INT2PTR(SDL_Rect *,SvIV(ST(0))); -#line 350 "OpenGL.xs" - glRecti(r->x,r->y,r->x+r->w,r->y+r->h); -#line 437 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glVertex); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glVertex) -{ - dXSARGS; - if (items < 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glVertex(x, y, ...)"); - { - double x = (double)SvNV(ST(0)); - double y = (double)SvNV(ST(1)); -#line 357 "OpenGL.xs" - double z,w; - if ( items == 4 ) { - w = SvNV(ST(3)); - z = SvNV(ST(2)); - glVertex4d(x,y,z,w); - } else if ( items == 3 ) { - z = SvNV(ST(2)); - glVertex3d(x,y,z); - } else { - glVertex2d(x,y); - } -#line 463 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glBegin); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glBegin) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glBegin(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); -#line 373 "OpenGL.xs" - glBegin(mode); -#line 478 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEnd); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEnd) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEnd()"); - { -#line 378 "OpenGL.xs" - glEnd(); -#line 492 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEnable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEnable) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEnable(cap)"); - { - GLenum cap = (GLenum)SvIV(ST(0)); -#line 384 "OpenGL.xs" - glEnable(cap); -#line 507 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDisable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDisable) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDisable(cap)"); - { - GLenum cap = (GLenum)SvIV(ST(0)); -#line 390 "OpenGL.xs" - glDisable(cap); -#line 522 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glGet); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glGet) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glGet(param)"); - SP -= items; - { - GLenum param = (GLenum)SvIV(ST(0)); -#line 396 "OpenGL.xs" - switch (param) { - case GL_EDGE_FLAG_ARRAY: - case GL_MAP1_TEXTURE_COORD_1: - case GL_LIGHT_MODEL_TWO_SIDE: - case GL_INDEX_LOGIC_OP: - case GL_PACK_ALIGNMENT: - case GL_CLIP_PLANE4: - case GL_TEXTURE_GEN_S: - case GL_MAP1_VERTEX_3: - case GL_LIGHT6: - case GL_LIGHT0: - case GL_NORMAL_ARRAY: - case GL_EDGE_FLAG: - case GL_INDEX_ARRAY: - case GL_AUTO_NORMAL: - case GL_POLYGON_OFFSET_FILL: - case GL_MAP1_TEXTURE_COORD_4: - case GL_FOG: - case GL_LIGHT2: - case GL_UNPACK_SWAP_BYTES: - case GL_RGBA_MODE: - case GL_POLYGON_OFFSET_POINT: - case GL_POINT_SMOOTH: - case GL_ALPHA_TEST: - case GL_MAP2_TEXTURE_COORD_4: - case GL_COLOR_ARRAY: - case GL_POLYGON_OFFSET_LINE: - case GL_MAP2_NORMAL: - case GL_MAP1_INDEX: - case GL_PACK_LSB_FIRST: - case GL_MAP1_TEXTURE_COORD_2: - case GL_MAP2_VERTEX_3: - case GL_MAP2_TEXTURE_COORD_2: - case GL_CULL_FACE: - case GL_DOUBLEBUFFER: - case GL_UNPACK_LSB_FIRST: - case GL_TEXTURE_COORD_ARRAY: - case GL_LIGHT1: - case GL_TEXTURE_GEN_Q: - case GL_MAP_STENCIL: - case GL_TEXTURE_1D: - case GL_LIGHT4: - case GL_LIGHTING: - case GL_LIGHT7: - case GL_MAP1_NORMAL: - case GL_CLIP_PLANE0: - case GL_TEXTURE_GEN_R: - case GL_PACK_SWAP_BYTES: - case GL_DEPTH_WRITEMASK: - case GL_COLOR_LOGIC_OP: - case GL_CLIP_PLANE5: - case GL_NORMALIZE: - case GL_TEXTURE_2D: - case GL_CLIP_PLANE3: - case GL_COLOR_MATERIAL: - case GL_BLEND: - case GL_CLIP_PLANE2: - case GL_MAP1_VERTEX_4: - case GL_DITHER: - case GL_CLIP_PLANE1: - case GL_MAP2_INDEX: - case GL_POLYGON_SMOOTH: - case GL_STEREO: - case GL_MAP2_COLOR_4: - case GL_LIGHT3: - case GL_VERTEX_ARRAY: - case GL_MAP1_TEXTURE_COORD_3: - case GL_STENCIL_TEST: - case GL_MAP2_TEXTURE_COORD_3: - case GL_TEXTURE_GEN_T: - case GL_LIGHT_MODEL_LOCAL_VIEWER: - case GL_LINE_SMOOTH: - case GL_MAP1_COLOR_4: - case GL_MAP2_TEXTURE_COORD_1: - case GL_CURRENT_RASTER_POSITION_VALID: - case GL_INDEX_MODE: - case GL_SCISSOR_TEST: - case GL_MAP_COLOR: - case GL_POLYGON_STIPPLE: - case GL_LIGHT5: - case GL_DEPTH_TEST: - case GL_LINE_STIPPLE: - case GL_MAP2_VERTEX_4: - { - GLboolean ret[1]; - int i; - glGetBooleanv(param, ret); - - for (i = 0; i < 1; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_COLOR_WRITEMASK: - { - GLboolean ret[4]; - int i; - glGetBooleanv(param, ret); - - for (i = 0; i < 4; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_ZOOM_Y: - case GL_ALPHA_TEST_REF: - case GL_POINT_SIZE_GRANULARITY: - case GL_CURRENT_RASTER_DISTANCE: - case GL_ALPHA_SCALE: - case GL_RED_BIAS: - case GL_DEPTH_BIAS: - case GL_FOG_DENSITY: - case GL_GREEN_BIAS: - case GL_DEPTH_CLEAR_VALUE: - case GL_ALPHA_BIAS: - case GL_FOG_END: - case GL_GREEN_SCALE: - case GL_BLUE_BIAS: - case GL_DEPTH_SCALE: - case GL_POINT_SIZE: - case GL_POLYGON_OFFSET_FACTOR: - case GL_ZOOM_X: - case GL_FOG_START: - case GL_POLYGON_OFFSET_UNITS: - case GL_LINE_WIDTH: - case GL_LINE_WIDTH_GRANULARITY: - case GL_BLUE_SCALE: - case GL_RED_SCALE: - { - GLdouble ret[1]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 1; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_MODELVIEW_MATRIX: - case GL_TEXTURE_MATRIX: - case GL_PROJECTION_MATRIX: - { - GLdouble ret[16]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 16; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_POINT_SIZE_RANGE: - case GL_LINE_WIDTH_RANGE: - case GL_MAP1_GRID_DOMAIN: - case GL_DEPTH_RANGE: - { - GLdouble ret[2]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 2; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_CURRENT_NORMAL: - { - GLdouble ret[3]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 3; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_FOG_COLOR: - case GL_MAP2_GRID_DOMAIN: - case GL_CURRENT_RASTER_POSITION: - case GL_CURRENT_COLOR: - case GL_LIGHT_MODEL_AMBIENT: - case GL_CURRENT_RASTER_TEXTURE_COORDS: - case GL_TEXTURE_ENV_COLOR: - case GL_CURRENT_RASTER_COLOR: - case GL_CURRENT_TEXTURE_COORDS: - case GL_COLOR_CLEAR_VALUE: - case GL_ACCUM_CLEAR_VALUE: - { - GLdouble ret[4]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 4; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_CULL_FACE_MODE: - case GL_PIXEL_MAP_I_TO_A_SIZE: - case GL_PIXEL_MAP_A_TO_A_SIZE: - case GL_BLUE_BITS: - case GL_EDGE_FLAG_ARRAY_STRIDE: - case GL_RENDER_MODE: - case GL_FOG_MODE: - case GL_DEPTH_FUNC: - case GL_READ_BUFFER: - case GL_POINT_SMOOTH_HINT: - case GL_PACK_SKIP_PIXELS: - case GL_STENCIL_REF: - case GL_STENCIL_CLEAR_VALUE: - case GL_AUX_BUFFERS: - case GL_COLOR_MATERIAL_PARAMETER: - case GL_ACCUM_BLUE_BITS: - case GL_INDEX_SHIFT: - case GL_VERTEX_ARRAY_STRIDE: - case GL_STENCIL_PASS_DEPTH_PASS: - case GL_CLIENT_ATTRIB_STACK_DEPTH: - case GL_DRAW_BUFFER: - case GL_LINE_STIPPLE_REPEAT: - case GL_BLEND_SRC: - case GL_PIXEL_MAP_B_TO_B_SIZE: - case GL_MAX_PIXEL_MAP_TABLE: - case GL_MAX_TEXTURE_SIZE: - case GL_PIXEL_MAP_S_TO_S_SIZE: - case GL_LOGIC_OP_MODE: - case GL_DEPTH_BITS: - case GL_GREEN_BITS: - case GL_LINE_SMOOTH_HINT: - case GL_ALPHA_TEST_FUNC: - case GL_MAX_LIGHTS: - case GL_FOG_HINT: - case GL_MAX_NAME_STACK_DEPTH: - case GL_INDEX_ARRAY_TYPE: - case GL_TEXTURE_COORD_ARRAY_TYPE: - case GL_COLOR_ARRAY_TYPE: - case GL_MAX_LIST_NESTING: - case GL_STENCIL_WRITEMASK: - case GL_LIST_BASE: - case GL_ACCUM_ALPHA_BITS: - case GL_INDEX_ARRAY_STRIDE: - case GL_PIXEL_MAP_I_TO_B_SIZE: - case GL_INDEX_BITS: - case GL_STENCIL_FAIL: - case GL_UNPACK_ALIGNMENT: - case GL_STENCIL_PASS_DEPTH_FAIL: - case GL_ATTRIB_STACK_DEPTH: - case GL_PACK_SKIP_ROWS: - case GL_TEXTURE_STACK_DEPTH: - case GL_MATRIX_MODE: - case GL_COLOR_ARRAY_STRIDE: - case GL_LIST_MODE: - case GL_UNPACK_SKIP_PIXELS: - case GL_PIXEL_MAP_G_TO_G_SIZE: - case GL_VERTEX_ARRAY_TYPE: - case GL_RED_BITS: - case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - case GL_INDEX_CLEAR_VALUE: - case GL_PIXEL_MAP_I_TO_G_SIZE: - case GL_ALPHA_BITS: - case GL_PIXEL_MAP_I_TO_R_SIZE: - case GL_COLOR_ARRAY_SIZE: - case GL_TEXTURE_COORD_ARRAY_SIZE: - case GL_MAP1_GRID_SEGMENTS: - case GL_VERTEX_ARRAY_SIZE: - case GL_PIXEL_MAP_R_TO_R_SIZE: - case GL_TEXTURE_COORD_ARRAY_STRIDE: - case GL_MODELVIEW_STACK_DEPTH: - case GL_MAX_TEXTURE_STACK_DEPTH: - case GL_PIXEL_MAP_I_TO_I_SIZE: - case GL_FOG_INDEX: - case GL_INDEX_WRITEMASK: - case GL_PACK_ROW_LENGTH: - case GL_CURRENT_INDEX: - case GL_STENCIL_VALUE_MASK: - case GL_UNPACK_SKIP_ROWS: - case GL_MAX_PROJECTION_STACK_DEPTH: - case GL_LIST_INDEX: - case GL_STENCIL_FUNC: - case GL_INDEX_OFFSET: - case GL_UNPACK_ROW_LENGTH: - case GL_COLOR_MATERIAL_FACE: - case GL_NORMAL_ARRAY_TYPE: - case GL_STENCIL_BITS: - case GL_PROJECTION_STACK_DEPTH: - case GL_CURRENT_RASTER_INDEX: - case GL_SHADE_MODEL: - case GL_TEXTURE_ENV_MODE: - case GL_NORMAL_ARRAY_STRIDE: - case GL_PERSPECTIVE_CORRECTION_HINT: - case GL_MAX_CLIP_PLANES: - case GL_MAX_MODELVIEW_STACK_DEPTH: - case GL_SUBPIXEL_BITS: - case GL_ACCUM_RED_BITS: - case GL_BLEND_DST: - case GL_FRONT_FACE: - case GL_MAX_EVAL_ORDER: - case GL_LINE_STIPPLE_PATTERN: - case GL_NAME_STACK_DEPTH: - case GL_MAX_ATTRIB_STACK_DEPTH: - case GL_POLYGON_SMOOTH_HINT: - case GL_ACCUM_GREEN_BITS: - { - GLint ret[1]; - int i; - glGetIntegerv(param, ret); - - for (i = 0; i < 1; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_POLYGON_MODE: - case GL_MAX_VIEWPORT_DIMS: - case GL_MAP2_GRID_SEGMENTS: - { - GLint ret[2]; - int i; - glGetIntegerv(param, ret); - - for (i = 0; i < 2; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_SCISSOR_BOX: - case GL_VIEWPORT: - { - GLint ret[4]; - int i; - glGetIntegerv(param, ret); - - for (i = 0; i < 4; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - default: - croak("Unknown glGet parameter!"); - } -#line 876 "OpenGL.c" - PUTBACK; - return; - } -} - -XS(XS_SDL__OpenGL_glIsEnabled); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glIsEnabled) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glIsEnabled(cap)"); - { - Uint32 cap = (Uint32)SvUV(ST(0)); - Uint32 RETVAL; - dXSTARG; -#line 741 "OpenGL.xs" - RETVAL = glIsEnabled(cap); -#line 894 "OpenGL.c" - XSprePUSH; PUSHu((UV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glPointSize); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPointSize) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPointSize(size)"); - { - double size = (double)SvNV(ST(0)); -#line 749 "OpenGL.xs" - glPointSize((GLfloat)size); -#line 910 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLineWidth); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLineWidth) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glLineWidth(size)"); - { - double size = (double)SvNV(ST(0)); -#line 755 "OpenGL.xs" - glLineWidth((GLfloat)size); -#line 925 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLineStipple); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLineStipple) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glLineStipple(factor, pattern)"); - { - Sint32 factor = (Sint32)SvIV(ST(0)); - Uint16 pattern = (Uint16)SvUV(ST(1)); -#line 762 "OpenGL.xs" - glLineStipple(factor,pattern); -#line 941 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPolygonMode); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPolygonMode) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPolygonMode(face, mode)"); - { - GLenum face = (GLenum)SvIV(ST(0)); - GLenum mode = (GLenum)SvIV(ST(1)); -#line 769 "OpenGL.xs" - glPolygonMode(face,mode); -#line 957 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glFrontFace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glFrontFace) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glFrontFace(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); -#line 775 "OpenGL.xs" - glFrontFace(mode); -#line 972 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCullFace); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCullFace) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCullFace(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); -#line 781 "OpenGL.xs" - glCullFace(mode); -#line 987 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPolygonStipple); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPolygonStipple) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPolygonStipple(mask)"); - { - char * mask = (char *)SvPV_nolen(ST(0)); -#line 787 "OpenGL.xs" - glPolygonStipple(mask); -#line 1002 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEdgeFlag); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEdgeFlag) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEdgeFlag(flag)"); - { - GLenum flag = (GLenum)SvIV(ST(0)); -#line 793 "OpenGL.xs" - glEdgeFlag(flag); -#line 1017 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glNormal); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glNormal) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glNormal(x, y, z)"); - { - double x = (double)SvNV(ST(0)); - double y = (double)SvNV(ST(1)); - double z = (double)SvNV(ST(2)); -#line 801 "OpenGL.xs" - glNormal3d(x,y,z); -#line 1034 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEnableClientState); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEnableClientState) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEnableClientState(array)"); - { - GLenum array = (GLenum)SvIV(ST(0)); -#line 807 "OpenGL.xs" - glEnableClientState(array); -#line 1049 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDisableClientState); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDisableClientState) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDisableClientState(array)"); - { - GLenum array = (GLenum)SvIV(ST(0)); -#line 813 "OpenGL.xs" - glDisableClientState(array); -#line 1064 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glVertexPointer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glVertexPointer) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glVertexPointer(size, type, stride, pointer)"); - { - int size = (int)SvIV(ST(0)); - GLenum type = (GLenum)SvIV(ST(1)); - Uint32 stride = (Uint32)SvUV(ST(2)); - char * pointer = (char *)SvPV_nolen(ST(3)); -#line 822 "OpenGL.xs" - glVertexPointer(size,type,stride,pointer); -#line 1082 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glColorPointer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glColorPointer) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glColorPointer(size, type, stride, pointer)"); - { - Sint32 size = (Sint32)SvIV(ST(0)); - GLenum type = (GLenum)SvIV(ST(1)); - Uint32 stride = (Uint32)SvUV(ST(2)); - char * pointer = (char *)SvPV_nolen(ST(3)); -#line 831 "OpenGL.xs" - glColorPointer(size,type,stride,pointer); -#line 1100 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glNormalPointer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glNormalPointer) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glNormalPointer(type, stride, pointer)"); - { - GLenum type = (GLenum)SvIV(ST(0)); - Uint32 stride = (Uint32)SvUV(ST(1)); - char * pointer = (char *)SvPV_nolen(ST(2)); -#line 839 "OpenGL.xs" - glNormalPointer(type,stride,pointer); -#line 1117 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexCoordPointer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexCoordPointer) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexCoordPointer(size, type, stride, pointer)"); - { - Sint32 size = (Sint32)SvIV(ST(0)); - GLenum type = (GLenum)SvIV(ST(1)); - Uint32 stride = (Uint32)SvUV(ST(2)); - char * pointer = (char *)SvPV_nolen(ST(3)); -#line 848 "OpenGL.xs" - glTexCoordPointer(size,type,stride,pointer); -#line 1135 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEdgeFlagPointer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEdgeFlagPointer) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEdgeFlagPointer(stride, pointer)"); - { - Uint32 stride = (Uint32)SvUV(ST(0)); - char * pointer = (char *)SvPV_nolen(ST(1)); -#line 855 "OpenGL.xs" - glEdgeFlagPointer(stride,pointer); -#line 1151 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glArrayElement); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glArrayElement) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glArrayElement(ith)"); - { - Uint32 ith = (Uint32)SvUV(ST(0)); -#line 861 "OpenGL.xs" - glArrayElement(ith); -#line 1166 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDrawElements); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDrawElements) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDrawElements(mode, count, type, indices)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); - Uint32 count = (Uint32)SvUV(ST(1)); - GLenum type = (GLenum)SvIV(ST(2)); - char * indices = (char *)SvPV_nolen(ST(3)); -#line 870 "OpenGL.xs" - glDrawElements( mode, count, type, indices); -#line 1184 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDrawRangeElements); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDrawRangeElements) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDrawRangeElements(mode, start, end, count, type, indices)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); - Uint32 start = (Uint32)SvUV(ST(1)); - Uint32 end = (Uint32)SvUV(ST(2)); - Uint32 count = (Uint32)SvUV(ST(3)); - GLenum type = (GLenum)SvIV(ST(4)); - char * indices = (char *)SvPV_nolen(ST(5)); -#line 881 "OpenGL.xs" - glDrawRangeElements(mode,start,end,count,type,indices); -#line 1204 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDrawArrays); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDrawArrays) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDrawArrays(mode, first, count)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); - Uint32 first = (Uint32)SvUV(ST(1)); - Uint32 count = (Uint32)SvUV(ST(2)); -#line 889 "OpenGL.xs" - glDrawArrays(mode,first,count); -#line 1221 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glInterleavedArrays); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glInterleavedArrays) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glInterleavedArrays(format, stride, pointer)"); - { - GLenum format = (GLenum)SvIV(ST(0)); - Uint32 stride = (Uint32)SvUV(ST(1)); - char * pointer = (char *)SvPV_nolen(ST(2)); -#line 897 "OpenGL.xs" - glInterleavedArrays(format,stride,pointer); -#line 1238 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPushAttrib); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPushAttrib) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPushAttrib(mask)"); - { - GLbitfield mask = (GLbitfield)SvIV(ST(0)); -#line 903 "OpenGL.xs" - glPushAttrib(mask); -#line 1253 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPopAttrib); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPopAttrib) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPopAttrib()"); - { -#line 908 "OpenGL.xs" - glPopAttrib(); -#line 1267 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPushClientAttrib); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPushClientAttrib) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPushClientAttrib(mask)"); - { - GLbitfield mask = (GLbitfield)SvIV(ST(0)); -#line 914 "OpenGL.xs" - glPushClientAttrib(mask); -#line 1282 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPopClientAttrib); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPopClientAttrib) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPopClientAttrib()"); - { -#line 919 "OpenGL.xs" - glPopClientAttrib(); -#line 1296 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMatrixMode); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMatrixMode) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMatrixMode(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); -#line 925 "OpenGL.xs" - glMatrixMode(mode); -#line 1311 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLoadIdentity); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLoadIdentity) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glLoadIdentity()"); - { -#line 930 "OpenGL.xs" - glLoadIdentity(); -#line 1325 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLoadMatrix); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLoadMatrix) -{ - dXSARGS; - { -#line 935 "OpenGL.xs" - int i; - double mat[16]; - for ( i = 0; i < 16; i++ ) { - mat[i] = (i < items && SvNOK(ST(i)) ? SvNV(ST(i)) : 0.0 ); - } - glLoadMatrixd(mat); -#line 1342 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMultMatrix); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMultMatrix) -{ - dXSARGS; - { -#line 945 "OpenGL.xs" - int i; - double mat[16]; - for ( i = 0; i < 16; i++ ) { - mat[i] = (i < items && SvNOK(ST(i)) ? SvNV(ST(i)) : 0.0 ); - } - glMultMatrixd(mat); -#line 1359 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTranslate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTranslate) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTranslate(x, y, z)"); - { - double x = (double)SvNV(ST(0)); - double y = (double)SvNV(ST(1)); - double z = (double)SvNV(ST(2)); -#line 958 "OpenGL.xs" - glTranslated(x,y,z); -#line 1376 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glRotate); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glRotate) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glRotate(angle, x, y, z)"); - { - double angle = (double)SvNV(ST(0)); - double x = (double)SvNV(ST(1)); - double y = (double)SvNV(ST(2)); - double z = (double)SvNV(ST(3)); -#line 967 "OpenGL.xs" - glRotated(angle,x,y,z); -#line 1394 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glScale); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glScale) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glScale(x, y, z)"); - { - double x = (double)SvNV(ST(0)); - double y = (double)SvNV(ST(1)); - double z = (double)SvNV(ST(2)); -#line 975 "OpenGL.xs" - glScaled(x,y,z); -#line 1411 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glFrustum); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glFrustum) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glFrustum(left, right, bottom, top, n, f)"); - { - double left = (double)SvNV(ST(0)); - double right = (double)SvNV(ST(1)); - double bottom = (double)SvNV(ST(2)); - double top = (double)SvNV(ST(3)); - double n = (double)SvNV(ST(4)); - double f = (double)SvNV(ST(5)); -#line 986 "OpenGL.xs" - glFrustum(left,right,bottom,top,n,f); -#line 1431 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glOrtho); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glOrtho) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glOrtho(left, right, bottom, top, n, f)"); - { - double left = (double)SvNV(ST(0)); - double right = (double)SvNV(ST(1)); - double bottom = (double)SvNV(ST(2)); - double top = (double)SvNV(ST(3)); - double n = (double)SvNV(ST(4)); - double f = (double)SvNV(ST(5)); -#line 997 "OpenGL.xs" - glOrtho(left,right,bottom,top,n,f); -#line 1451 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glViewport); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glViewport) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glViewport(x, y, width, height)"); - { - Sint32 x = (Sint32)SvIV(ST(0)); - Sint32 y = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); -#line 1006 "OpenGL.xs" - glViewport(x,y,width,height); -#line 1469 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDepthRange); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDepthRange) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDepthRange(n, f)"); - { - double n = (double)SvNV(ST(0)); - double f = (double)SvNV(ST(1)); -#line 1013 "OpenGL.xs" - glDepthRange(n,f); -#line 1485 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPushMatrix); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPushMatrix) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPushMatrix()"); - { -#line 1018 "OpenGL.xs" - glPushMatrix(); -#line 1499 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPopMatrix); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPopMatrix) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPopMatrix()"); - { -#line 1023 "OpenGL.xs" - glPopMatrix(); -#line 1513 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glClipPlane); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glClipPlane) -{ - dXSARGS; - if (items < 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glClipPlane(plane, ...)"); - { - GLenum plane = (GLenum)SvIV(ST(0)); -#line 1029 "OpenGL.xs" - double v[4]; - int i; - for (i = 0; i < 4; i++ ) { - v[i] = (i+1 < items && SvNOK(ST(i+1))) ? SvNV(ST(i+1)) : 0.0; - } - glClipPlane(plane,v); -#line 1533 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glColor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glColor) -{ - dXSARGS; - if (items < 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glColor(r, g, b, ...)"); - { - double r = (double)SvNV(ST(0)); - double g = (double)SvNV(ST(1)); - double b = (double)SvNV(ST(2)); -#line 1042 "OpenGL.xs" - if ( items == 4 ) { - double a; - a = SvNV(ST(3)); - glColor4d(r,g,b,a); - } else { - glColor3d(r,g,b); - } -#line 1556 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glIndex); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glIndex) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glIndex(c)"); - { - Uint32 c = (Uint32)SvUV(ST(0)); -#line 1054 "OpenGL.xs" - glIndexi(c); -#line 1571 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glShadeModel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glShadeModel) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glShadeModel(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); -#line 1060 "OpenGL.xs" - glShadeModel(mode); -#line 1586 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLight); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLight) -{ - dXSARGS; - if (items < 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glLight(light, name, ...)"); - { - GLenum light = (GLenum)SvIV(ST(0)); - GLenum name = (GLenum)SvIV(ST(1)); -#line 1067 "OpenGL.xs" - int i; - if ( items == 6 ) { - float v[4]; - for ( i = 0; i < 4; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glLightfv(light,name,v); - } else if ( items == 5 ) { - float v[3]; - for ( i = 0; i < 3; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glLightfv(light,name,v); - } else if ( items == 3 ) { - float v; - v = SvNV(ST(2)); - glLightf(light,name,v); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::Light invalid arguments"); - } -#line 1621 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLightModel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLightModel) -{ - dXSARGS; - if (items < 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glLightModel(pname, ...)"); - { - GLenum pname = (GLenum)SvIV(ST(0)); -#line 1092 "OpenGL.xs" - GLfloat vec[4]; - if ( pname == GL_LIGHT_MODEL_LOCAL_VIEWER || - pname == GL_LIGHT_MODEL_TWO_SIDE || - pname == GL_LIGHT_MODEL_COLOR_CONTROL ) { - glLightModelf(pname,SvNV(ST(1))); - } else if ( pname == GL_LIGHT_MODEL_AMBIENT) { - vec[0] = SvNV(ST(1)); - vec[1] = SvNV(ST(2)); - vec[2] = SvNV(ST(3)); - vec[3] = SvNV(ST(4)); - glLightModelfv(pname,vec); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::glLightModel unknown model %d",pname); - } -#line 1649 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMaterial); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMaterial) -{ - dXSARGS; - if (items < 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMaterial(face, name, ...)"); - { - GLenum face = (GLenum)SvIV(ST(0)); - GLenum name = (GLenum)SvIV(ST(1)); -#line 1112 "OpenGL.xs" - int i; - if ( items == 6 ) { - float v[4]; - for ( i = 0; i < 4; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glMaterialfv(face,name,v); - } else if ( items == 5 ) { - float v[3]; - for ( i = 0; i < 4; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glMaterialfv(face,name,v); - } else if ( items == 3 ) { - float v; - v = SvNV(ST(2)); - glMaterialf(face,name,v); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::Material invalid arguments"); - } -#line 1684 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glColorMaterial); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glColorMaterial) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glColorMaterial(face, mode)"); - { - GLenum face = (GLenum)SvIV(ST(0)); - GLenum mode = (GLenum)SvIV(ST(1)); -#line 1138 "OpenGL.xs" - glColorMaterial(face,mode); -#line 1700 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glBlendFunc); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glBlendFunc) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glBlendFunc(sfactor, dfactor)"); - { - GLenum sfactor = (GLenum)SvIV(ST(0)); - GLenum dfactor = (GLenum)SvIV(ST(1)); -#line 1145 "OpenGL.xs" - glBlendFunc(sfactor,dfactor); -#line 1716 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glHint); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glHint) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glHint(target, hint)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - GLenum hint = (GLenum)SvIV(ST(1)); -#line 1153 "OpenGL.xs" - glHint(target,hint); -#line 1732 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glFog); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glFog) -{ - dXSARGS; - if (items < 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glFog(name, ...)"); - { - GLenum name = (GLenum)SvIV(ST(0)); -#line 1159 "OpenGL.xs" - if ( items == 5 ) { - float v[4]; - v[0] = SvNV(ST(1)); - v[1] = SvNV(ST(2)); - v[2] = SvNV(ST(3)); - v[3] = SvNV(ST(4)); - glFogfv(name,v); - } else if ( items == 2 ) { - float v; - v = SvNV(ST(1)); - glFogf(name,v); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::Material invalid arguments"); - } -#line 1760 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPolygonOffset); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPolygonOffset) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPolygonOffset(factor, units)"); - { - double factor = (double)SvNV(ST(0)); - double units = (double)SvNV(ST(1)); -#line 1179 "OpenGL.xs" - glPolygonOffset(factor,units); -#line 1776 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glGenLists); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glGenLists) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glGenLists(range)"); - { - Uint32 range = (Uint32)SvUV(ST(0)); - Uint32 RETVAL; - dXSTARG; -#line 1185 "OpenGL.xs" - RETVAL = glGenLists(range); -#line 1793 "OpenGL.c" - XSprePUSH; PUSHu((UV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glNewList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glNewList) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glNewList(list, mode)"); - { - Uint32 list = (Uint32)SvUV(ST(0)); - GLenum mode = (GLenum)SvIV(ST(1)); -#line 1194 "OpenGL.xs" - glNewList(list,mode); -#line 1810 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEndList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEndList) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEndList()"); - { -#line 1199 "OpenGL.xs" - glEndList(); -#line 1824 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDeleteLists); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDeleteLists) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDeleteLists(base, count)"); - { - Uint32 base = (Uint32)SvUV(ST(0)); - Uint32 count = (Uint32)SvUV(ST(1)); -#line 1206 "OpenGL.xs" - glDeleteLists(base, count); -#line 1840 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCallList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCallList) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCallList(list)"); - { - Uint32 list = (Uint32)SvUV(ST(0)); -#line 1212 "OpenGL.xs" - glCallList(list); -#line 1855 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glIsList); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glIsList) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glIsList(list)"); - { - Uint32 list = (Uint32)SvUV(ST(0)); - Uint32 RETVAL; - dXSTARG; -#line 1218 "OpenGL.xs" - RETVAL = glIsList(list); -#line 1872 "OpenGL.c" - XSprePUSH; PUSHu((UV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glListBase); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glListBase) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glListBase(base)"); - { - Uint32 base = (Uint32)SvUV(ST(0)); -#line 1226 "OpenGL.xs" - glListBase(base); -#line 1888 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCallLists); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCallLists) -{ - dXSARGS; - { -#line 1231 "OpenGL.xs" - int *i, j; - if ( items > 0 ) { - i = (int*)safemalloc(sizeof(int)* (items)); - for ( j = 0; j < items; j++ ) { - i[j] = SvIV(ST(j)); - } - } else { - Perl_croak(aTHX_ "usage: SDL::OpenGL::CallLists(type,...)"); - } - glCallLists(items, GL_INT, i); - safefree(i); -#line 1910 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCallListsString); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCallListsString) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCallListsString(string)"); - { - SV* string = ST(0); -#line 1247 "OpenGL.xs" - char *str; - STRLEN len; - str = SvPV(string,len); - glCallLists(len,GL_BYTE,str); -#line 1928 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glRasterPos); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glRasterPos) -{ - dXSARGS; - if (items < 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glRasterPos(x, y, z, ...)"); - { - double x = (double)SvNV(ST(0)); - double y = (double)SvNV(ST(1)); - double z = (double)SvNV(ST(2)); -#line 1258 "OpenGL.xs" - if ( items == 4 ) { - double w = SvNV(ST(3)); - glRasterPos4d(x,y,z,w); - } else { - glRasterPos3d(x,y,z); - } -#line 1950 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glBitmap); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glBitmap) -{ - dXSARGS; - if (items != 7) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glBitmap(width, height, x1, y1, x2, y2, data)"); - { - Uint32 width = (Uint32)SvUV(ST(0)); - Uint32 height = (Uint32)SvUV(ST(1)); - double x1 = (double)SvNV(ST(2)); - double y1 = (double)SvNV(ST(3)); - double x2 = (double)SvNV(ST(4)); - double y2 = (double)SvNV(ST(5)); - char * data = (char *)SvPV_nolen(ST(6)); -#line 1275 "OpenGL.xs" - glBitmap(width,height,x1,y1,x2,y2,data); -#line 1971 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDrawPixels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDrawPixels) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDrawPixels(width, height, format, type, pixels)"); - { - Uint32 width = (Uint32)SvUV(ST(0)); - Uint32 height = (Uint32)SvUV(ST(1)); - GLenum format = (GLenum)SvIV(ST(2)); - GLenum type = (GLenum)SvIV(ST(3)); - char * pixels = (char *)SvPV_nolen(ST(4)); -#line 1285 "OpenGL.xs" - glDrawPixels(width,height,format,type,pixels); -#line 1990 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glReadPixels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glReadPixels) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glReadPixels(x, y, width, height, format, type)"); - { - Uint32 x = (Uint32)SvUV(ST(0)); - Uint32 y = (Uint32)SvUV(ST(1)); - Uint32 height = (Uint32)SvUV(ST(3)); - Uint32 width = (Uint32)SvUV(ST(2)); - GLenum format = (GLenum)SvIV(ST(4)); - GLenum type = (GLenum)SvIV(ST(5)); - SV * RETVAL; -#line 1297 "OpenGL.xs" - int len, size; - char *buf; - size = 1; /* ALPHA, BLUE, GREEN or RED */ - if (format == GL_BGR || format == GL_RGB) - size = 3; - if (format == GL_BGRA || format == GL_RGBA) - size = 4; - len = height * width * size; /* in bytes */ - RETVAL = newSV(len); /* alloc len+1 bytes */ - SvPOK_on(RETVAL); /* make an PV */ - buf = SvPVX(RETVAL); /* get ptr to buffer */ - glReadPixels(x,y,width,height,format,type,buf); - SvCUR_set(RETVAL, len); /* set real length */ -#line 2023 "OpenGL.c" - ST(0) = RETVAL; - sv_2mortal(ST(0)); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glReadPixel); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glReadPixel) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glReadPixel(x, y)"); - { - Uint32 x = (Uint32)SvUV(ST(0)); - Uint32 y = (Uint32)SvUV(ST(1)); - AV * RETVAL; -#line 1318 "OpenGL.xs" - int rgba[4]; /* r,g,b,a */ - int i; - glReadPixels(x,y,1,1,GL_RGBA,GL_UNSIGNED_INT,rgba); - RETVAL = newAV(); - for ( i = 0; i < 4; i++ ) { - av_push(RETVAL,newSViv(rgba[i])); - } -#line 2048 "OpenGL.c" - ST(0) = newRV((SV*)RETVAL); - sv_2mortal(ST(0)); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glCopyPixels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyPixels) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyPixels(x, y, width, height, buffer)"); - { - Sint32 x = (Sint32)SvIV(ST(0)); - Sint32 y = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); - GLenum buffer = (GLenum)SvIV(ST(4)); -#line 1336 "OpenGL.xs" - glCopyPixels(x,y,width,height,buffer); -#line 2069 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPixelStore); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPixelStore) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPixelStore(name, param)"); - { - Sint32 name = (Sint32)SvIV(ST(0)); - double param = (double)SvNV(ST(1)); -#line 1343 "OpenGL.xs" - glPixelStorei(name,param); -#line 2085 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPixelTransfer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPixelTransfer) -{ - dXSARGS; - if (items < 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPixelTransfer(name, ...)"); - { - GLenum name = (GLenum)SvIV(ST(0)); -#line 1349 "OpenGL.xs" - switch ( name ) { - case GL_MAP_COLOR: - case GL_MAP_STENCIL: - case GL_INDEX_SHIFT: - case GL_INDEX_OFFSET: - glPixelTransferi(name,SvIV(ST(1))); - break; - default: - glPixelTransferf(name,SvNV(ST(1))); - break; - } -#line 2110 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPixelMap); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPixelMap) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPixelMap(type, map, mapsize, values)"); - { - GLenum type = (GLenum)SvIV(ST(0)); - GLenum map = (GLenum)SvIV(ST(1)); - Sint32 mapsize = (Sint32)SvIV(ST(2)); - char * values = (char *)SvPV_nolen(ST(3)); -#line 1368 "OpenGL.xs" - switch (type) { - case GL_UNSIGNED_INT: - glPixelMapuiv(map,mapsize,(GLint*)values); - break; - case GL_UNSIGNED_SHORT: - glPixelMapusv(map,mapsize,(GLushort*)values); - break; - case GL_FLOAT: - glPixelMapfv(map,mapsize,(GLfloat*)values); - break; - } -#line 2138 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPixelZoom); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPixelZoom) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPixelZoom(zoomx, zoomy)"); - { - double zoomx = (double)SvNV(ST(0)); - double zoomy = (double)SvNV(ST(1)); -#line 1385 "OpenGL.xs" - glPixelZoom(zoomx,zoomy); -#line 2154 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#ifdef GL_VERSION_1_3 -#define XSubPPtmpAAAB 1 - -XS(XS_SDL__OpenGL_glColorTable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glColorTable) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glColorTable(target, internalFormat, width, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - GLenum internalFormat = (GLenum)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - GLenum format = (GLenum)SvIV(ST(3)); - GLenum type = (GLenum)SvIV(ST(4)); - char * data = (char *)SvPV_nolen(ST(5)); -#line 1398 "OpenGL.xs" - glColorTable(target,internalFormat,width,format,type,data); -#line 2177 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glColorTableParameter); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glColorTableParameter) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glColorTableParameter(target, name, r, g, b, a)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - GLenum name = (GLenum)SvIV(ST(1)); - double r = (double)SvNV(ST(2)); - double g = (double)SvNV(ST(3)); - double b = (double)SvNV(ST(4)); - double a = (double)SvNV(ST(5)); -#line 1409 "OpenGL.xs" - GLfloat vec[4]; - vec[0] = r; - vec[1] = g; - vec[2] = b; - vec[3] = a; - glColorTableParameterfv(target,name,vec); -#line 2202 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyColorTable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyColorTable) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyColorTable(target, internalFormat, x, y, width)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - GLenum internalFormat = (GLenum)SvIV(ST(1)); - Sint32 x = (Sint32)SvIV(ST(2)); - Sint32 y = (Sint32)SvIV(ST(3)); - Uint32 width = (Uint32)SvUV(ST(4)); -#line 1424 "OpenGL.xs" - glCopyColorTable(target,internalFormat,x,y,width); -#line 2221 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glColorSubTable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glColorSubTable) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glColorSubTable(target, start, count, format, type, data)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 start = (Uint32)SvUV(ST(1)); - Uint32 count = (Uint32)SvUV(ST(2)); - Uint32 format = (Uint32)SvUV(ST(3)); - Uint32 type = (Uint32)SvUV(ST(4)); - char * data = (char *)SvPV_nolen(ST(5)); -#line 1435 "OpenGL.xs" - glColorSubTable(target,start,count,format,type,data); -#line 2241 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyColorSubTable); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyColorSubTable) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyColorSubTable(target, start, x, y, count)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 start = (Uint32)SvUV(ST(1)); - Sint32 x = (Sint32)SvIV(ST(2)); - Sint32 y = (Sint32)SvIV(ST(3)); - Uint32 count = (Uint32)SvUV(ST(4)); -#line 1445 "OpenGL.xs" - glCopyColorSubTable(target,start,x,y,count); -#line 2260 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glConvolutionFilter2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glConvolutionFilter2D) -{ - dXSARGS; - if (items != 7) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glConvolutionFilter2D(target, internalFormat, width, height, format, type, image)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 internalFormat = (Uint32)SvUV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); - Uint32 format = (Uint32)SvUV(ST(4)); - Uint32 type = (Uint32)SvUV(ST(5)); - char * image = (char *)SvPV_nolen(ST(6)); -#line 1457 "OpenGL.xs" - glConvolutionFilter2D(target,internalFormat,width,height,format,type,image); -#line 2281 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyConvolutionFilter2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyConvolutionFilter2D) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyConvolutionFilter2D(target, internalFormat, x, y, width, height)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 internalFormat = (Uint32)SvUV(ST(1)); - Sint32 x = (Sint32)SvIV(ST(2)); - Sint32 y = (Sint32)SvIV(ST(3)); - Uint32 width = (Uint32)SvUV(ST(4)); - Uint32 height = (Uint32)SvUV(ST(5)); -#line 1468 "OpenGL.xs" - glCopyConvolutionFilter2D(target,internalFormat,x,y,width,height); -#line 2301 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glSeparableFilter2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glSeparableFilter2D) -{ - dXSARGS; - if (items != 8) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glSeparableFilter2D(target, internalFormat, width, height, format, type, row, column)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 internalFormat = (Uint32)SvUV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); - Uint32 format = (Uint32)SvUV(ST(4)); - Uint32 type = (Uint32)SvUV(ST(5)); - char * row = (char *)SvPV_nolen(ST(6)); - char * column = (char *)SvPV_nolen(ST(7)); -#line 1481 "OpenGL.xs" - glSeparableFilter2D(target,internalFormat,width,height,format,type,row,column); -#line 2323 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glConvolutionFilter1D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glConvolutionFilter1D) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glConvolutionFilter1D(target, internalFormat, width, format, type, image)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 internalFormat = (Uint32)SvUV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 format = (Uint32)SvUV(ST(3)); - Uint32 type = (Uint32)SvUV(ST(4)); - char * image = (char *)SvPV_nolen(ST(5)); -#line 1492 "OpenGL.xs" - glConvolutionFilter1D(target,internalFormat,width,format,type,image); -#line 2343 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyConvolutionFilter1D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyConvolutionFilter1D) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyConvolutionFilter1D(target, internalFormat, x, y, width)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 internalFormat = (Uint32)SvUV(ST(1)); - Sint32 x = (Sint32)SvIV(ST(2)); - Sint32 y = (Sint32)SvIV(ST(3)); - Uint32 width = (Uint32)SvUV(ST(4)); -#line 1502 "OpenGL.xs" - glCopyConvolutionFilter1D(target,internalFormat,x,y,width); -#line 2362 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glConvolutionParameter); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glConvolutionParameter) -{ - dXSARGS; - if (items < 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glConvolutionParameter(target, pname, ...)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 pname = (Uint32)SvUV(ST(1)); -#line 1509 "OpenGL.xs" - Uint32 pi; - GLfloat pv[4]; - switch(pname) { - case GL_CONVOLUTION_BORDER_MODE: - if ( items != 3 ) - Perl_croak(aTHX_ "Usage: ConvolutionParameter(target,pname,...)"); - pi = SvIV(ST(2)); - glConvolutionParameteri(target,pname,pi); - break; - case GL_CONVOLUTION_FILTER_SCALE: - case GL_CONVOLUTION_FILTER_BIAS: - if ( items != 6 ) - Perl_croak(aTHX_ "Usage: ConvolutionParameter(target,pname,...)"); - pv[0] = (GLfloat)SvNV(ST(2)); - pv[1] = (GLfloat)SvNV(ST(3)); - pv[2] = (GLfloat)SvNV(ST(4)); - pv[3] = (GLfloat)SvNV(ST(5)); - glConvolutionParameterfv(target,pname,pv); - break; - default: - Perl_croak(aTHX_ "ConvolutionParameter invalid parameter"); - break; - } -#line 2400 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glHistogram); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glHistogram) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glHistogram(target, width, internalFormat, sink)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 width = (Uint32)SvUV(ST(1)); - Uint32 internalFormat = (Uint32)SvUV(ST(2)); - GLboolean sink = (unsigned char)SvUV(ST(3)); -#line 1540 "OpenGL.xs" - glHistogram(target,width,internalFormat,sink); -#line 2418 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glGetHistogram); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glGetHistogram) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glGetHistogram(target, reset, format, type, values)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - GLboolean reset = (unsigned char)SvUV(ST(1)); - Uint32 format = (Uint32)SvUV(ST(2)); - Uint32 type = (Uint32)SvUV(ST(3)); - char * values = (char *)SvPV_nolen(ST(4)); -#line 1550 "OpenGL.xs" - glGetHistogram(target,reset,format,type,values); -#line 2437 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glResetHistogram); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glResetHistogram) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glResetHistogram(target)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); -#line 1556 "OpenGL.xs" - glResetHistogram(target); -#line 2452 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMinmax); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMinmax) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMinmax(target, internalFormat, sink)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - Uint32 internalFormat = (Uint32)SvUV(ST(1)); - GLboolean sink = (unsigned char)SvUV(ST(2)); -#line 1564 "OpenGL.xs" - glMinmax(target,internalFormat,sink); -#line 2469 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glGetMinmax); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glGetMinmax) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glGetMinmax(target, reset, format, type, values)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); - GLboolean reset = (unsigned char)SvUV(ST(1)); - Uint32 format = (Uint32)SvUV(ST(2)); - Uint32 type = (Uint32)SvUV(ST(3)); - char * values = (char *)SvPV_nolen(ST(4)); -#line 1574 "OpenGL.xs" - glGetMinmax(target,reset,format,type,values); -#line 2488 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glResetMinmax); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glResetMinmax) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glResetMinmax(target)"); - { - Uint32 target = (Uint32)SvUV(ST(0)); -#line 1580 "OpenGL.xs" - glResetMinmax(target); -#line 2503 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glBlendEquation); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glBlendEquation) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glBlendEquation(mode)"); - { - Uint32 mode = (Uint32)SvUV(ST(0)); -#line 1586 "OpenGL.xs" - glBlendEquation(mode); -#line 2518 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif // GL_VERSION_1_3 -XS(XS_SDL__OpenGL_glTexImage2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexImage2D) -{ - dXSARGS; - if (items != 9) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexImage2D(target, level, internalFormat, width, height, border, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 internalFormat = (Sint32)SvIV(ST(2)); - Uint32 width = (Uint32)SvUV(ST(3)); - Uint32 height = (Uint32)SvUV(ST(4)); - Sint32 border = (Sint32)SvIV(ST(5)); - GLenum format = (GLenum)SvIV(ST(6)); - GLenum type = (GLenum)SvIV(ST(7)); - char * data = (char *)SvPV_nolen(ST(8)); -#line 1602 "OpenGL.xs" - glTexImage2D(target,level,internalFormat,width,height,border,format,type,data); -#line 2542 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyTexImage2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyTexImage2D) -{ - dXSARGS; - if (items != 8) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyTexImage2D(target, level, internalFormat, x, y, width, height, border)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 internalFormat = (Sint32)SvIV(ST(2)); - Sint32 x = (Sint32)SvIV(ST(3)); - Sint32 y = (Sint32)SvIV(ST(4)); - Uint32 width = (Uint32)SvUV(ST(5)); - Uint32 height = (Uint32)SvUV(ST(6)); - Sint32 border = (Sint32)SvIV(ST(7)); -#line 1615 "OpenGL.xs" - glCopyTexImage2D(target,level,internalFormat,x,y,width,height,border); -#line 2564 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexSubImage2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexSubImage2D) -{ - dXSARGS; - if (items != 9) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 xoffset = (Sint32)SvIV(ST(2)); - Sint32 yoffset = (Sint32)SvIV(ST(3)); - Uint32 width = (Uint32)SvUV(ST(4)); - Uint32 height = (Uint32)SvUV(ST(5)); - GLenum format = (GLenum)SvIV(ST(6)); - GLenum type = (GLenum)SvIV(ST(7)); - char * data = (char *)SvPV_nolen(ST(8)); -#line 1629 "OpenGL.xs" - glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,data); -#line 2587 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyTexSubImage2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyTexSubImage2D) -{ - dXSARGS; - if (items != 8) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 xoffset = (Sint32)SvIV(ST(2)); - Sint32 yoffset = (Sint32)SvIV(ST(3)); - Sint32 x = (Sint32)SvIV(ST(4)); - Sint32 y = (Sint32)SvIV(ST(5)); - Uint32 width = (Uint32)SvUV(ST(6)); - Uint32 height = (Uint32)SvUV(ST(7)); -#line 1642 "OpenGL.xs" - glCopyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height); -#line 2609 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexImage1D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexImage1D) -{ - dXSARGS; - if (items != 8) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexImage1D(target, level, internalFormat, width, border, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 internalFormat = (Sint32)SvIV(ST(2)); - Uint32 width = (Uint32)SvUV(ST(3)); - Sint32 border = (Sint32)SvIV(ST(4)); - GLenum format = (GLenum)SvIV(ST(5)); - GLenum type = (GLenum)SvIV(ST(6)); - char * data = (char *)SvPV_nolen(ST(7)); -#line 1655 "OpenGL.xs" - glTexImage1D(target,level,internalFormat,width,border,format,type,data); -#line 2631 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexSubImage1D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexSubImage1D) -{ - dXSARGS; - if (items != 7) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexSubImage1D(target, level, xoffset, width, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 xoffset = (Sint32)SvIV(ST(2)); - Uint32 width = (Uint32)SvUV(ST(3)); - GLenum format = (GLenum)SvIV(ST(4)); - GLenum type = (GLenum)SvIV(ST(5)); - char * data = (char *)SvPV_nolen(ST(6)); -#line 1667 "OpenGL.xs" - glTexSubImage1D(target,level,xoffset,width,format,type,data); -#line 2652 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyTexImage1D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyTexImage1D) -{ - dXSARGS; - if (items != 7) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyTexImage1D(target, level, internalFormat, x, y, width, border)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 internalFormat = (Sint32)SvIV(ST(2)); - Sint32 x = (Sint32)SvIV(ST(3)); - Sint32 y = (Sint32)SvIV(ST(4)); - Uint32 width = (Uint32)SvUV(ST(5)); - Sint32 border = (Sint32)SvIV(ST(6)); -#line 1679 "OpenGL.xs" - glCopyTexImage1D(target,level,internalFormat,x,y,width,border); -#line 2673 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyTexSubImage1D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyTexSubImage1D) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyTexSubImage1D(target, level, xoffset, x, y, width)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 xoffset = (Sint32)SvIV(ST(2)); - Sint32 x = (Sint32)SvIV(ST(3)); - Sint32 y = (Sint32)SvIV(ST(4)); - Uint32 width = (Uint32)SvUV(ST(5)); -#line 1690 "OpenGL.xs" - glCopyTexSubImage1D(target,level,xoffset,x,y,width); -#line 2693 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#ifdef GL_VERSION_1_3 -#define XSubPPtmpAAAC 1 - -XS(XS_SDL__OpenGL_glTexImage3D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexImage3D) -{ - dXSARGS; - if (items != 10) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 internalFormat = (Sint32)SvIV(ST(2)); - Uint32 width = (Uint32)SvUV(ST(3)); - Uint32 height = (Uint32)SvUV(ST(4)); - Uint32 depth = (Uint32)SvUV(ST(5)); - Sint32 border = (Sint32)SvIV(ST(6)); - GLenum format = (GLenum)SvIV(ST(7)); - GLenum type = (GLenum)SvIV(ST(8)); - char * data = (char *)SvPV_nolen(ST(9)); -#line 1707 "OpenGL.xs" - glTexImage3D(target,level,internalFormat,width,height,depth,border,format,type,data); -#line 2720 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexSubImage3D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexSubImage3D) -{ - dXSARGS; - if (items != 11) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 xoffset = (Sint32)SvIV(ST(2)); - Sint32 yoffset = (Sint32)SvIV(ST(3)); - Sint32 zoffset = (Sint32)SvIV(ST(4)); - Uint32 width = (Uint32)SvUV(ST(5)); - Uint32 height = (Uint32)SvUV(ST(6)); - Uint32 depth = (Uint32)SvUV(ST(7)); - GLenum format = (GLenum)SvIV(ST(8)); - GLenum type = (GLenum)SvIV(ST(9)); - char * data = (char *)SvPV_nolen(ST(10)); -#line 1723 "OpenGL.xs" - glTexSubImage3D(target,level,xoffset,yoffset,zoffset, - width,height,depth,format,type,data); -#line 2746 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glCopyTexSubImage3D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glCopyTexSubImage3D) -{ - dXSARGS; - if (items != 9) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 level = (Sint32)SvIV(ST(1)); - Sint32 xoffset = (Sint32)SvIV(ST(2)); - Sint32 yoffset = (Sint32)SvIV(ST(3)); - Sint32 zoffset = (Sint32)SvIV(ST(4)); - Sint32 x = (Sint32)SvIV(ST(5)); - Sint32 y = (Sint32)SvIV(ST(6)); - Uint32 width = (Uint32)SvUV(ST(7)); - Uint32 height = (Uint32)SvUV(ST(8)); -#line 1738 "OpenGL.xs" - glCopyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height); -#line 2769 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif // GL_VERSION_1_3 -XS(XS_SDL__OpenGL_glGenTextures); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glGenTextures) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glGenTextures(n)"); - { - Uint32 n = (Uint32)SvUV(ST(0)); - AV * RETVAL; -#line 1746 "OpenGL.xs" - GLsizei i; - GLuint* names; - names = (GLuint*)safemalloc(sizeof(GLuint)*n); - RETVAL = newAV(); - glGenTextures(n,names); - for ( i = 0; i < n; i++ ) { - av_push(RETVAL,newSViv(names[i])); - } - safefree(names); -#line 2794 "OpenGL.c" - ST(0) = newRV((SV*)RETVAL); - sv_2mortal(ST(0)); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glIsTexture); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glIsTexture) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glIsTexture(texture)"); - { - Uint32 texture = (Uint32)SvUV(ST(0)); - GLboolean RETVAL; - dXSTARG; -#line 1762 "OpenGL.xs" - RETVAL = glIsTexture(texture); -#line 2813 "OpenGL.c" - XSprePUSH; PUSHu((UV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glBindTexture); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glBindTexture) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glBindTexture(target, texture)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Uint32 texture = (Uint32)SvUV(ST(1)); -#line 1771 "OpenGL.xs" - glBindTexture(target,texture); -#line 2830 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDeleteTextures); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDeleteTextures) -{ - dXSARGS; - { -#line 1776 "OpenGL.xs" - GLuint* textures; - int i; - textures = (GLuint*)safemalloc(sizeof(GLuint) * items); - if ( textures ) { - for ( i = 0; i < items; i++ ) { - textures[i] = SvIV(ST(i)); - } - } - glDeleteTextures(items,textures); - safefree(textures); -#line 2851 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glAreTexturesResident); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glAreTexturesResident) -{ - dXSARGS; - { - AV * RETVAL; -#line 1790 "OpenGL.xs" - GLuint* textures; - GLboolean *homes; - int i; - RETVAL = newAV(); - textures = (GLuint*)safemalloc(sizeof(GLuint) * items); - homes = (GLboolean*)safemalloc(sizeof(GLboolean) * items); - if ( textures ) { - for ( i = 0; i < items; i++ ) { - textures[i] = SvIV(ST(i)); - } - } - if ( GL_FALSE != glAreTexturesResident(items,textures,homes)) { - for (i = 0; i < items; i++ ) { - av_push(RETVAL,newSViv(homes[i])); - } - } - safefree(homes); - safefree(textures); -#line 2881 "OpenGL.c" - ST(0) = newRV((SV*)RETVAL); - sv_2mortal(ST(0)); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glPrioritizeTextures); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPrioritizeTextures) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPrioritizeTextures(n, names, priorities)"); - { - Uint32 n = (Uint32)SvUV(ST(0)); - char * names = (char *)SvPV_nolen(ST(1)); - char * priorities = (char *)SvPV_nolen(ST(2)); -#line 1817 "OpenGL.xs" - glPrioritizeTextures(n,(GLuint*)names,(const GLclampf *)priorities); -#line 2900 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexEnv); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexEnv) -{ - dXSARGS; - if (items < 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexEnv(target, name, ...)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - GLenum name = (GLenum)SvIV(ST(1)); -#line 1824 "OpenGL.xs" - float pv[4]; - GLint p; - switch(name) { - case GL_TEXTURE_ENV_MODE: - p = SvIV(ST(2)); - glTexEnvi(target,name,p); - break; - case GL_TEXTURE_ENV_COLOR: - pv[0] = SvNV(ST(2)); - pv[1] = SvNV(ST(3)); - pv[2] = SvNV(ST(4)); - pv[3] = SvNV(ST(5)); - glTexEnvfv(target,name,pv); - break; - } -#line 2930 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexCoord); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexCoord) -{ - dXSARGS; - { -#line 1843 "OpenGL.xs" - double s,t,r,q; - if ( items < 1 || items > 4 ) - Perl_croak (aTHX_ "usage: SDL::OpenGL::TexCoord(s,[t,[r,[q]]])"); - s = t = r = 0.0; - q = 1.0; - switch(items) { - case 4: - q = SvNV(ST(3)); - case 3: - r = SvNV(ST(2)); - case 2: - t = SvNV(ST(1)); - case 1: - s = SvNV(ST(0)); - } - glTexCoord4d(s,t,r,q); -#line 2957 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexParameter); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexParameter) -{ - dXSARGS; - if (items < 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexParameter(target, name, ...)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - GLenum name = (GLenum)SvIV(ST(1)); -#line 1865 "OpenGL.xs" - GLfloat pv[4]; - GLint p; - switch (name) { - case GL_TEXTURE_BORDER_COLOR: - pv[0] = SvNV(ST(2)); - pv[1] = SvNV(ST(3)); - pv[2] = SvNV(ST(4)); - pv[3] = SvNV(ST(5)); - glTexParameterfv(target,name,pv); - break; - case GL_TEXTURE_PRIORITY: - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - pv[0] = SvNV(ST(2)); - glTexParameterf(target,name,pv[0]); - break; - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - default: - p = SvIV(ST(2)); - glTexParameteri(target,name,p); - break; - } -#line 2995 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glTexGen); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glTexGen) -{ - dXSARGS; - if (items < 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glTexGen(coord, name, ...)"); - { - GLenum coord = (GLenum)SvIV(ST(0)); - GLenum name = (GLenum)SvIV(ST(1)); -#line 1894 "OpenGL.xs" - GLdouble *pv; - GLint p; - int i; - switch (name) { - case GL_TEXTURE_GEN_MODE: - p = SvIV(ST(2)); - glTexGeni(coord,name,p); - break; - default: - if ( items == 2 ) - Perl_croak(aTHX_ "usage: glTexGen(coord,name,...)"); - pv = (GLdouble*)safemalloc(sizeof(GLdouble)*(items-2)); - for ( i = 0; i < items - 2; i++ ) { - pv[i] = SvNV(ST(i+2)); - } - glTexGendv(coord,name,pv); - safefree(pv); - break; - } -#line 3029 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#ifdef GL_VERSION_1_3 -#define XSubPPtmpAAAD 1 - -XS(XS_SDL__OpenGL_glActiveTextureARB); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glActiveTextureARB) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glActiveTextureARB(texUnit)"); - { - GLenum texUnit = (GLenum)SvIV(ST(0)); -#line 1920 "OpenGL.xs" - glActiveTextureARB(texUnit); -#line 3047 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMultiTexCoord); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMultiTexCoord) -{ - dXSARGS; - if (items < 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMultiTexCoord(texUnit, ...)"); - { - Uint32 texUnit = (Uint32)SvUV(ST(0)); -#line 1926 "OpenGL.xs" - double s,t,r,q; - if ( items < 2 || items > 5 ) - Perl_croak (aTHX_ "usage: SDL::OpenGL::MultiTexCoord(tex,s,[t,[r,[q]]])"); - s = t = r = 0.0; - q = 1.0; - switch(items) { - case 5: - q = SvNV(ST(3)); - case 4: - r = SvNV(ST(2)); - case 3: - t = SvNV(ST(1)); - case 2: - s = SvNV(ST(0)); - } - glMultiTexCoord4dARB(texUnit,s,t,r,q); -#line 3077 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif // GL_VERSION_1_3 -XS(XS_SDL__OpenGL_glDrawBuffer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDrawBuffer) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDrawBuffer(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); -#line 1949 "OpenGL.xs" - glDrawBuffer(mode); -#line 3093 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glReadBuffer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glReadBuffer) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glReadBuffer(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); -#line 1955 "OpenGL.xs" - glReadBuffer(mode); -#line 3108 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glIndexMask); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glIndexMask) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glIndexMask(mask)"); - { - Uint32 mask = (Uint32)SvUV(ST(0)); -#line 1961 "OpenGL.xs" - glIndexMask(mask); -#line 3123 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glColorMask); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glColorMask) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glColorMask(red, green, blue, alpha)"); - { - GLboolean red = (unsigned char)SvUV(ST(0)); - GLboolean green = (unsigned char)SvUV(ST(1)); - GLboolean blue = (unsigned char)SvUV(ST(2)); - GLboolean alpha = (unsigned char)SvUV(ST(3)); -#line 1970 "OpenGL.xs" - glColorMask(red,green,blue,alpha); -#line 3141 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDepthMask); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDepthMask) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDepthMask(flag)"); - { - GLboolean flag = (unsigned char)SvUV(ST(0)); -#line 1976 "OpenGL.xs" - glDepthMask(flag); -#line 3156 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glStencilMask); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glStencilMask) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glStencilMask(mask)"); - { - Uint32 mask = (Uint32)SvUV(ST(0)); -#line 1982 "OpenGL.xs" - glStencilMask(mask); -#line 3171 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glScissor); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glScissor) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glScissor(x, y, width, height)"); - { - Sint32 x = (Sint32)SvIV(ST(0)); - Sint32 y = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); -#line 1991 "OpenGL.xs" - glScissor(x,y,width,height); -#line 3189 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glAlphaFunc); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glAlphaFunc) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glAlphaFunc(func, ref)"); - { - GLenum func = (GLenum)SvIV(ST(0)); - double ref = (double)SvNV(ST(1)); -#line 1998 "OpenGL.xs" - glAlphaFunc(func,ref); -#line 3205 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glStencilFunc); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glStencilFunc) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glStencilFunc(func, ref, mask)"); - { - GLenum func = (GLenum)SvIV(ST(0)); - Sint32 ref = (Sint32)SvIV(ST(1)); - Uint32 mask = (Uint32)SvUV(ST(2)); -#line 2006 "OpenGL.xs" - glStencilFunc(func,ref,mask); -#line 3222 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glStencilOp); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glStencilOp) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glStencilOp(fail, zfail, zpass)"); - { - GLenum fail = (GLenum)SvIV(ST(0)); - GLenum zfail = (GLenum)SvIV(ST(1)); - GLenum zpass = (GLenum)SvIV(ST(2)); -#line 2014 "OpenGL.xs" - glStencilOp(fail,zfail,zpass); -#line 3239 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glDepthFunc); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glDepthFunc) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glDepthFunc(func)"); - { - GLenum func = (GLenum)SvIV(ST(0)); -#line 2020 "OpenGL.xs" - glDepthFunc(func); -#line 3254 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLogicOp); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLogicOp) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glLogicOp(opcode)"); - { - GLenum opcode = (GLenum)SvIV(ST(0)); -#line 2026 "OpenGL.xs" - glLogicOp(opcode); -#line 3269 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glAccum); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glAccum) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glAccum(op, value)"); - { - GLenum op = (GLenum)SvIV(ST(0)); - double value = (double)SvNV(ST(1)); -#line 2033 "OpenGL.xs" - glAccum(op,value); -#line 3285 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMap1); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMap1) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMap1(target, u1, u2, stride, order, points)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - double u1 = (double)SvNV(ST(1)); - double u2 = (double)SvNV(ST(2)); - Sint32 stride = (Sint32)SvIV(ST(3)); - Sint32 order = (Sint32)SvIV(ST(4)); - char * points = (char *)SvPV_nolen(ST(5)); -#line 2044 "OpenGL.xs" - glMap1d(target,u1,u2,stride,order,(double*)points); -#line 3305 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEvalCoord1); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEvalCoord1) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEvalCoord1(u)"); - { - double u = (double)SvNV(ST(0)); -#line 2050 "OpenGL.xs" - glEvalCoord1d(u); -#line 3320 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMapGrid1); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMapGrid1) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMapGrid1(n, u1, u2)"); - { - Sint32 n = (Sint32)SvIV(ST(0)); - double u1 = (double)SvNV(ST(1)); - double u2 = (double)SvNV(ST(2)); -#line 2058 "OpenGL.xs" - glMapGrid1d(n,u1,u2); -#line 3337 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEvalMesh1); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEvalMesh1) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEvalMesh1(mode, p1, p2)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); - Sint32 p1 = (Sint32)SvIV(ST(1)); - Sint32 p2 = (Sint32)SvIV(ST(2)); -#line 2066 "OpenGL.xs" - glEvalMesh1(mode,p1,p2); -#line 3354 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMap2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMap2) -{ - dXSARGS; - if (items != 10) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMap2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - double u1 = (double)SvNV(ST(1)); - double u2 = (double)SvNV(ST(2)); - Sint32 ustride = (Sint32)SvIV(ST(3)); - Sint32 uorder = (Sint32)SvIV(ST(4)); - double v1 = (double)SvNV(ST(5)); - double v2 = (double)SvNV(ST(6)); - Sint32 vstride = (Sint32)SvIV(ST(7)); - Sint32 vorder = (Sint32)SvIV(ST(8)); - char * points = (char *)SvPV_nolen(ST(9)); -#line 2081 "OpenGL.xs" - glMap2d(target,u1,u2,ustride,uorder,v1,v2,vstride,vorder,(double*)points); -#line 3378 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEvalCoord2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEvalCoord2) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEvalCoord2(u, v)"); - { - double u = (double)SvNV(ST(0)); - double v = (double)SvNV(ST(1)); -#line 2088 "OpenGL.xs" - glEvalCoord2d(u,v); -#line 3394 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glMapGrid2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glMapGrid2) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glMapGrid2(nu, u1, u2, nv, v1, v2)"); - { - Sint32 nu = (Sint32)SvIV(ST(0)); - double u1 = (double)SvNV(ST(1)); - double u2 = (double)SvNV(ST(2)); - Sint32 nv = (Sint32)SvIV(ST(3)); - double v1 = (double)SvNV(ST(4)); - double v2 = (double)SvNV(ST(5)); -#line 2099 "OpenGL.xs" - glMapGrid2d(nu,u1,u2,nv,v1,v2); -#line 3414 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glEvalMesh2); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glEvalMesh2) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glEvalMesh2(mode, i1, i2, j1, j2)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); - Sint32 i1 = (Sint32)SvIV(ST(1)); - Sint32 i2 = (Sint32)SvIV(ST(2)); - Sint32 j1 = (Sint32)SvIV(ST(3)); - Sint32 j2 = (Sint32)SvIV(ST(4)); -#line 2109 "OpenGL.xs" - glEvalMesh2(mode,i1,i2,j1,j2); -#line 3433 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glGetError); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glGetError) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glGetError()"); - { - GLenum RETVAL; - dXSTARG; -#line 2114 "OpenGL.xs" - RETVAL = glGetError(); -#line 3449 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glRenderMode); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glRenderMode) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glRenderMode(mode)"); - { - GLenum mode = (GLenum)SvIV(ST(0)); - GLint RETVAL; - dXSTARG; -#line 2122 "OpenGL.xs" - RETVAL = glRenderMode( mode ); -#line 3467 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_glInitNames); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glInitNames) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glInitNames()"); - { -#line 2129 "OpenGL.xs" - glInitNames(); -#line 3482 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPushName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPushName) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPushName(name)"); - { - GLuint name = (GLuint)SvUV(ST(0)); -#line 2135 "OpenGL.xs" - glPushName(name); -#line 3497 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPopName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPopName) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPopName()"); - { -#line 2140 "OpenGL.xs" - glPopName(); -#line 3511 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glLoadName); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glLoadName) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glLoadName(name)"); - { - GLuint name = (GLuint)SvUV(ST(0)); -#line 2146 "OpenGL.xs" - glLoadName(name); -#line 3526 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glFeedbackBuffer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glFeedbackBuffer) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glFeedbackBuffer(size, type, buffer)"); - { - GLuint size = (GLuint)SvUV(ST(0)); - GLenum type = (GLenum)SvIV(ST(1)); - float* buffer = INT2PTR(float *,SvIV(ST(2))); -#line 2154 "OpenGL.xs" - glFeedbackBuffer(size,type,buffer); -#line 3543 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_glPassThrough); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_glPassThrough) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::glPassThrough(token)"); - { - GLfloat token = (GLfloat)SvNV(ST(0)); -#line 2160 "OpenGL.xs" - glPassThrough(token); -#line 3558 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif -#ifdef HAVE_GLU -#define XSubPPtmpAAAE 1 - -XS(XS_SDL__OpenGL_gluLookAt); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluLookAt) -{ - dXSARGS; - if (items != 9) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz)"); - { - double eyex = (double)SvNV(ST(0)); - double eyey = (double)SvNV(ST(1)); - double eyez = (double)SvNV(ST(2)); - double centerx = (double)SvNV(ST(3)); - double centery = (double)SvNV(ST(4)); - double centerz = (double)SvNV(ST(5)); - double upx = (double)SvNV(ST(6)); - double upy = (double)SvNV(ST(7)); - double upz = (double)SvNV(ST(8)); -#line 2179 "OpenGL.xs" - gluLookAt(eyex,eyey,eyez,centerx,centery,centerz,upx,upy,upz); -#line 3585 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluPerspective); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluPerspective) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluPerspective(fovy, aspect, n, f)"); - { - double fovy = (double)SvNV(ST(0)); - double aspect = (double)SvNV(ST(1)); - double n = (double)SvNV(ST(2)); - double f = (double)SvNV(ST(3)); -#line 2188 "OpenGL.xs" - gluPerspective(fovy,aspect,n,f); -#line 3603 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluPickMatrix); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluPickMatrix) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluPickMatrix(x, y, delx, dely, viewport)"); - { - double x = (double)SvNV(ST(0)); - double y = (double)SvNV(ST(1)); - double delx = (double)SvNV(ST(2)); - double dely = (double)SvNV(ST(3)); - GLint* viewport = INT2PTR(GLint *,SvIV(ST(4))); -#line 2198 "OpenGL.xs" - gluPickMatrix(x,y,delx,dely,viewport); -#line 3622 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluOrtho2D); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluOrtho2D) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluOrtho2D(left, right, bottom, top)"); - { - double left = (double)SvNV(ST(0)); - double right = (double)SvNV(ST(1)); - double bottom = (double)SvNV(ST(2)); - double top = (double)SvNV(ST(3)); -#line 2207 "OpenGL.xs" - gluOrtho2D(left,right,bottom,top); -#line 3640 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluScaleImage); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluScaleImage) -{ - dXSARGS; - if (items != 9) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout)"); - { - GLenum format = (GLenum)SvIV(ST(0)); - Uint32 widthin = (Uint32)SvUV(ST(1)); - Uint32 heightin = (Uint32)SvUV(ST(2)); - GLenum typein = (GLenum)SvIV(ST(3)); - char * datain = (char *)SvPV_nolen(ST(4)); - Uint32 widthout = (Uint32)SvUV(ST(5)); - Uint32 heightout = (Uint32)SvUV(ST(6)); - GLenum typeout = (GLenum)SvIV(ST(7)); - char * dataout = (char *)SvPV_nolen(ST(8)); - int RETVAL; - dXSTARG; -#line 2221 "OpenGL.xs" - RETVAL = gluScaleImage(format,widthin,heightin,typein,datain, - widthout,heightout,typeout,dataout); -#line 3666 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_gluBuild1DMipmaps); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild1DMipmaps) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild1DMipmaps(target, internalFormat, width, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 internalFormat = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - GLenum format = (GLenum)SvIV(ST(3)); - GLenum type = (GLenum)SvIV(ST(4)); - char * data = (char *)SvPV_nolen(ST(5)); - int RETVAL; - dXSTARG; -#line 2235 "OpenGL.xs" - RETVAL = gluBuild1DMipmaps(target,internalFormat,width,format,type,data); -#line 3689 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_gluBuild2DMipmaps); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild2DMipmaps) -{ - dXSARGS; - if (items != 7) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild2DMipmaps(target, internalFormat, width, height, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 internalFormat = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); - GLenum format = (GLenum)SvIV(ST(4)); - GLenum type = (GLenum)SvIV(ST(5)); - char * data = (char *)SvPV_nolen(ST(6)); - int RETVAL; - dXSTARG; -#line 2249 "OpenGL.xs" - RETVAL = gluBuild2DMipmaps(target,internalFormat,width,height,format,type,data); -#line 3713 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -#if HAVE_GLU_VERSION >= 12 -#define XSubPPtmpAAAF 1 - -XS(XS_SDL__OpenGL_gluBuild3DMipmaps); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild3DMipmaps) -{ - dXSARGS; - if (items != 8) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild3DMipmaps(target, internalFormat, width, height, depth, format, type, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 internalFormat = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); - Uint32 depth = (Uint32)SvUV(ST(4)); - GLenum format = (GLenum)SvIV(ST(5)); - GLenum type = (GLenum)SvIV(ST(6)); - char * data = (char *)SvPV_nolen(ST(7)); - int RETVAL; - dXSTARG; -#line 2266 "OpenGL.xs" - RETVAL = gluBuild3DMipmaps(target,internalFormat,width,height,depth, - format,type,data); -#line 3742 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -#else -#define XSubPPtmpAAAG 1 - -XS(XS_SDL__OpenGL_gluBuild3DMipmaps); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild3DMipmaps) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild3DMipmaps()"); - { -#line 2275 "OpenGL.xs" - Perl_croak (aTHX_ "SDL::OpenGL::Build3DMipmaps requires GLU 1.2"); -#line 3760 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif -#if HAVE_GLU_VERSION >= 12 -#define XSubPPtmpAAAH 1 - -XS(XS_SDL__OpenGL_gluBuild1DMipmapLevels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild1DMipmapLevels) -{ - dXSARGS; - if (items != 9) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild1DMipmapLevels(target, internalFormat, width, format, type, level, base, max, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 internalFormat = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - GLenum format = (GLenum)SvIV(ST(3)); - GLenum type = (GLenum)SvIV(ST(4)); - Sint32 level = (Sint32)SvIV(ST(5)); - Sint32 base = (Sint32)SvIV(ST(6)); - Sint32 max = (Sint32)SvIV(ST(7)); - char * data = (char *)SvPV_nolen(ST(8)); - int RETVAL; - dXSTARG; -#line 2292 "OpenGL.xs" - RETVAL = gluBuild1DMipmapLevels(target,internalFormat,width, - format,type,level,base,max,data); -#line 3790 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -#else -#define XSubPPtmpAAAI 1 - -XS(XS_SDL__OpenGL_gluBuild1DMipmapLevels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild1DMipmapLevels) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild1DMipmapLevels()"); - { -#line 2301 "OpenGL.xs" - Perl_croak(aTHX_ "SDL::OpenGL::Build1DMipmapLevels requires GLU 1.2"); -#line 3808 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif -#if HAVE_GLU_VERSION >= 12 -#define XSubPPtmpAAAJ 1 - -XS(XS_SDL__OpenGL_gluBuild2DMipmapLevels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild2DMipmapLevels) -{ - dXSARGS; - if (items != 10) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild2DMipmapLevels(target, internalFormat, width, height, format, type, level, base, max, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 internalFormat = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); - GLenum format = (GLenum)SvIV(ST(4)); - GLenum type = (GLenum)SvIV(ST(5)); - Sint32 level = (Sint32)SvIV(ST(6)); - Sint32 base = (Sint32)SvIV(ST(7)); - Sint32 max = (Sint32)SvIV(ST(8)); - char * data = (char *)SvPV_nolen(ST(9)); - int RETVAL; - dXSTARG; -#line 2319 "OpenGL.xs" - RETVAL = gluBuild2DMipmapLevels(target,internalFormat,width,height, - format,type,level,base,max,data); -#line 3839 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -#else -#define XSubPPtmpAAAK 1 - -XS(XS_SDL__OpenGL_gluBuild2DMipmapLevels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild2DMipmapLevels) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild2DMipmapLevels()"); - { -#line 2328 "OpenGL.xs" - Perl_croak(aTHX_ "SDL::OpenGL::Build2DMipmapLevels requires GLU 1.2"); -#line 3857 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif -#if HAVE_GLU_VERSION >= 12 -#define XSubPPtmpAAAL 1 - -XS(XS_SDL__OpenGL_gluBuild3DMipmapLevels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild3DMipmapLevels) -{ - dXSARGS; - if (items != 11) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild3DMipmapLevels(target, internalFormat, width, height, depth, format, type, level, base, max, data)"); - { - GLenum target = (GLenum)SvIV(ST(0)); - Sint32 internalFormat = (Sint32)SvIV(ST(1)); - Uint32 width = (Uint32)SvUV(ST(2)); - Uint32 height = (Uint32)SvUV(ST(3)); - Uint32 depth = (Uint32)SvUV(ST(4)); - GLenum format = (GLenum)SvIV(ST(5)); - GLenum type = (GLenum)SvIV(ST(6)); - Sint32 level = (Sint32)SvIV(ST(7)); - Sint32 base = (Sint32)SvIV(ST(8)); - Sint32 max = (Sint32)SvIV(ST(9)); - char * data = (char *)SvPV_nolen(ST(10)); - int RETVAL; - dXSTARG; -#line 2347 "OpenGL.xs" - RETVAL = gluBuild3DMipmapLevels(target,internalFormat,width,height,depth, - format,type,level,base,max,data); -#line 3889 "OpenGL.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -#else -#define XSubPPtmpAAAM 1 - -XS(XS_SDL__OpenGL_gluBuild3DMipmapLevels); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBuild3DMipmapLevels) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBuild3DMipmapLevels()"); - { -#line 2356 "OpenGL.xs" - Perl_croak(aTHX_ "SDL::OpenGL::Build3DMipmapLevels requires GLU 1.2"); -#line 3907 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif -XS(XS_SDL__OpenGL_gluErrorString); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluErrorString) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluErrorString(code)"); - { - GLenum code = (GLenum)SvIV(ST(0)); - char * RETVAL; - dXSTARG; -#line 2364 "OpenGL.xs" - RETVAL = (char*)gluErrorString(code); -#line 3925 "OpenGL.c" - sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_gluNewNurbsRenderer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluNewNurbsRenderer) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluNewNurbsRenderer()"); - { - GLUnurbsObj * RETVAL; - dXSTARG; -#line 2371 "OpenGL.xs" - RETVAL = gluNewNurbsRenderer(); -#line 3942 "OpenGL.c" - XSprePUSH; PUSHi(PTR2IV(RETVAL)); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_gluDeleteNurbsRenderer); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluDeleteNurbsRenderer) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluDeleteNurbsRenderer(obj)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); -#line 2379 "OpenGL.xs" - gluDeleteNurbsRenderer(obj); -#line 3958 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluNurbsProperty); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluNurbsProperty) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluNurbsProperty(obj, property, value)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - GLenum property = (GLenum)SvIV(ST(1)); - double value = (double)SvNV(ST(2)); -#line 2387 "OpenGL.xs" - gluNurbsProperty(obj,property,(float)value); -#line 3975 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluLoadSamplingMatrices); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluLoadSamplingMatrices) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluLoadSamplingMatrices(obj, mm, pm, vp)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - char * mm = (char *)SvPV_nolen(ST(1)); - char * pm = (char *)SvPV_nolen(ST(2)); - char * vp = (char *)SvPV_nolen(ST(3)); -#line 2396 "OpenGL.xs" - gluLoadSamplingMatrices(obj,(GLfloat*)mm,(GLfloat*)pm,(GLint*)vp); -#line 3993 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluGetNurbsProperty); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluGetNurbsProperty) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluGetNurbsProperty(obj, property)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - GLenum property = (GLenum)SvIV(ST(1)); - double RETVAL; - dXSTARG; -#line 2403 "OpenGL.xs" - float f; - gluGetNurbsProperty(obj,property,&f); - RETVAL = (double)f; -#line 4013 "OpenGL.c" - XSprePUSH; PUSHn((double)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_gluNurbsCallback); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluNurbsCallback) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluNurbsCallback(obj, which, cb)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - GLenum which = (GLenum)SvIV(ST(1)); - SV * cb = ST(2); -#line 2415 "OpenGL.xs" - switch(which) { - case GLU_ERROR: - sdl_perl_nurbs_error_hook = cb; - gluNurbsCallback(obj,GLU_ERROR,(GLvoid*)sdl_perl_nurbs_error_callback); - break; -#ifdef GLU_NURBS_BEGIN - case GLU_NURBS_BEGIN: - case GLU_NURBS_BEGIN_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_BEGIN_DATA, - (GLvoid*)sdl_perl_nurbs_being_callback); - break; - case GLU_NURBS_TEXTURE_COORD: - case GLU_NURBS_TEXTURE_COORD_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_TEXTURE_COORD_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_COLOR: - case GLU_NURBS_COLOR_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_COLOR_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_NORMAL: - case GLU_NURBS_NORMAL_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_NORMAL_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_VERTEX: - case GLU_NURBS_VERTEX_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_VERTEX_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_END: - case GLU_NURBS_END_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_END_DATA, - (GLvoid*)sdl_perl_nurbs_end_callback); - break; -#endif - default: - Perl_croak(aTHX_ "SDL::OpenGL::NurbsCallback - invalid type"); - } -#line 4076 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluNurbsCallbackData); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluNurbsCallbackData) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluNurbsCallbackData(obj, cb)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - SV * cb = ST(1); -#line 2467 "OpenGL.xs" - gluNurbsCallbackData(obj,(void*)cb); -#line 4092 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluBeginSurface); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBeginSurface) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBeginSurface(obj)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); -#line 2473 "OpenGL.xs" - gluBeginSurface(obj); -#line 4107 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluEndSurface); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluEndSurface) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluEndSurface(obj)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); -#line 2479 "OpenGL.xs" - gluEndSurface(obj); -#line 4122 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluNurbsSurface); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluNurbsSurface) -{ - dXSARGS; - if (items != 11) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluNurbsSurface(obj, uknot_count, uknot, vknot_count, vknot, u_stride, v_stride, ctlarray, uorder, vorder, type)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - Sint32 uknot_count = (Sint32)SvIV(ST(1)); - char * uknot = (char *)SvPV_nolen(ST(2)); - Sint32 vknot_count = (Sint32)SvIV(ST(3)); - char * vknot = (char *)SvPV_nolen(ST(4)); - Sint32 u_stride = (Sint32)SvIV(ST(5)); - Sint32 v_stride = (Sint32)SvIV(ST(6)); - char * ctlarray = (char *)SvPV_nolen(ST(7)); - Sint32 uorder = (Sint32)SvIV(ST(8)); - Sint32 vorder = (Sint32)SvIV(ST(9)); - GLenum type = (GLenum)SvIV(ST(10)); -#line 2495 "OpenGL.xs" - gluNurbsSurface(obj,uknot_count,(GLfloat*)uknot,vknot_count,(GLfloat*)vknot, - u_stride,v_stride,(GLfloat*)ctlarray,uorder,vorder,type); -#line 4148 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluBeginCurve); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBeginCurve) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBeginCurve(obj)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); -#line 2502 "OpenGL.xs" - gluBeginCurve(obj); -#line 4163 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluEndCurve); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluEndCurve) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluEndCurve(obj)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); -#line 2508 "OpenGL.xs" - gluEndCurve(obj); -#line 4178 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluNurbsCurve); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluNurbsCurve) -{ - dXSARGS; - if (items != 7) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluNurbsCurve(obj, uknot_count, uknot, u_stride, ctlarray, uorder, type)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - Sint32 uknot_count = (Sint32)SvIV(ST(1)); - char * uknot = (char *)SvPV_nolen(ST(2)); - Sint32 u_stride = (Sint32)SvIV(ST(3)); - char * ctlarray = (char *)SvPV_nolen(ST(4)); - Sint32 uorder = (Sint32)SvIV(ST(5)); - GLenum type = (GLenum)SvIV(ST(6)); -#line 2520 "OpenGL.xs" - gluNurbsCurve(obj,uknot_count,(GLfloat*)uknot,u_stride,(GLfloat*)ctlarray, - uorder,type); -#line 4200 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluBeginTrim); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluBeginTrim) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluBeginTrim(obj)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); -#line 2527 "OpenGL.xs" - gluBeginTrim(obj); -#line 4215 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluEndTrim); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluEndTrim) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluEndTrim(obj)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); -#line 2533 "OpenGL.xs" - gluEndTrim(obj); -#line 4230 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluPwlCurve); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluPwlCurve) -{ - dXSARGS; - if (items != 5) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluPwlCurve(obj, count, array, stride, type)"); - { - GLUnurbsObj * obj = INT2PTR(GLUnurbsObj *,SvIV(ST(0))); - Sint32 count = (Sint32)SvIV(ST(1)); - char * array = (char *)SvPV_nolen(ST(2)); - Sint32 stride = (Sint32)SvIV(ST(3)); - GLenum type = (GLenum)SvIV(ST(4)); -#line 2543 "OpenGL.xs" - gluPwlCurve(obj,count,(GLfloat*)array,stride,type); -#line 4249 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluUnProject); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluUnProject) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluUnProject(winx, winy, winz, mm, pm, vp)"); - { - double winx = (double)SvNV(ST(0)); - double winy = (double)SvNV(ST(1)); - double winz = (double)SvNV(ST(2)); - char * mm = (char *)SvPV_nolen(ST(3)); - char * pm = (char *)SvPV_nolen(ST(4)); - char * vp = (char *)SvPV_nolen(ST(5)); - AV * RETVAL; -#line 2554 "OpenGL.xs" - GLdouble objx, objy, objz; - RETVAL = newAV(); - av_push(RETVAL,newSViv(gluUnProject(winx,winy,winz,(GLdouble*)mm, - (GLdouble*)pm,(GLint*)vp,&objx,&objy,&objz))); - av_push(RETVAL,newSVnv((double)objx)); - av_push(RETVAL,newSVnv((double)objy)); - av_push(RETVAL,newSVnv((double)objz)); -#line 4276 "OpenGL.c" - ST(0) = newRV((SV*)RETVAL); - sv_2mortal(ST(0)); - } - XSRETURN(1); -} - -#ifdef GL_VERSION_1_3 -#define XSubPPtmpAAAN 1 - -XS(XS_SDL__OpenGL_gluUnProject4); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluUnProject4) -{ - dXSARGS; - if (items != 9) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluUnProject4(winx, winy, winz, clipw, mm, pm, vp, n, f)"); - { - double winx = (double)SvNV(ST(0)); - double winy = (double)SvNV(ST(1)); - double winz = (double)SvNV(ST(2)); - double clipw = (double)SvNV(ST(3)); - char * mm = (char *)SvPV_nolen(ST(4)); - char * pm = (char *)SvPV_nolen(ST(5)); - char * vp = (char *)SvPV_nolen(ST(6)); - double n = (double)SvNV(ST(7)); - double f = (double)SvNV(ST(8)); - AV * RETVAL; -#line 2579 "OpenGL.xs" - GLdouble objx, objy, objz, objw; - RETVAL = newAV(); - av_push(RETVAL,newSViv(gluUnProject4(winx,winy,winz,clipw,(GLdouble*)mm, - (GLdouble*)pm,(GLint*)vp,(GLclampd)n,(GLclampd)f, - &objx,&objy,&objz,&objw))); - av_push(RETVAL,newSVnv((double)objx)); - av_push(RETVAL,newSVnv((double)objy)); - av_push(RETVAL,newSVnv((double)objz)); - av_push(RETVAL,newSVnv((double)objw)); -#line 4313 "OpenGL.c" - ST(0) = newRV((SV*)RETVAL); - sv_2mortal(ST(0)); - } - XSRETURN(1); -} - -#endif // GL_VERSION_1_3 -XS(XS_SDL__OpenGL_gluProject); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluProject) -{ - dXSARGS; - if (items != 6) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluProject(objx, objy, objz, mm, pm, vp)"); - { - double objx = (double)SvNV(ST(0)); - double objy = (double)SvNV(ST(1)); - double objz = (double)SvNV(ST(2)); - char * mm = (char *)SvPV_nolen(ST(3)); - char * pm = (char *)SvPV_nolen(ST(4)); - char * vp = (char *)SvPV_nolen(ST(5)); - AV * RETVAL; -#line 2602 "OpenGL.xs" - GLdouble winx, winy, winz; - RETVAL = newAV(); - av_push(RETVAL,newSViv(gluUnProject(objx,objy,objz,(GLdouble*)mm, - (GLdouble*)pm,(GLint*)vp,&winx,&winy,&winz))); - av_push(RETVAL,newSVnv((double)winx)); - av_push(RETVAL,newSVnv((double)winy)); - av_push(RETVAL,newSVnv((double)winz)); -#line 4343 "OpenGL.c" - ST(0) = newRV((SV*)RETVAL); - sv_2mortal(ST(0)); - } - XSRETURN(1); -} - -#ifdef GL_VERSION_1_2 -#define XSubPPtmpAAAO 1 - -XS(XS_SDL__OpenGL_gluNewTess); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluNewTess) -{ - dXSARGS; - if (items != 0) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluNewTess()"); - { - GLUtesselator * RETVAL; - dXSTARG; -#line 2617 "OpenGL.xs" - RETVAL = gluNewTess(); -#line 4364 "OpenGL.c" - XSprePUSH; PUSHi(PTR2IV(RETVAL)); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_gluTessCallback); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessCallback) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessCallback(tess, type)"); - { - GLUtesselator * tess = INT2PTR(GLUtesselator *,SvIV(ST(0))); - GLenum type = (GLenum)SvIV(ST(1)); -#line 2626 "OpenGL.xs" - switch(type) { - case GLU_TESS_BEGIN: - case GLU_TESS_BEGIN_DATA: - gluTessCallback(tess,GLU_TESS_BEGIN_DATA, - (GLvoid*)sdl_perl_tess_begin_callback); - break; - - case GLU_TESS_EDGE_FLAG: - case GLU_TESS_EDGE_FLAG_DATA: - gluTessCallback(tess,GLU_TESS_EDGE_FLAG_DATA, - (GLvoid*)sdl_perl_tess_edge_flag_callback); - break; - - case GLU_TESS_VERTEX: - case GLU_TESS_VERTEX_DATA: - gluTessCallback(tess,GLU_TESS_VERTEX_DATA, - (GLvoid*)sdl_perl_tess_vertex_callback); - break; - - case GLU_TESS_END: - case GLU_TESS_END_DATA: - gluTessCallback(tess,GLU_TESS_END_DATA, - (GLvoid*)sdl_perl_tess_end_callback); - break; - - case GLU_TESS_COMBINE: - case GLU_TESS_COMBINE_DATA: - gluTessCallback(tess,GLU_TESS_COMBINE_DATA, - (GLvoid*)sdl_perl_tess_combine_callback); - break; - - case GLU_TESS_ERROR: - case GLU_TESS_ERROR_DATA: - gluTessCallback(tess,GLU_TESS_ERROR_DATA, - (GLvoid*)sdl_perl_tess_error_callback); - break; - } -#line 4417 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluTessProperty); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessProperty) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessProperty(tessobj, property, value)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); - Uint32 property = (Uint32)SvUV(ST(1)); - double value = (double)SvNV(ST(2)); -#line 2670 "OpenGL.xs" - gluTessProperty(tessobj,property,value); -#line 4434 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluGetTessProperty); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluGetTessProperty) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluGetTessProperty(tessobj, property)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); - Uint32 property = (Uint32)SvUV(ST(1)); - double RETVAL; - dXSTARG; -#line 2677 "OpenGL.xs" - gluGetTessProperty(tessobj,property,&RETVAL); -#line 4452 "OpenGL.c" - XSprePUSH; PUSHn((double)RETVAL); - } - XSRETURN(1); -} - -XS(XS_SDL__OpenGL_gluTessNormal); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessNormal) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessNormal(tessobj, x, y, z)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); - double x = (double)SvNV(ST(1)); - double y = (double)SvNV(ST(2)); - double z = (double)SvNV(ST(3)); -#line 2688 "OpenGL.xs" - gluTessNormal(tessobj,x,y,z); -#line 4471 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluTessBeginPolygon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessBeginPolygon) -{ - dXSARGS; - if (items != 2) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessBeginPolygon(tessobj, cb)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); - SV * cb = ST(1); -#line 2695 "OpenGL.xs" - gluTessBeginPolygon(tessobj,cb); -#line 4487 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluTessEndPolygon); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessEndPolygon) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessEndPolygon(tessobj)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); -#line 2701 "OpenGL.xs" - gluTessEndPolygon(tessobj); -#line 4502 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluTessBeginContour); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessBeginContour) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessBeginContour(tessobj)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); -#line 2707 "OpenGL.xs" - gluTessBeginContour(tessobj); -#line 4517 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluTessEndContour); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessEndContour) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessEndContour(tessobj)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); -#line 2713 "OpenGL.xs" - gluTessEndContour(tessobj); -#line 4532 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluDeleteTess); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluDeleteTess) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluDeleteTess(tessobj)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); -#line 2719 "OpenGL.xs" - gluDeleteTess(tessobj); -#line 4547 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__OpenGL_gluTessVertex); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__OpenGL_gluTessVertex) -{ - dXSARGS; - if (items != 3) - Perl_croak(aTHX_ "Usage: SDL::OpenGL::gluTessVertex(tessobj, coords, vd)"); - { - GLUtesselator * tessobj = INT2PTR(GLUtesselator *,SvIV(ST(0))); - char * coords = (char *)SvPV_nolen(ST(1)); - char * vd = (char *)SvPV_nolen(ST(2)); -#line 2727 "OpenGL.xs" - gluTessVertex(tessobj,(GLdouble*)coords,vd); -#line 4564 "OpenGL.c" - } - XSRETURN_EMPTY; -} - -#endif -#endif -#ifdef __cplusplus -extern "C" -#endif -XS(boot_SDL__OpenGL); /* prototype to pass -Wmissing-prototypes */ -XS(boot_SDL__OpenGL) -{ - dXSARGS; - char* file = __FILE__; - - XS_VERSION_BOOTCHECK ; - -#if XSubPPtmpAAAA - newXS("SDL::OpenGL::glClearColor", XS_SDL__OpenGL_glClearColor, file); - newXS("SDL::OpenGL::glClearIndex", XS_SDL__OpenGL_glClearIndex, file); - newXS("SDL::OpenGL::glClearDepth", XS_SDL__OpenGL_glClearDepth, file); - newXS("SDL::OpenGL::glClearStencil", XS_SDL__OpenGL_glClearStencil, file); - newXS("SDL::OpenGL::glClearAccum", XS_SDL__OpenGL_glClearAccum, file); - newXS("SDL::OpenGL::glClear", XS_SDL__OpenGL_glClear, file); - newXS("SDL::OpenGL::glFlush", XS_SDL__OpenGL_glFlush, file); - newXS("SDL::OpenGL::glFinish", XS_SDL__OpenGL_glFinish, file); - newXS("SDL::OpenGL::glRect", XS_SDL__OpenGL_glRect, file); - newXS("SDL::OpenGL::glVertex", XS_SDL__OpenGL_glVertex, file); - newXS("SDL::OpenGL::glBegin", XS_SDL__OpenGL_glBegin, file); - newXS("SDL::OpenGL::glEnd", XS_SDL__OpenGL_glEnd, file); - newXS("SDL::OpenGL::glEnable", XS_SDL__OpenGL_glEnable, file); - newXS("SDL::OpenGL::glDisable", XS_SDL__OpenGL_glDisable, file); - newXS("SDL::OpenGL::glGet", XS_SDL__OpenGL_glGet, file); - newXS("SDL::OpenGL::glIsEnabled", XS_SDL__OpenGL_glIsEnabled, file); - newXS("SDL::OpenGL::glPointSize", XS_SDL__OpenGL_glPointSize, file); - newXS("SDL::OpenGL::glLineWidth", XS_SDL__OpenGL_glLineWidth, file); - newXS("SDL::OpenGL::glLineStipple", XS_SDL__OpenGL_glLineStipple, file); - newXS("SDL::OpenGL::glPolygonMode", XS_SDL__OpenGL_glPolygonMode, file); - newXS("SDL::OpenGL::glFrontFace", XS_SDL__OpenGL_glFrontFace, file); - newXS("SDL::OpenGL::glCullFace", XS_SDL__OpenGL_glCullFace, file); - newXS("SDL::OpenGL::glPolygonStipple", XS_SDL__OpenGL_glPolygonStipple, file); - newXS("SDL::OpenGL::glEdgeFlag", XS_SDL__OpenGL_glEdgeFlag, file); - newXS("SDL::OpenGL::glNormal", XS_SDL__OpenGL_glNormal, file); - newXS("SDL::OpenGL::glEnableClientState", XS_SDL__OpenGL_glEnableClientState, file); - newXS("SDL::OpenGL::glDisableClientState", XS_SDL__OpenGL_glDisableClientState, file); - newXS("SDL::OpenGL::glVertexPointer", XS_SDL__OpenGL_glVertexPointer, file); - newXS("SDL::OpenGL::glColorPointer", XS_SDL__OpenGL_glColorPointer, file); - newXS("SDL::OpenGL::glNormalPointer", XS_SDL__OpenGL_glNormalPointer, file); - newXS("SDL::OpenGL::glTexCoordPointer", XS_SDL__OpenGL_glTexCoordPointer, file); - newXS("SDL::OpenGL::glEdgeFlagPointer", XS_SDL__OpenGL_glEdgeFlagPointer, file); - newXS("SDL::OpenGL::glArrayElement", XS_SDL__OpenGL_glArrayElement, file); - newXS("SDL::OpenGL::glDrawElements", XS_SDL__OpenGL_glDrawElements, file); - newXS("SDL::OpenGL::glDrawRangeElements", XS_SDL__OpenGL_glDrawRangeElements, file); - newXS("SDL::OpenGL::glDrawArrays", XS_SDL__OpenGL_glDrawArrays, file); - newXS("SDL::OpenGL::glInterleavedArrays", XS_SDL__OpenGL_glInterleavedArrays, file); - newXS("SDL::OpenGL::glPushAttrib", XS_SDL__OpenGL_glPushAttrib, file); - newXS("SDL::OpenGL::glPopAttrib", XS_SDL__OpenGL_glPopAttrib, file); - newXS("SDL::OpenGL::glPushClientAttrib", XS_SDL__OpenGL_glPushClientAttrib, file); - newXS("SDL::OpenGL::glPopClientAttrib", XS_SDL__OpenGL_glPopClientAttrib, file); - newXS("SDL::OpenGL::glMatrixMode", XS_SDL__OpenGL_glMatrixMode, file); - newXS("SDL::OpenGL::glLoadIdentity", XS_SDL__OpenGL_glLoadIdentity, file); - newXS("SDL::OpenGL::glLoadMatrix", XS_SDL__OpenGL_glLoadMatrix, file); - newXS("SDL::OpenGL::glMultMatrix", XS_SDL__OpenGL_glMultMatrix, file); - newXS("SDL::OpenGL::glTranslate", XS_SDL__OpenGL_glTranslate, file); - newXS("SDL::OpenGL::glRotate", XS_SDL__OpenGL_glRotate, file); - newXS("SDL::OpenGL::glScale", XS_SDL__OpenGL_glScale, file); - newXS("SDL::OpenGL::glFrustum", XS_SDL__OpenGL_glFrustum, file); - newXS("SDL::OpenGL::glOrtho", XS_SDL__OpenGL_glOrtho, file); - newXS("SDL::OpenGL::glViewport", XS_SDL__OpenGL_glViewport, file); - newXS("SDL::OpenGL::glDepthRange", XS_SDL__OpenGL_glDepthRange, file); - newXS("SDL::OpenGL::glPushMatrix", XS_SDL__OpenGL_glPushMatrix, file); - newXS("SDL::OpenGL::glPopMatrix", XS_SDL__OpenGL_glPopMatrix, file); - newXS("SDL::OpenGL::glClipPlane", XS_SDL__OpenGL_glClipPlane, file); - newXS("SDL::OpenGL::glColor", XS_SDL__OpenGL_glColor, file); - newXS("SDL::OpenGL::glIndex", XS_SDL__OpenGL_glIndex, file); - newXS("SDL::OpenGL::glShadeModel", XS_SDL__OpenGL_glShadeModel, file); - newXS("SDL::OpenGL::glLight", XS_SDL__OpenGL_glLight, file); - newXS("SDL::OpenGL::glLightModel", XS_SDL__OpenGL_glLightModel, file); - newXS("SDL::OpenGL::glMaterial", XS_SDL__OpenGL_glMaterial, file); - newXS("SDL::OpenGL::glColorMaterial", XS_SDL__OpenGL_glColorMaterial, file); - newXS("SDL::OpenGL::glBlendFunc", XS_SDL__OpenGL_glBlendFunc, file); - newXS("SDL::OpenGL::glHint", XS_SDL__OpenGL_glHint, file); - newXS("SDL::OpenGL::glFog", XS_SDL__OpenGL_glFog, file); - newXS("SDL::OpenGL::glPolygonOffset", XS_SDL__OpenGL_glPolygonOffset, file); - newXS("SDL::OpenGL::glGenLists", XS_SDL__OpenGL_glGenLists, file); - newXS("SDL::OpenGL::glNewList", XS_SDL__OpenGL_glNewList, file); - newXS("SDL::OpenGL::glEndList", XS_SDL__OpenGL_glEndList, file); - newXS("SDL::OpenGL::glDeleteLists", XS_SDL__OpenGL_glDeleteLists, file); - newXS("SDL::OpenGL::glCallList", XS_SDL__OpenGL_glCallList, file); - newXS("SDL::OpenGL::glIsList", XS_SDL__OpenGL_glIsList, file); - newXS("SDL::OpenGL::glListBase", XS_SDL__OpenGL_glListBase, file); - newXS("SDL::OpenGL::glCallLists", XS_SDL__OpenGL_glCallLists, file); - newXS("SDL::OpenGL::glCallListsString", XS_SDL__OpenGL_glCallListsString, file); - newXS("SDL::OpenGL::glRasterPos", XS_SDL__OpenGL_glRasterPos, file); - newXS("SDL::OpenGL::glBitmap", XS_SDL__OpenGL_glBitmap, file); - newXS("SDL::OpenGL::glDrawPixels", XS_SDL__OpenGL_glDrawPixels, file); - newXS("SDL::OpenGL::glReadPixels", XS_SDL__OpenGL_glReadPixels, file); - newXS("SDL::OpenGL::glReadPixel", XS_SDL__OpenGL_glReadPixel, file); - newXS("SDL::OpenGL::glCopyPixels", XS_SDL__OpenGL_glCopyPixels, file); - newXS("SDL::OpenGL::glPixelStore", XS_SDL__OpenGL_glPixelStore, file); - newXS("SDL::OpenGL::glPixelTransfer", XS_SDL__OpenGL_glPixelTransfer, file); - newXS("SDL::OpenGL::glPixelMap", XS_SDL__OpenGL_glPixelMap, file); - newXS("SDL::OpenGL::glPixelZoom", XS_SDL__OpenGL_glPixelZoom, file); -#if XSubPPtmpAAAB - newXS("SDL::OpenGL::glColorTable", XS_SDL__OpenGL_glColorTable, file); - newXS("SDL::OpenGL::glColorTableParameter", XS_SDL__OpenGL_glColorTableParameter, file); - newXS("SDL::OpenGL::glCopyColorTable", XS_SDL__OpenGL_glCopyColorTable, file); - newXS("SDL::OpenGL::glColorSubTable", XS_SDL__OpenGL_glColorSubTable, file); - newXS("SDL::OpenGL::glCopyColorSubTable", XS_SDL__OpenGL_glCopyColorSubTable, file); - newXS("SDL::OpenGL::glConvolutionFilter2D", XS_SDL__OpenGL_glConvolutionFilter2D, file); - newXS("SDL::OpenGL::glCopyConvolutionFilter2D", XS_SDL__OpenGL_glCopyConvolutionFilter2D, file); - newXS("SDL::OpenGL::glSeparableFilter2D", XS_SDL__OpenGL_glSeparableFilter2D, file); - newXS("SDL::OpenGL::glConvolutionFilter1D", XS_SDL__OpenGL_glConvolutionFilter1D, file); - newXS("SDL::OpenGL::glCopyConvolutionFilter1D", XS_SDL__OpenGL_glCopyConvolutionFilter1D, file); - newXS("SDL::OpenGL::glConvolutionParameter", XS_SDL__OpenGL_glConvolutionParameter, file); - newXS("SDL::OpenGL::glHistogram", XS_SDL__OpenGL_glHistogram, file); - newXS("SDL::OpenGL::glGetHistogram", XS_SDL__OpenGL_glGetHistogram, file); - newXS("SDL::OpenGL::glResetHistogram", XS_SDL__OpenGL_glResetHistogram, file); - newXS("SDL::OpenGL::glMinmax", XS_SDL__OpenGL_glMinmax, file); - newXS("SDL::OpenGL::glGetMinmax", XS_SDL__OpenGL_glGetMinmax, file); - newXS("SDL::OpenGL::glResetMinmax", XS_SDL__OpenGL_glResetMinmax, file); - newXS("SDL::OpenGL::glBlendEquation", XS_SDL__OpenGL_glBlendEquation, file); -#endif - newXS("SDL::OpenGL::glTexImage2D", XS_SDL__OpenGL_glTexImage2D, file); - newXS("SDL::OpenGL::glCopyTexImage2D", XS_SDL__OpenGL_glCopyTexImage2D, file); - newXS("SDL::OpenGL::glTexSubImage2D", XS_SDL__OpenGL_glTexSubImage2D, file); - newXS("SDL::OpenGL::glCopyTexSubImage2D", XS_SDL__OpenGL_glCopyTexSubImage2D, file); - newXS("SDL::OpenGL::glTexImage1D", XS_SDL__OpenGL_glTexImage1D, file); - newXS("SDL::OpenGL::glTexSubImage1D", XS_SDL__OpenGL_glTexSubImage1D, file); - newXS("SDL::OpenGL::glCopyTexImage1D", XS_SDL__OpenGL_glCopyTexImage1D, file); - newXS("SDL::OpenGL::glCopyTexSubImage1D", XS_SDL__OpenGL_glCopyTexSubImage1D, file); -#if XSubPPtmpAAAC - newXS("SDL::OpenGL::glTexImage3D", XS_SDL__OpenGL_glTexImage3D, file); - newXS("SDL::OpenGL::glTexSubImage3D", XS_SDL__OpenGL_glTexSubImage3D, file); - newXS("SDL::OpenGL::glCopyTexSubImage3D", XS_SDL__OpenGL_glCopyTexSubImage3D, file); -#endif - newXS("SDL::OpenGL::glGenTextures", XS_SDL__OpenGL_glGenTextures, file); - newXS("SDL::OpenGL::glIsTexture", XS_SDL__OpenGL_glIsTexture, file); - newXS("SDL::OpenGL::glBindTexture", XS_SDL__OpenGL_glBindTexture, file); - newXS("SDL::OpenGL::glDeleteTextures", XS_SDL__OpenGL_glDeleteTextures, file); - newXS("SDL::OpenGL::glAreTexturesResident", XS_SDL__OpenGL_glAreTexturesResident, file); - newXS("SDL::OpenGL::glPrioritizeTextures", XS_SDL__OpenGL_glPrioritizeTextures, file); - newXS("SDL::OpenGL::glTexEnv", XS_SDL__OpenGL_glTexEnv, file); - newXS("SDL::OpenGL::glTexCoord", XS_SDL__OpenGL_glTexCoord, file); - newXS("SDL::OpenGL::glTexParameter", XS_SDL__OpenGL_glTexParameter, file); - newXS("SDL::OpenGL::glTexGen", XS_SDL__OpenGL_glTexGen, file); -#if XSubPPtmpAAAD - newXS("SDL::OpenGL::glActiveTextureARB", XS_SDL__OpenGL_glActiveTextureARB, file); - newXS("SDL::OpenGL::glMultiTexCoord", XS_SDL__OpenGL_glMultiTexCoord, file); -#endif - newXS("SDL::OpenGL::glDrawBuffer", XS_SDL__OpenGL_glDrawBuffer, file); - newXS("SDL::OpenGL::glReadBuffer", XS_SDL__OpenGL_glReadBuffer, file); - newXS("SDL::OpenGL::glIndexMask", XS_SDL__OpenGL_glIndexMask, file); - newXS("SDL::OpenGL::glColorMask", XS_SDL__OpenGL_glColorMask, file); - newXS("SDL::OpenGL::glDepthMask", XS_SDL__OpenGL_glDepthMask, file); - newXS("SDL::OpenGL::glStencilMask", XS_SDL__OpenGL_glStencilMask, file); - newXS("SDL::OpenGL::glScissor", XS_SDL__OpenGL_glScissor, file); - newXS("SDL::OpenGL::glAlphaFunc", XS_SDL__OpenGL_glAlphaFunc, file); - newXS("SDL::OpenGL::glStencilFunc", XS_SDL__OpenGL_glStencilFunc, file); - newXS("SDL::OpenGL::glStencilOp", XS_SDL__OpenGL_glStencilOp, file); - newXS("SDL::OpenGL::glDepthFunc", XS_SDL__OpenGL_glDepthFunc, file); - newXS("SDL::OpenGL::glLogicOp", XS_SDL__OpenGL_glLogicOp, file); - newXS("SDL::OpenGL::glAccum", XS_SDL__OpenGL_glAccum, file); - newXS("SDL::OpenGL::glMap1", XS_SDL__OpenGL_glMap1, file); - newXS("SDL::OpenGL::glEvalCoord1", XS_SDL__OpenGL_glEvalCoord1, file); - newXS("SDL::OpenGL::glMapGrid1", XS_SDL__OpenGL_glMapGrid1, file); - newXS("SDL::OpenGL::glEvalMesh1", XS_SDL__OpenGL_glEvalMesh1, file); - newXS("SDL::OpenGL::glMap2", XS_SDL__OpenGL_glMap2, file); - newXS("SDL::OpenGL::glEvalCoord2", XS_SDL__OpenGL_glEvalCoord2, file); - newXS("SDL::OpenGL::glMapGrid2", XS_SDL__OpenGL_glMapGrid2, file); - newXS("SDL::OpenGL::glEvalMesh2", XS_SDL__OpenGL_glEvalMesh2, file); - newXS("SDL::OpenGL::glGetError", XS_SDL__OpenGL_glGetError, file); - newXS("SDL::OpenGL::glRenderMode", XS_SDL__OpenGL_glRenderMode, file); - newXS("SDL::OpenGL::glInitNames", XS_SDL__OpenGL_glInitNames, file); - newXS("SDL::OpenGL::glPushName", XS_SDL__OpenGL_glPushName, file); - newXS("SDL::OpenGL::glPopName", XS_SDL__OpenGL_glPopName, file); - newXS("SDL::OpenGL::glLoadName", XS_SDL__OpenGL_glLoadName, file); - newXS("SDL::OpenGL::glFeedbackBuffer", XS_SDL__OpenGL_glFeedbackBuffer, file); - newXS("SDL::OpenGL::glPassThrough", XS_SDL__OpenGL_glPassThrough, file); -#endif -#if XSubPPtmpAAAE - newXS("SDL::OpenGL::gluLookAt", XS_SDL__OpenGL_gluLookAt, file); - newXS("SDL::OpenGL::gluPerspective", XS_SDL__OpenGL_gluPerspective, file); - newXS("SDL::OpenGL::gluPickMatrix", XS_SDL__OpenGL_gluPickMatrix, file); - newXS("SDL::OpenGL::gluOrtho2D", XS_SDL__OpenGL_gluOrtho2D, file); - newXS("SDL::OpenGL::gluScaleImage", XS_SDL__OpenGL_gluScaleImage, file); - newXS("SDL::OpenGL::gluBuild1DMipmaps", XS_SDL__OpenGL_gluBuild1DMipmaps, file); - newXS("SDL::OpenGL::gluBuild2DMipmaps", XS_SDL__OpenGL_gluBuild2DMipmaps, file); -#if XSubPPtmpAAAF - newXS("SDL::OpenGL::gluBuild3DMipmaps", XS_SDL__OpenGL_gluBuild3DMipmaps, file); -#endif -#if XSubPPtmpAAAG - newXS("SDL::OpenGL::gluBuild3DMipmaps", XS_SDL__OpenGL_gluBuild3DMipmaps, file); -#endif -#if XSubPPtmpAAAH - newXS("SDL::OpenGL::gluBuild1DMipmapLevels", XS_SDL__OpenGL_gluBuild1DMipmapLevels, file); -#endif -#if XSubPPtmpAAAI - newXS("SDL::OpenGL::gluBuild1DMipmapLevels", XS_SDL__OpenGL_gluBuild1DMipmapLevels, file); -#endif -#if XSubPPtmpAAAJ - newXS("SDL::OpenGL::gluBuild2DMipmapLevels", XS_SDL__OpenGL_gluBuild2DMipmapLevels, file); -#endif -#if XSubPPtmpAAAK - newXS("SDL::OpenGL::gluBuild2DMipmapLevels", XS_SDL__OpenGL_gluBuild2DMipmapLevels, file); -#endif -#if XSubPPtmpAAAL - newXS("SDL::OpenGL::gluBuild3DMipmapLevels", XS_SDL__OpenGL_gluBuild3DMipmapLevels, file); -#endif -#if XSubPPtmpAAAM - newXS("SDL::OpenGL::gluBuild3DMipmapLevels", XS_SDL__OpenGL_gluBuild3DMipmapLevels, file); -#endif - newXS("SDL::OpenGL::gluErrorString", XS_SDL__OpenGL_gluErrorString, file); - newXS("SDL::OpenGL::gluNewNurbsRenderer", XS_SDL__OpenGL_gluNewNurbsRenderer, file); - newXS("SDL::OpenGL::gluDeleteNurbsRenderer", XS_SDL__OpenGL_gluDeleteNurbsRenderer, file); - newXS("SDL::OpenGL::gluNurbsProperty", XS_SDL__OpenGL_gluNurbsProperty, file); - newXS("SDL::OpenGL::gluLoadSamplingMatrices", XS_SDL__OpenGL_gluLoadSamplingMatrices, file); - newXS("SDL::OpenGL::gluGetNurbsProperty", XS_SDL__OpenGL_gluGetNurbsProperty, file); - newXS("SDL::OpenGL::gluNurbsCallback", XS_SDL__OpenGL_gluNurbsCallback, file); - newXS("SDL::OpenGL::gluNurbsCallbackData", XS_SDL__OpenGL_gluNurbsCallbackData, file); - newXS("SDL::OpenGL::gluBeginSurface", XS_SDL__OpenGL_gluBeginSurface, file); - newXS("SDL::OpenGL::gluEndSurface", XS_SDL__OpenGL_gluEndSurface, file); - newXS("SDL::OpenGL::gluNurbsSurface", XS_SDL__OpenGL_gluNurbsSurface, file); - newXS("SDL::OpenGL::gluBeginCurve", XS_SDL__OpenGL_gluBeginCurve, file); - newXS("SDL::OpenGL::gluEndCurve", XS_SDL__OpenGL_gluEndCurve, file); - newXS("SDL::OpenGL::gluNurbsCurve", XS_SDL__OpenGL_gluNurbsCurve, file); - newXS("SDL::OpenGL::gluBeginTrim", XS_SDL__OpenGL_gluBeginTrim, file); - newXS("SDL::OpenGL::gluEndTrim", XS_SDL__OpenGL_gluEndTrim, file); - newXS("SDL::OpenGL::gluPwlCurve", XS_SDL__OpenGL_gluPwlCurve, file); - newXS("SDL::OpenGL::gluUnProject", XS_SDL__OpenGL_gluUnProject, file); -#if XSubPPtmpAAAN - newXS("SDL::OpenGL::gluUnProject4", XS_SDL__OpenGL_gluUnProject4, file); -#endif - newXS("SDL::OpenGL::gluProject", XS_SDL__OpenGL_gluProject, file); -#if XSubPPtmpAAAO - newXS("SDL::OpenGL::gluNewTess", XS_SDL__OpenGL_gluNewTess, file); - newXS("SDL::OpenGL::gluTessCallback", XS_SDL__OpenGL_gluTessCallback, file); - newXS("SDL::OpenGL::gluTessProperty", XS_SDL__OpenGL_gluTessProperty, file); - newXS("SDL::OpenGL::gluGetTessProperty", XS_SDL__OpenGL_gluGetTessProperty, file); - newXS("SDL::OpenGL::gluTessNormal", XS_SDL__OpenGL_gluTessNormal, file); - newXS("SDL::OpenGL::gluTessBeginPolygon", XS_SDL__OpenGL_gluTessBeginPolygon, file); - newXS("SDL::OpenGL::gluTessEndPolygon", XS_SDL__OpenGL_gluTessEndPolygon, file); - newXS("SDL::OpenGL::gluTessBeginContour", XS_SDL__OpenGL_gluTessBeginContour, file); - newXS("SDL::OpenGL::gluTessEndContour", XS_SDL__OpenGL_gluTessEndContour, file); - newXS("SDL::OpenGL::gluDeleteTess", XS_SDL__OpenGL_gluDeleteTess, file); - newXS("SDL::OpenGL::gluTessVertex", XS_SDL__OpenGL_gluTessVertex, file); -#endif -#endif - - /* Initialisation Section */ - -#if XSubPPtmpAAAA -#if XSubPPtmpAAAB -#endif -#if XSubPPtmpAAAC -#endif -#if XSubPPtmpAAAD -#endif -#endif -#if XSubPPtmpAAAE -#if XSubPPtmpAAAF -#endif -#if XSubPPtmpAAAG -#endif -#if XSubPPtmpAAAH -#endif -#if XSubPPtmpAAAI -#endif -#if XSubPPtmpAAAJ -#endif -#if XSubPPtmpAAAK -#endif -#if XSubPPtmpAAAL -#endif -#if XSubPPtmpAAAM -#endif -#if XSubPPtmpAAAN -#endif -#if XSubPPtmpAAAO -#endif -#endif -#line 4846 "OpenGL.c" - - /* End of Initialisation Section */ - - XSRETURN_YES; -} - diff --git a/src/SDL/OpenGL.o b/src/SDL/OpenGL.o deleted file mode 100644 index a2dd124..0000000 Binary files a/src/SDL/OpenGL.o and /dev/null differ diff --git a/src/SDL/OpenGL.xs b/src/SDL/OpenGL.xs deleted file mode 100644 index 4c54228..0000000 --- a/src/SDL/OpenGL.xs +++ /dev/null @@ -1,2732 +0,0 @@ -// -// 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" -#include "XSUB.h" - -#ifndef aTHX_ -#define aTHX_ -#endif - -#include - -#include -#include - -#ifdef USE_THREADS -#define HAVE_TLS_CONTEXT -#endif - -#ifndef GL_ALL_CLIENT_ATTRIB_BITS -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFF -#endif /* GL_ALL_CLIENT_BITS */ - -#include "../defines.h" - -SV* sdl_perl_nurbs_error_hook; -void -sdl_perl_nurbs_error_callback ( GLenum errorCode ) -{ - ENTER_TLS_CONTEXT - dSP; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(errorCode))); - PUTBACK; - - call_sv(sdl_perl_nurbs_error_hook,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_nurbs_being_callback ( GLenum type, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(type))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_nurbs_multi_callback ( GLfloat *vec, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(PTR2IV(vec)))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_nurbs_end_callback ( void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_end_callback ( void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_BEGIN))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_begin_callback ( GLenum type, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_BEGIN))); - XPUSHs(sv_2mortal(newSViv(type))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_error_callback ( GLenum type, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_ERROR))); - XPUSHs(sv_2mortal(newSViv(type))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_edge_flag_callback ( GLenum flag, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_EDGE_FLAG))); - XPUSHs(sv_2mortal(newSViv(flag))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_vertex_callback ( double *vd, void *cb ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_VERTEX))); - XPUSHs(sv_2mortal(newSVnv(vd[0]))); - XPUSHs(sv_2mortal(newSVnv(vd[1]))); - XPUSHs(sv_2mortal(newSVnv(vd[2]))); - XPUSHs(sv_2mortal(newSVnv(vd[3]))); - XPUSHs(sv_2mortal(newSVnv(vd[4]))); - XPUSHs(sv_2mortal(newSVnv(vd[5]))); - PUTBACK; - - call_sv(cmd,G_VOID); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_tess_combine_callback ( GLdouble coords[3], double *vd[4], GLfloat weight[4], - GLdouble **out, void *cb ) -{ - SV *cmd; - double *data; - int width; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)cb; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(GLU_TESS_COMBINE))); - XPUSHs(sv_2mortal(newSVpvn((char*)coords,sizeof(GLdouble)*3))); - XPUSHs(sv_2mortal(newSVpvn((char*)vd,sizeof(GLdouble*)*4))); - XPUSHs(sv_2mortal(newSVpvn((char*)weight,sizeof(GLfloat)*4))); - PUTBACK; - - if ( 1 != call_sv(cmd,G_SCALAR) ) { - Perl_croak(aTHX_ "sdl_perl_tess_combine_callback failed"); - } - - data = (double*)POPp; - width = (int)POPi; - *out = (double*)malloc(sizeof(double)*width); - memcpy(*out,data,sizeof(double)*width); - - FREETMPS; - LEAVE; - LEAVE_TLS_CONTEXT -} - -MODULE = SDL::OpenGL PACKAGE = SDL::OpenGL -PROTOTYPES : DISABLE - -#ifdef HAVE_GL - -void -glClearColor ( r, g, b, a) - double r - double g - double b - double a - CODE: - glClearColor((GLfloat)r,(GLfloat)g,(GLfloat)b,(GLfloat)a); - -void -glClearIndex ( index ) - double index - CODE: - glClearIndex(index); - -void -glClearDepth ( depth ) - double depth - CODE: - glClearDepth(depth); - -void -glClearStencil ( s ) - int s - CODE: - glClearStencil(s); - -void -glClearAccum ( r, g, b, a ) - double r - double g - double b - double a - CODE: - glClearAccum((GLfloat)r,(GLfloat)g,(GLfloat)b,(GLfloat)a); - -void -glClear ( m ) - GLbitfield m - CODE: - glClear(m); - -void -glFlush () - CODE: - glFlush(); - -void -glFinish () - CODE: - glFinish(); - -void -glRect ( r ) - SDL_Rect* r - CODE: - glRecti(r->x,r->y,r->x+r->w,r->y+r->h); - -void -glVertex ( x, y, ... ) - double x - double y - CODE: - double z,w; - if ( items == 4 ) { - w = SvNV(ST(3)); - z = SvNV(ST(2)); - glVertex4d(x,y,z,w); - } else if ( items == 3 ) { - z = SvNV(ST(2)); - glVertex3d(x,y,z); - } else { - glVertex2d(x,y); - } - -void -glBegin ( mode ) - GLenum mode - CODE: - glBegin(mode); - -void -glEnd () - CODE: - glEnd(); - -void -glEnable ( cap ) - GLenum cap - CODE: - glEnable(cap); - -void -glDisable ( cap ) - GLenum cap - CODE: - glDisable(cap); - -void -glGet ( param ) - GLenum param - PPCODE: - switch (param) { - case GL_EDGE_FLAG_ARRAY: - case GL_MAP1_TEXTURE_COORD_1: - case GL_LIGHT_MODEL_TWO_SIDE: - case GL_INDEX_LOGIC_OP: - case GL_PACK_ALIGNMENT: - case GL_CLIP_PLANE4: - case GL_TEXTURE_GEN_S: - case GL_MAP1_VERTEX_3: - case GL_LIGHT6: - case GL_LIGHT0: - case GL_NORMAL_ARRAY: - case GL_EDGE_FLAG: - case GL_INDEX_ARRAY: - case GL_AUTO_NORMAL: - case GL_POLYGON_OFFSET_FILL: - case GL_MAP1_TEXTURE_COORD_4: - case GL_FOG: - case GL_LIGHT2: - case GL_UNPACK_SWAP_BYTES: - case GL_RGBA_MODE: - case GL_POLYGON_OFFSET_POINT: - case GL_POINT_SMOOTH: - case GL_ALPHA_TEST: - case GL_MAP2_TEXTURE_COORD_4: - case GL_COLOR_ARRAY: - case GL_POLYGON_OFFSET_LINE: - case GL_MAP2_NORMAL: - case GL_MAP1_INDEX: - case GL_PACK_LSB_FIRST: - case GL_MAP1_TEXTURE_COORD_2: - case GL_MAP2_VERTEX_3: - case GL_MAP2_TEXTURE_COORD_2: - case GL_CULL_FACE: - case GL_DOUBLEBUFFER: - case GL_UNPACK_LSB_FIRST: - case GL_TEXTURE_COORD_ARRAY: - case GL_LIGHT1: - case GL_TEXTURE_GEN_Q: - case GL_MAP_STENCIL: - case GL_TEXTURE_1D: - case GL_LIGHT4: - case GL_LIGHTING: - case GL_LIGHT7: - case GL_MAP1_NORMAL: - case GL_CLIP_PLANE0: - case GL_TEXTURE_GEN_R: - case GL_PACK_SWAP_BYTES: - case GL_DEPTH_WRITEMASK: - case GL_COLOR_LOGIC_OP: - case GL_CLIP_PLANE5: - case GL_NORMALIZE: - case GL_TEXTURE_2D: - case GL_CLIP_PLANE3: - case GL_COLOR_MATERIAL: - case GL_BLEND: - case GL_CLIP_PLANE2: - case GL_MAP1_VERTEX_4: - case GL_DITHER: - case GL_CLIP_PLANE1: - case GL_MAP2_INDEX: - case GL_POLYGON_SMOOTH: - case GL_STEREO: - case GL_MAP2_COLOR_4: - case GL_LIGHT3: - case GL_VERTEX_ARRAY: - case GL_MAP1_TEXTURE_COORD_3: - case GL_STENCIL_TEST: - case GL_MAP2_TEXTURE_COORD_3: - case GL_TEXTURE_GEN_T: - case GL_LIGHT_MODEL_LOCAL_VIEWER: - case GL_LINE_SMOOTH: - case GL_MAP1_COLOR_4: - case GL_MAP2_TEXTURE_COORD_1: - case GL_CURRENT_RASTER_POSITION_VALID: - case GL_INDEX_MODE: - case GL_SCISSOR_TEST: - case GL_MAP_COLOR: - case GL_POLYGON_STIPPLE: - case GL_LIGHT5: - case GL_DEPTH_TEST: - case GL_LINE_STIPPLE: - case GL_MAP2_VERTEX_4: - { - GLboolean ret[1]; - int i; - glGetBooleanv(param, ret); - - for (i = 0; i < 1; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_COLOR_WRITEMASK: - { - GLboolean ret[4]; - int i; - glGetBooleanv(param, ret); - - for (i = 0; i < 4; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_ZOOM_Y: - case GL_ALPHA_TEST_REF: - case GL_POINT_SIZE_GRANULARITY: - case GL_CURRENT_RASTER_DISTANCE: - case GL_ALPHA_SCALE: - case GL_RED_BIAS: - case GL_DEPTH_BIAS: - case GL_FOG_DENSITY: - case GL_GREEN_BIAS: - case GL_DEPTH_CLEAR_VALUE: - case GL_ALPHA_BIAS: - case GL_FOG_END: - case GL_GREEN_SCALE: - case GL_BLUE_BIAS: - case GL_DEPTH_SCALE: - case GL_POINT_SIZE: - case GL_POLYGON_OFFSET_FACTOR: - case GL_ZOOM_X: - case GL_FOG_START: - case GL_POLYGON_OFFSET_UNITS: - case GL_LINE_WIDTH: - case GL_LINE_WIDTH_GRANULARITY: - case GL_BLUE_SCALE: - case GL_RED_SCALE: - { - GLdouble ret[1]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 1; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_MODELVIEW_MATRIX: - case GL_TEXTURE_MATRIX: - case GL_PROJECTION_MATRIX: - { - GLdouble ret[16]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 16; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_POINT_SIZE_RANGE: - case GL_LINE_WIDTH_RANGE: - case GL_MAP1_GRID_DOMAIN: - case GL_DEPTH_RANGE: - { - GLdouble ret[2]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 2; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_CURRENT_NORMAL: - { - GLdouble ret[3]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 3; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_FOG_COLOR: - case GL_MAP2_GRID_DOMAIN: - case GL_CURRENT_RASTER_POSITION: - case GL_CURRENT_COLOR: - case GL_LIGHT_MODEL_AMBIENT: - case GL_CURRENT_RASTER_TEXTURE_COORDS: - case GL_TEXTURE_ENV_COLOR: - case GL_CURRENT_RASTER_COLOR: - case GL_CURRENT_TEXTURE_COORDS: - case GL_COLOR_CLEAR_VALUE: - case GL_ACCUM_CLEAR_VALUE: - { - GLdouble ret[4]; - int i; - glGetDoublev(param, ret); - - for (i = 0; i < 4; i++) { - XPUSHs(sv_2mortal(newSVnv(ret[i]))); - } - break; - } - case GL_CULL_FACE_MODE: - case GL_PIXEL_MAP_I_TO_A_SIZE: - case GL_PIXEL_MAP_A_TO_A_SIZE: - case GL_BLUE_BITS: - case GL_EDGE_FLAG_ARRAY_STRIDE: - case GL_RENDER_MODE: - case GL_FOG_MODE: - case GL_DEPTH_FUNC: - case GL_READ_BUFFER: - case GL_POINT_SMOOTH_HINT: - case GL_PACK_SKIP_PIXELS: - case GL_STENCIL_REF: - case GL_STENCIL_CLEAR_VALUE: - case GL_AUX_BUFFERS: - case GL_COLOR_MATERIAL_PARAMETER: - case GL_ACCUM_BLUE_BITS: - case GL_INDEX_SHIFT: - case GL_VERTEX_ARRAY_STRIDE: - case GL_STENCIL_PASS_DEPTH_PASS: - case GL_CLIENT_ATTRIB_STACK_DEPTH: - case GL_DRAW_BUFFER: - case GL_LINE_STIPPLE_REPEAT: - case GL_BLEND_SRC: - case GL_PIXEL_MAP_B_TO_B_SIZE: - case GL_MAX_PIXEL_MAP_TABLE: - case GL_MAX_TEXTURE_SIZE: - case GL_PIXEL_MAP_S_TO_S_SIZE: - case GL_LOGIC_OP_MODE: - case GL_DEPTH_BITS: - case GL_GREEN_BITS: - case GL_LINE_SMOOTH_HINT: - case GL_ALPHA_TEST_FUNC: - case GL_MAX_LIGHTS: - case GL_FOG_HINT: - case GL_MAX_NAME_STACK_DEPTH: - case GL_INDEX_ARRAY_TYPE: - case GL_TEXTURE_COORD_ARRAY_TYPE: - case GL_COLOR_ARRAY_TYPE: - case GL_MAX_LIST_NESTING: - case GL_STENCIL_WRITEMASK: - case GL_LIST_BASE: - case GL_ACCUM_ALPHA_BITS: - case GL_INDEX_ARRAY_STRIDE: - case GL_PIXEL_MAP_I_TO_B_SIZE: - case GL_INDEX_BITS: - case GL_STENCIL_FAIL: - case GL_UNPACK_ALIGNMENT: - case GL_STENCIL_PASS_DEPTH_FAIL: - case GL_ATTRIB_STACK_DEPTH: - case GL_PACK_SKIP_ROWS: - case GL_TEXTURE_STACK_DEPTH: - case GL_MATRIX_MODE: - case GL_COLOR_ARRAY_STRIDE: - case GL_LIST_MODE: - case GL_UNPACK_SKIP_PIXELS: - case GL_PIXEL_MAP_G_TO_G_SIZE: - case GL_VERTEX_ARRAY_TYPE: - case GL_RED_BITS: - case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - case GL_INDEX_CLEAR_VALUE: - case GL_PIXEL_MAP_I_TO_G_SIZE: - case GL_ALPHA_BITS: - case GL_PIXEL_MAP_I_TO_R_SIZE: - case GL_COLOR_ARRAY_SIZE: - case GL_TEXTURE_COORD_ARRAY_SIZE: - case GL_MAP1_GRID_SEGMENTS: - case GL_VERTEX_ARRAY_SIZE: - case GL_PIXEL_MAP_R_TO_R_SIZE: - case GL_TEXTURE_COORD_ARRAY_STRIDE: - case GL_MODELVIEW_STACK_DEPTH: - case GL_MAX_TEXTURE_STACK_DEPTH: - case GL_PIXEL_MAP_I_TO_I_SIZE: - case GL_FOG_INDEX: - case GL_INDEX_WRITEMASK: - case GL_PACK_ROW_LENGTH: - case GL_CURRENT_INDEX: - case GL_STENCIL_VALUE_MASK: - case GL_UNPACK_SKIP_ROWS: - case GL_MAX_PROJECTION_STACK_DEPTH: - case GL_LIST_INDEX: - case GL_STENCIL_FUNC: - case GL_INDEX_OFFSET: - case GL_UNPACK_ROW_LENGTH: - case GL_COLOR_MATERIAL_FACE: - case GL_NORMAL_ARRAY_TYPE: - case GL_STENCIL_BITS: - case GL_PROJECTION_STACK_DEPTH: - case GL_CURRENT_RASTER_INDEX: - case GL_SHADE_MODEL: - case GL_TEXTURE_ENV_MODE: - case GL_NORMAL_ARRAY_STRIDE: - case GL_PERSPECTIVE_CORRECTION_HINT: - case GL_MAX_CLIP_PLANES: - case GL_MAX_MODELVIEW_STACK_DEPTH: - case GL_SUBPIXEL_BITS: - case GL_ACCUM_RED_BITS: - case GL_BLEND_DST: - case GL_FRONT_FACE: - case GL_MAX_EVAL_ORDER: - case GL_LINE_STIPPLE_PATTERN: - case GL_NAME_STACK_DEPTH: - case GL_MAX_ATTRIB_STACK_DEPTH: - case GL_POLYGON_SMOOTH_HINT: - case GL_ACCUM_GREEN_BITS: - { - GLint ret[1]; - int i; - glGetIntegerv(param, ret); - - for (i = 0; i < 1; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_POLYGON_MODE: - case GL_MAX_VIEWPORT_DIMS: - case GL_MAP2_GRID_SEGMENTS: - { - GLint ret[2]; - int i; - glGetIntegerv(param, ret); - - for (i = 0; i < 2; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - case GL_SCISSOR_BOX: - case GL_VIEWPORT: - { - GLint ret[4]; - int i; - glGetIntegerv(param, ret); - - for (i = 0; i < 4; i++) { - XPUSHs(sv_2mortal(newSViv(ret[i]))); - } - break; - } - default: - croak("Unknown glGet parameter!"); - } - - -Uint32 -glIsEnabled ( cap ) - Uint32 cap - CODE: - RETVAL = glIsEnabled(cap); - OUTPUT: - RETVAL - -void -glPointSize ( size ) - double size - CODE: - glPointSize((GLfloat)size); - -void -glLineWidth ( size ) - double size - CODE: - glLineWidth((GLfloat)size); - -void -glLineStipple ( factor, pattern ) - Sint32 factor - Uint16 pattern - CODE: - glLineStipple(factor,pattern); - -void -glPolygonMode ( face, mode ) - GLenum face - GLenum mode - CODE: - glPolygonMode(face,mode); - -void -glFrontFace ( mode ) - GLenum mode - CODE: - glFrontFace(mode); - -void -glCullFace ( mode ) - GLenum mode - CODE: - glCullFace(mode); - -void -glPolygonStipple ( mask ) - char *mask - CODE: - glPolygonStipple(mask); - -void -glEdgeFlag ( flag ) - GLenum flag - CODE: - glEdgeFlag(flag); - -void -glNormal ( x, y, z ) - double x - double y - double z - CODE: - glNormal3d(x,y,z); - -void -glEnableClientState ( array ) - GLenum array - CODE: - glEnableClientState(array); - -void -glDisableClientState ( array ) - GLenum array - CODE: - glDisableClientState(array); - -void -glVertexPointer ( size, type, stride, pointer) - int size - GLenum type - Uint32 stride - char *pointer - CODE: - glVertexPointer(size,type,stride,pointer); - -void -glColorPointer ( size, type, stride, pointer ) - Sint32 size - GLenum type - Uint32 stride - char *pointer - CODE: - glColorPointer(size,type,stride,pointer); - -void -glNormalPointer ( type, stride, pointer ) - GLenum type - Uint32 stride - char *pointer - CODE: - glNormalPointer(type,stride,pointer); - -void -glTexCoordPointer ( size, type, stride, pointer ) - Sint32 size - GLenum type - Uint32 stride - char *pointer - CODE: - glTexCoordPointer(size,type,stride,pointer); - -void -glEdgeFlagPointer ( stride, pointer ) - Uint32 stride - char *pointer - CODE: - glEdgeFlagPointer(stride,pointer); - -void -glArrayElement ( ith ) - Uint32 ith - CODE: - glArrayElement(ith); - -void -glDrawElements ( mode, count, type, indices ) - GLenum mode - Uint32 count - GLenum type - char *indices - CODE: - glDrawElements( mode, count, type, indices); - -void -glDrawRangeElements ( mode, start, end, count, type, indices ) - GLenum mode - Uint32 start - Uint32 end - Uint32 count - GLenum type - char *indices - CODE: - glDrawRangeElements(mode,start,end,count,type,indices); - -void -glDrawArrays ( mode, first, count ) - GLenum mode - Uint32 first - Uint32 count - CODE: - glDrawArrays(mode,first,count); - -void -glInterleavedArrays ( format, stride, pointer ) - GLenum format - Uint32 stride - char *pointer - CODE: - glInterleavedArrays(format,stride,pointer); - -void -glPushAttrib ( mask ) - GLbitfield mask - CODE: - glPushAttrib(mask); - -void -glPopAttrib () - CODE: - glPopAttrib(); - -void -glPushClientAttrib ( mask ) - GLbitfield mask - CODE: - glPushClientAttrib(mask); - -void -glPopClientAttrib () - CODE: - glPopClientAttrib(); - -void -glMatrixMode ( mode ) - GLenum mode - CODE: - glMatrixMode(mode); - -void -glLoadIdentity () - CODE: - glLoadIdentity(); - -void -glLoadMatrix ( ... ) - CODE: - int i; - double mat[16]; - for ( i = 0; i < 16; i++ ) { - mat[i] = (i < items && SvNOK(ST(i)) ? SvNV(ST(i)) : 0.0 ); - } - glLoadMatrixd(mat); - -void -glMultMatrix ( ... ) - CODE: - int i; - double mat[16]; - for ( i = 0; i < 16; i++ ) { - mat[i] = (i < items && SvNOK(ST(i)) ? SvNV(ST(i)) : 0.0 ); - } - glMultMatrixd(mat); - -void -glTranslate ( x, y, z ) - double x - double y - double z - CODE: - glTranslated(x,y,z); - -void -glRotate ( angle, x, y, z ) - double angle - double x - double y - double z - CODE: - glRotated(angle,x,y,z); - -void -glScale ( x, y, z ) - double x - double y - double z - CODE: - glScaled(x,y,z); - -void -glFrustum ( left, right, bottom, top, n, f ) - double left - double right - double bottom - double top - double n - double f - CODE: - glFrustum(left,right,bottom,top,n,f); - -void -glOrtho ( left, right, bottom, top, n, f ) - double left - double right - double bottom - double top - double n - double f - CODE: - glOrtho(left,right,bottom,top,n,f); - -void -glViewport ( x, y, width, height ) - Sint32 x - Sint32 y - Uint32 width - Uint32 height - CODE: - glViewport(x,y,width,height); - -void -glDepthRange ( n, f ) - double n - double f - CODE: - glDepthRange(n,f); - -void -glPushMatrix () - CODE: - glPushMatrix(); - -void -glPopMatrix () - CODE: - glPopMatrix(); - -void -glClipPlane ( plane, ... ) - GLenum plane - CODE: - double v[4]; - int i; - for (i = 0; i < 4; i++ ) { - v[i] = (i+1 < items && SvNOK(ST(i+1))) ? SvNV(ST(i+1)) : 0.0; - } - glClipPlane(plane,v); - -void -glColor ( r, g, b, ... ) - double r - double g - double b - CODE: - if ( items == 4 ) { - double a; - a = SvNV(ST(3)); - glColor4d(r,g,b,a); - } else { - glColor3d(r,g,b); - } - -void -glIndex ( c ) - Uint32 c - CODE: - glIndexi(c); - -void -glShadeModel ( mode ) - GLenum mode - CODE: - glShadeModel(mode); - -void -glLight ( light, name, ... ) - GLenum light - GLenum name - CODE: - int i; - if ( items == 6 ) { - float v[4]; - for ( i = 0; i < 4; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glLightfv(light,name,v); - } else if ( items == 5 ) { - float v[3]; - for ( i = 0; i < 3; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glLightfv(light,name,v); - } else if ( items == 3 ) { - float v; - v = SvNV(ST(2)); - glLightf(light,name,v); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::Light invalid arguments"); - } - -void -glLightModel ( pname, ... ) - GLenum pname - CODE: - GLfloat vec[4]; - if ( pname == GL_LIGHT_MODEL_LOCAL_VIEWER || - pname == GL_LIGHT_MODEL_TWO_SIDE || - pname == GL_LIGHT_MODEL_COLOR_CONTROL ) { - glLightModelf(pname,SvNV(ST(1))); - } else if ( pname == GL_LIGHT_MODEL_AMBIENT) { - vec[0] = SvNV(ST(1)); - vec[1] = SvNV(ST(2)); - vec[2] = SvNV(ST(3)); - vec[3] = SvNV(ST(4)); - glLightModelfv(pname,vec); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::glLightModel unknown model %d",pname); - } - -void -glMaterial ( face, name, ... ) - GLenum face - GLenum name - CODE: - int i; - if ( items == 6 ) { - float v[4]; - for ( i = 0; i < 4; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glMaterialfv(face,name,v); - } else if ( items == 5 ) { - float v[3]; - for ( i = 0; i < 4; i++ ) { - v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0; - } - glMaterialfv(face,name,v); - } else if ( items == 3 ) { - float v; - v = SvNV(ST(2)); - glMaterialf(face,name,v); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::Material invalid arguments"); - } - -void -glColorMaterial ( face, mode ) - GLenum face - GLenum mode - CODE: - glColorMaterial(face,mode); - -void -glBlendFunc ( sfactor, dfactor ) - GLenum sfactor - GLenum dfactor - CODE: - glBlendFunc(sfactor,dfactor); - - -void -glHint ( target, hint ) - GLenum target - GLenum hint - CODE: - glHint(target,hint); - -void -glFog ( name, ... ) - GLenum name - CODE: - if ( items == 5 ) { - float v[4]; - v[0] = SvNV(ST(1)); - v[1] = SvNV(ST(2)); - v[2] = SvNV(ST(3)); - v[3] = SvNV(ST(4)); - glFogfv(name,v); - } else if ( items == 2 ) { - float v; - v = SvNV(ST(1)); - glFogf(name,v); - } else { - Perl_croak(aTHX_ "SDL::OpenGL::Material invalid arguments"); - } - -void -glPolygonOffset ( factor, units ) - double factor - double units - CODE: - glPolygonOffset(factor,units); - -Uint32 -glGenLists ( range ) - Uint32 range - CODE: - RETVAL = glGenLists(range); - OUTPUT: - RETVAL - -void -glNewList ( list, mode ) - Uint32 list - GLenum mode - CODE: - glNewList(list,mode); - -void -glEndList () - CODE: - glEndList(); - -void -glDeleteLists ( base, count ) - Uint32 base - Uint32 count - CODE: - glDeleteLists(base, count); - -void -glCallList ( list ) - Uint32 list - CODE: - glCallList(list); - -Uint32 -glIsList ( list ) - Uint32 list - CODE: - RETVAL = glIsList(list); - OUTPUT: - RETVAL - -void -glListBase ( base ) - Uint32 base - CODE: - glListBase(base); - -void -glCallLists ( ... ) - CODE: - int *i, j; - if ( items > 0 ) { - i = (int*)safemalloc(sizeof(int)* (items)); - for ( j = 0; j < items; j++ ) { - i[j] = SvIV(ST(j)); - } - } else { - Perl_croak(aTHX_ "usage: SDL::OpenGL::CallLists(type,...)"); - } - glCallLists(items, GL_INT, i); - safefree(i); - -void -glCallListsString ( string ) - SV* string - CODE: - char *str; - STRLEN len; - str = SvPV(string,len); - glCallLists(len,GL_BYTE,str); - -void -glRasterPos ( x, y, z, ... ) - double x - double y - double z - CODE: - if ( items == 4 ) { - double w = SvNV(ST(3)); - glRasterPos4d(x,y,z,w); - } else { - glRasterPos3d(x,y,z); - } - -void -glBitmap ( width, height, x1, y1, x2, y2, data ) - Uint32 width - Uint32 height - double x1 - double y1 - double x2 - double y2 - char *data - CODE: - glBitmap(width,height,x1,y1,x2,y2,data); - -void -glDrawPixels ( width, height, format, type, pixels ) - Uint32 width - Uint32 height - GLenum format - GLenum type - char *pixels - CODE: - glDrawPixels(width,height,format,type,pixels); - - -SV* -glReadPixels ( x, y, width, height, format, type ) - Uint32 x - Uint32 y - Uint32 height - Uint32 width - GLenum format - GLenum type - CODE: - int len, size; - char *buf; - size = 1; /* ALPHA, BLUE, GREEN or RED */ - if (format == GL_BGR || format == GL_RGB) - size = 3; - if (format == GL_BGRA || format == GL_RGBA) - size = 4; - len = height * width * size; /* in bytes */ - RETVAL = newSV(len); /* alloc len+1 bytes */ - SvPOK_on(RETVAL); /* make an PV */ - buf = SvPVX(RETVAL); /* get ptr to buffer */ - glReadPixels(x,y,width,height,format,type,buf); - SvCUR_set(RETVAL, len); /* set real length */ - OUTPUT: - RETVAL - -AV* -glReadPixel ( x, y ) - Uint32 x - Uint32 y - CODE: - int rgba[4]; /* r,g,b,a */ - int i; - glReadPixels(x,y,1,1,GL_RGBA,GL_UNSIGNED_INT,rgba); - RETVAL = newAV(); - for ( i = 0; i < 4; i++ ) { - av_push(RETVAL,newSViv(rgba[i])); - } - OUTPUT: - RETVAL - -void -glCopyPixels ( x, y, width, height, buffer ) - Sint32 x - Sint32 y - Uint32 width - Uint32 height - GLenum buffer - CODE: - glCopyPixels(x,y,width,height,buffer); - -void -glPixelStore ( name, param ) - Sint32 name - double param - CODE: - glPixelStorei(name,param); - -void -glPixelTransfer ( name, ... ) - GLenum name - CODE: - switch ( name ) { - case GL_MAP_COLOR: - case GL_MAP_STENCIL: - case GL_INDEX_SHIFT: - case GL_INDEX_OFFSET: - glPixelTransferi(name,SvIV(ST(1))); - break; - default: - glPixelTransferf(name,SvNV(ST(1))); - break; - } - -void -glPixelMap ( type, map, mapsize, values ) - GLenum type - GLenum map - Sint32 mapsize - char *values - CODE: - switch (type) { - case GL_UNSIGNED_INT: - glPixelMapuiv(map,mapsize,(GLint*)values); - break; - case GL_UNSIGNED_SHORT: - glPixelMapusv(map,mapsize,(GLushort*)values); - break; - case GL_FLOAT: - glPixelMapfv(map,mapsize,(GLfloat*)values); - break; - } - -void -glPixelZoom ( zoomx, zoomy ) - double zoomx - double zoomy - CODE: - glPixelZoom(zoomx,zoomy); - -#ifdef GL_VERSION_1_3 - -void -glColorTable ( target, internalFormat, width, format, type, data ) - GLenum target - GLenum internalFormat - Uint32 width - GLenum format - GLenum type - char *data - CODE: - glColorTable(target,internalFormat,width,format,type,data); - -void -glColorTableParameter ( target, name, r, g, b, a) - GLenum target - GLenum name - double r - double g - double b - double a - CODE: - GLfloat vec[4]; - vec[0] = r; - vec[1] = g; - vec[2] = b; - vec[3] = a; - glColorTableParameterfv(target,name,vec); - -void -glCopyColorTable ( target, internalFormat, x, y, width ) - GLenum target - GLenum internalFormat - Sint32 x - Sint32 y - Uint32 width - CODE: - glCopyColorTable(target,internalFormat,x,y,width); - -void -glColorSubTable ( target, start, count, format, type, data ) - Uint32 target - Uint32 start - Uint32 count - Uint32 format - Uint32 type - char *data - CODE: - glColorSubTable(target,start,count,format,type,data); - -void -glCopyColorSubTable ( target, start, x, y, count ) - Uint32 target - Uint32 start - Sint32 x - Sint32 y - Uint32 count - CODE: - glCopyColorSubTable(target,start,x,y,count); - -void -glConvolutionFilter2D ( target, internalFormat, width, height, format, type, image ) - Uint32 target - Uint32 internalFormat - Uint32 width - Uint32 height - Uint32 format - Uint32 type - char *image - CODE: - glConvolutionFilter2D(target,internalFormat,width,height,format,type,image); - -void -glCopyConvolutionFilter2D ( target, internalFormat, x, y, width, height ) - Uint32 target - Uint32 internalFormat - Sint32 x - Sint32 y - Uint32 width - Uint32 height - CODE: - glCopyConvolutionFilter2D(target,internalFormat,x,y,width,height); - -void -glSeparableFilter2D ( target, internalFormat, width, height, format, type, row, column ) - Uint32 target - Uint32 internalFormat - Uint32 width - Uint32 height - Uint32 format - Uint32 type - char *row - char *column - CODE: - glSeparableFilter2D(target,internalFormat,width,height,format,type,row,column); - -void -glConvolutionFilter1D ( target, internalFormat, width, format, type, image ) - Uint32 target - Uint32 internalFormat - Uint32 width - Uint32 format - Uint32 type - char *image - CODE: - glConvolutionFilter1D(target,internalFormat,width,format,type,image); - -void -glCopyConvolutionFilter1D ( target, internalFormat, x, y, width ) - Uint32 target - Uint32 internalFormat - Sint32 x - Sint32 y - Uint32 width - CODE: - glCopyConvolutionFilter1D(target,internalFormat,x,y,width); - -void -glConvolutionParameter ( target, pname, ... ) - Uint32 target - Uint32 pname - CODE: - Uint32 pi; - GLfloat pv[4]; - switch(pname) { - case GL_CONVOLUTION_BORDER_MODE: - if ( items != 3 ) - Perl_croak(aTHX_ "Usage: ConvolutionParameter(target,pname,...)"); - pi = SvIV(ST(2)); - glConvolutionParameteri(target,pname,pi); - break; - case GL_CONVOLUTION_FILTER_SCALE: - case GL_CONVOLUTION_FILTER_BIAS: - if ( items != 6 ) - Perl_croak(aTHX_ "Usage: ConvolutionParameter(target,pname,...)"); - pv[0] = (GLfloat)SvNV(ST(2)); - pv[1] = (GLfloat)SvNV(ST(3)); - pv[2] = (GLfloat)SvNV(ST(4)); - pv[3] = (GLfloat)SvNV(ST(5)); - glConvolutionParameterfv(target,pname,pv); - break; - default: - Perl_croak(aTHX_ "ConvolutionParameter invalid parameter"); - break; - } - -void -glHistogram ( target, width, internalFormat, sink ) - Uint32 target - Uint32 width - Uint32 internalFormat - GLboolean sink - CODE: - glHistogram(target,width,internalFormat,sink); - -void -glGetHistogram ( target, reset, format, type, values ) - Uint32 target - GLboolean reset - Uint32 format - Uint32 type - char *values - CODE: - glGetHistogram(target,reset,format,type,values); - -void -glResetHistogram ( target ) - Uint32 target - CODE: - glResetHistogram(target); - -void -glMinmax ( target, internalFormat, sink ) - Uint32 target - Uint32 internalFormat - GLboolean sink - CODE: - glMinmax(target,internalFormat,sink); - -void -glGetMinmax ( target, reset, format, type, values ) - Uint32 target - GLboolean reset - Uint32 format - Uint32 type - char *values - CODE: - glGetMinmax(target,reset,format,type,values); - -void -glResetMinmax ( target ) - Uint32 target - CODE: - glResetMinmax(target); - -void -glBlendEquation ( mode ) - Uint32 mode - CODE: - glBlendEquation(mode); - -#endif // GL_VERSION_1_3 - -void -glTexImage2D ( target, level, internalFormat, width, height, border, format, type, data ) - GLenum target - Sint32 level - Sint32 internalFormat - Uint32 width - Uint32 height - Sint32 border - GLenum format - GLenum type - char *data - CODE: - glTexImage2D(target,level,internalFormat,width,height,border,format,type,data); - -void -glCopyTexImage2D ( target, level, internalFormat, x, y, width, height, border ) - GLenum target - Sint32 level - Sint32 internalFormat - Sint32 x - Sint32 y - Uint32 width - Uint32 height - Sint32 border - CODE: - glCopyTexImage2D(target,level,internalFormat,x,y,width,height,border); - -void -glTexSubImage2D ( target, level, xoffset, yoffset, width, height, format, type, data ) - GLenum target - Sint32 level - Sint32 xoffset - Sint32 yoffset - Uint32 width - Uint32 height - GLenum format - GLenum type - char *data - CODE: - glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,data); - -void -glCopyTexSubImage2D ( target, level, xoffset, yoffset, x, y, width, height ) - GLenum target - Sint32 level - Sint32 xoffset - Sint32 yoffset - Sint32 x - Sint32 y - Uint32 width - Uint32 height - CODE: - glCopyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height); - -void -glTexImage1D ( target, level, internalFormat, width, border, format, type, data ) - GLenum target - Sint32 level - Sint32 internalFormat - Uint32 width - Sint32 border - GLenum format - GLenum type - char *data - CODE: - glTexImage1D(target,level,internalFormat,width,border,format,type,data); - -void -glTexSubImage1D ( target, level, xoffset, width, format, type, data ) - GLenum target - Sint32 level - Sint32 xoffset - Uint32 width - GLenum format - GLenum type - char *data - CODE: - glTexSubImage1D(target,level,xoffset,width,format,type,data); - -void -glCopyTexImage1D ( target, level, internalFormat, x, y, width, border ) - GLenum target - Sint32 level - Sint32 internalFormat - Sint32 x - Sint32 y - Uint32 width - Sint32 border - CODE: - glCopyTexImage1D(target,level,internalFormat,x,y,width,border); - -void -glCopyTexSubImage1D ( target, level, xoffset, x, y, width ) - GLenum target - Sint32 level - Sint32 xoffset - Sint32 x - Sint32 y - Uint32 width - CODE: - glCopyTexSubImage1D(target,level,xoffset,x,y,width); - -#ifdef GL_VERSION_1_3 - -void -glTexImage3D ( target, level, internalFormat, width, height, depth, border, format, type, data ) - GLenum target - Sint32 level - Sint32 internalFormat - Uint32 width - Uint32 height - Uint32 depth - Sint32 border - GLenum format - GLenum type - char *data - CODE: - glTexImage3D(target,level,internalFormat,width,height,depth,border,format,type,data); - -void -glTexSubImage3D ( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data ) - GLenum target - Sint32 level - Sint32 xoffset - Sint32 yoffset - Sint32 zoffset - Uint32 width - Uint32 height - Uint32 depth - GLenum format - GLenum type - char *data - CODE: - glTexSubImage3D(target,level,xoffset,yoffset,zoffset, - width,height,depth,format,type,data); - -void -glCopyTexSubImage3D ( target, level, xoffset, yoffset, zoffset, x, y, width, height ) - GLenum target - Sint32 level - Sint32 xoffset - Sint32 yoffset - Sint32 zoffset - Sint32 x - Sint32 y - Uint32 width - Uint32 height - CODE: - glCopyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height); - -#endif // GL_VERSION_1_3 - -AV* -glGenTextures ( n ) - Uint32 n; - CODE: - GLsizei i; - GLuint* names; - names = (GLuint*)safemalloc(sizeof(GLuint)*n); - RETVAL = newAV(); - glGenTextures(n,names); - for ( i = 0; i < n; i++ ) { - av_push(RETVAL,newSViv(names[i])); - } - safefree(names); - OUTPUT: - RETVAL - -GLboolean -glIsTexture ( texture ) - Uint32 texture - CODE: - RETVAL = glIsTexture(texture); - OUTPUT: - RETVAL - -void -glBindTexture ( target, texture ) - GLenum target - Uint32 texture - CODE: - glBindTexture(target,texture); - -void -glDeleteTextures ( ... ) - CODE: - GLuint* textures; - int i; - textures = (GLuint*)safemalloc(sizeof(GLuint) * items); - if ( textures ) { - for ( i = 0; i < items; i++ ) { - textures[i] = SvIV(ST(i)); - } - } - glDeleteTextures(items,textures); - safefree(textures); - -AV* -glAreTexturesResident ( ... ) - CODE: - GLuint* textures; - GLboolean *homes; - int i; - RETVAL = newAV(); - textures = (GLuint*)safemalloc(sizeof(GLuint) * items); - homes = (GLboolean*)safemalloc(sizeof(GLboolean) * items); - if ( textures ) { - for ( i = 0; i < items; i++ ) { - textures[i] = SvIV(ST(i)); - } - } - if ( GL_FALSE != glAreTexturesResident(items,textures,homes)) { - for (i = 0; i < items; i++ ) { - av_push(RETVAL,newSViv(homes[i])); - } - } - safefree(homes); - safefree(textures); - OUTPUT: - RETVAL - -void -glPrioritizeTextures ( n, names, priorities ) - Uint32 n - char *names - char *priorities - CODE: - glPrioritizeTextures(n,(GLuint*)names,(const GLclampf *)priorities); - -void -glTexEnv ( target, name, ... ) - GLenum target - GLenum name - CODE: - float pv[4]; - GLint p; - switch(name) { - case GL_TEXTURE_ENV_MODE: - p = SvIV(ST(2)); - glTexEnvi(target,name,p); - break; - case GL_TEXTURE_ENV_COLOR: - pv[0] = SvNV(ST(2)); - pv[1] = SvNV(ST(3)); - pv[2] = SvNV(ST(4)); - pv[3] = SvNV(ST(5)); - glTexEnvfv(target,name,pv); - break; - } - -void -glTexCoord ( ... ) - CODE: - double s,t,r,q; - if ( items < 1 || items > 4 ) - Perl_croak (aTHX_ "usage: SDL::OpenGL::TexCoord(s,[t,[r,[q]]])"); - s = t = r = 0.0; - q = 1.0; - switch(items) { - case 4: - q = SvNV(ST(3)); - case 3: - r = SvNV(ST(2)); - case 2: - t = SvNV(ST(1)); - case 1: - s = SvNV(ST(0)); - } - glTexCoord4d(s,t,r,q); - -void -glTexParameter ( target, name, ... ) - GLenum target - GLenum name - CODE: - GLfloat pv[4]; - GLint p; - switch (name) { - case GL_TEXTURE_BORDER_COLOR: - pv[0] = SvNV(ST(2)); - pv[1] = SvNV(ST(3)); - pv[2] = SvNV(ST(4)); - pv[3] = SvNV(ST(5)); - glTexParameterfv(target,name,pv); - break; - case GL_TEXTURE_PRIORITY: - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - pv[0] = SvNV(ST(2)); - glTexParameterf(target,name,pv[0]); - break; - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - default: - p = SvIV(ST(2)); - glTexParameteri(target,name,p); - break; - } - -void -glTexGen ( coord, name, ... ) - GLenum coord - GLenum name - CODE: - GLdouble *pv; - GLint p; - int i; - switch (name) { - case GL_TEXTURE_GEN_MODE: - p = SvIV(ST(2)); - glTexGeni(coord,name,p); - break; - default: - if ( items == 2 ) - Perl_croak(aTHX_ "usage: glTexGen(coord,name,...)"); - pv = (GLdouble*)safemalloc(sizeof(GLdouble)*(items-2)); - for ( i = 0; i < items - 2; i++ ) { - pv[i] = SvNV(ST(i+2)); - } - glTexGendv(coord,name,pv); - safefree(pv); - break; - } - -#ifdef GL_VERSION_1_3 - -void -glActiveTextureARB ( texUnit ) - GLenum texUnit - CODE: - glActiveTextureARB(texUnit); - -void -glMultiTexCoord ( texUnit, ... ) - Uint32 texUnit - CODE: - double s,t,r,q; - if ( items < 2 || items > 5 ) - Perl_croak (aTHX_ "usage: SDL::OpenGL::MultiTexCoord(tex,s,[t,[r,[q]]])"); - s = t = r = 0.0; - q = 1.0; - switch(items) { - case 5: - q = SvNV(ST(3)); - case 4: - r = SvNV(ST(2)); - case 3: - t = SvNV(ST(1)); - case 2: - s = SvNV(ST(0)); - } - glMultiTexCoord4dARB(texUnit,s,t,r,q); - -#endif // GL_VERSION_1_3 - -void -glDrawBuffer ( mode ) - GLenum mode - CODE: - glDrawBuffer(mode); - -void -glReadBuffer ( mode ) - GLenum mode - CODE: - glReadBuffer(mode); - -void -glIndexMask ( mask ) - Uint32 mask - CODE: - glIndexMask(mask); - -void -glColorMask ( red, green, blue, alpha ) - GLboolean red - GLboolean green - GLboolean blue - GLboolean alpha - CODE: - glColorMask(red,green,blue,alpha); - -void -glDepthMask ( flag ) - GLboolean flag - CODE: - glDepthMask(flag); - -void -glStencilMask ( mask ) - Uint32 mask - CODE: - glStencilMask(mask); - -void -glScissor ( x , y, width, height ) - Sint32 x - Sint32 y - Uint32 width - Uint32 height - CODE: - glScissor(x,y,width,height); - -void -glAlphaFunc ( func, ref ) - GLenum func - double ref - CODE: - glAlphaFunc(func,ref); - -void -glStencilFunc ( func, ref, mask ) - GLenum func - Sint32 ref - Uint32 mask - CODE: - glStencilFunc(func,ref,mask); - -void -glStencilOp ( fail, zfail, zpass ) - GLenum fail - GLenum zfail - GLenum zpass - CODE: - glStencilOp(fail,zfail,zpass); - -void -glDepthFunc ( func ) - GLenum func - CODE: - glDepthFunc(func); - -void -glLogicOp ( opcode ) - GLenum opcode - CODE: - glLogicOp(opcode); - -void -glAccum ( op, value ) - GLenum op - double value - CODE: - glAccum(op,value); - -void -glMap1 ( target, u1, u2, stride, order, points ) - GLenum target - double u1 - double u2 - Sint32 stride - Sint32 order - char *points - CODE: - glMap1d(target,u1,u2,stride,order,(double*)points); - -void -glEvalCoord1 ( u ) - double u - CODE: - glEvalCoord1d(u); - -void -glMapGrid1 ( n, u1, u2 ) - Sint32 n - double u1 - double u2 - CODE: - glMapGrid1d(n,u1,u2); - -void -glEvalMesh1 ( mode, p1, p2 ) - GLenum mode - Sint32 p1 - Sint32 p2 - CODE: - glEvalMesh1(mode,p1,p2); - -void -glMap2 ( target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points ) - GLenum target - double u1 - double u2 - Sint32 ustride - Sint32 uorder - double v1 - double v2 - Sint32 vstride - Sint32 vorder - char *points - CODE: - glMap2d(target,u1,u2,ustride,uorder,v1,v2,vstride,vorder,(double*)points); - -void -glEvalCoord2 ( u, v ) - double u - double v - CODE: - glEvalCoord2d(u,v); - -void -glMapGrid2 ( nu, u1, u2, nv, v1, v2 ) - Sint32 nu - double u1 - double u2 - Sint32 nv - double v1 - double v2 - CODE: - glMapGrid2d(nu,u1,u2,nv,v1,v2); - -void -glEvalMesh2 ( mode, i1, i2, j1, j2 ) - GLenum mode - Sint32 i1 - Sint32 i2 - Sint32 j1 - Sint32 j2 - CODE: - glEvalMesh2(mode,i1,i2,j1,j2); - -GLenum -glGetError ( ) - CODE: - RETVAL = glGetError(); - OUTPUT: - RETVAL - -GLint -glRenderMode ( mode ) - GLenum mode - CODE: - RETVAL = glRenderMode( mode ); - OUTPUT: - RETVAL - -void -glInitNames ( ) - CODE: - glInitNames(); - -void -glPushName ( name ) - GLuint name - CODE: - glPushName(name); - -void -glPopName ( ) - CODE: - glPopName(); - -void -glLoadName ( name ) - GLuint name - CODE: - glLoadName(name); - -void -glFeedbackBuffer ( size, type, buffer ) - GLuint size - GLenum type - float* buffer - CODE: - glFeedbackBuffer(size,type,buffer); - -void -glPassThrough ( token ) - GLfloat token - CODE: - glPassThrough(token); - - -#endif - -#ifdef HAVE_GLU - -void -gluLookAt ( eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz ) - double eyex - double eyey - double eyez - double centerx - double centery - double centerz - double upx - double upy - double upz - CODE: - gluLookAt(eyex,eyey,eyez,centerx,centery,centerz,upx,upy,upz); - -void -gluPerspective ( fovy, aspect, n, f ) - double fovy - double aspect - double n - double f - CODE: - gluPerspective(fovy,aspect,n,f); - -void -gluPickMatrix ( x, y, delx, dely, viewport ) - double x - double y - double delx - double dely - GLint* viewport - CODE: - gluPickMatrix(x,y,delx,dely,viewport); - -void -gluOrtho2D ( left, right, bottom, top ) - double left - double right - double bottom - double top - CODE: - gluOrtho2D(left,right,bottom,top); - -int -gluScaleImage ( format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout ) - GLenum format - Uint32 widthin - Uint32 heightin - GLenum typein - char *datain - Uint32 widthout - Uint32 heightout - GLenum typeout - char *dataout - CODE: - RETVAL = gluScaleImage(format,widthin,heightin,typein,datain, - widthout,heightout,typeout,dataout); - OUTPUT: - RETVAL - -int -gluBuild1DMipmaps ( target, internalFormat, width, format, type, data ) - GLenum target - Sint32 internalFormat - Uint32 width - GLenum format - GLenum type - char *data - CODE: - RETVAL = gluBuild1DMipmaps(target,internalFormat,width,format,type,data); - OUTPUT: - RETVAL - -int -gluBuild2DMipmaps ( target, internalFormat, width, height, format, type, data ) - GLenum target - Sint32 internalFormat - Uint32 width - Uint32 height - GLenum format - GLenum type - char *data - CODE: - RETVAL = gluBuild2DMipmaps(target,internalFormat,width,height,format,type,data); - OUTPUT: - RETVAL - - -#if HAVE_GLU_VERSION >= 12 -int -gluBuild3DMipmaps ( target, internalFormat, width, height, depth, format, type, data ) - GLenum target - Sint32 internalFormat - Uint32 width - Uint32 height - Uint32 depth - GLenum format - GLenum type - char *data - CODE: - RETVAL = gluBuild3DMipmaps(target,internalFormat,width,height,depth, - format,type,data); - OUTPUT: - RETVAL - -#else -void -gluBuild3DMipmaps ( ) - CODE: - Perl_croak (aTHX_ "SDL::OpenGL::Build3DMipmaps requires GLU 1.2"); - -#endif - -#if HAVE_GLU_VERSION >= 12 -int -gluBuild1DMipmapLevels ( target, internalFormat, width, format, type, level, base, max, data ) - GLenum target - Sint32 internalFormat - Uint32 width - GLenum format - GLenum type - Sint32 level - Sint32 base - Sint32 max - char *data - CODE: - RETVAL = gluBuild1DMipmapLevels(target,internalFormat,width, - format,type,level,base,max,data); - OUTPUT: - RETVAL - -#else -void -gluBuild1DMipmapLevels () - CODE: - Perl_croak(aTHX_ "SDL::OpenGL::Build1DMipmapLevels requires GLU 1.2"); - -#endif - -#if HAVE_GLU_VERSION >= 12 -int -gluBuild2DMipmapLevels ( target, internalFormat, width, height, format, type, level, base, max, data ) - GLenum target - Sint32 internalFormat - Uint32 width - Uint32 height - GLenum format - GLenum type - Sint32 level - Sint32 base - Sint32 max - char *data - CODE: - RETVAL = gluBuild2DMipmapLevels(target,internalFormat,width,height, - format,type,level,base,max,data); - OUTPUT: - RETVAL - -#else -void -gluBuild2DMipmapLevels () - CODE: - Perl_croak(aTHX_ "SDL::OpenGL::Build2DMipmapLevels requires GLU 1.2"); - -#endif - -#if HAVE_GLU_VERSION >= 12 -int -gluBuild3DMipmapLevels ( target, internalFormat, width, height, depth, format, type, level, base, max, data ) - GLenum target - Sint32 internalFormat - Uint32 width - Uint32 height - Uint32 depth - GLenum format - GLenum type - Sint32 level - Sint32 base - Sint32 max - char *data - CODE: - RETVAL = gluBuild3DMipmapLevels(target,internalFormat,width,height,depth, - format,type,level,base,max,data); - OUTPUT: - RETVAL - -#else -void -gluBuild3DMipmapLevels () - CODE: - Perl_croak(aTHX_ "SDL::OpenGL::Build3DMipmapLevels requires GLU 1.2"); - -#endif - -char* -gluErrorString ( code ) - GLenum code - CODE: - RETVAL = (char*)gluErrorString(code); - OUTPUT: - RETVAL - -GLUnurbsObj* -gluNewNurbsRenderer () - CODE: - RETVAL = gluNewNurbsRenderer(); - OUTPUT: - RETVAL - -void -gluDeleteNurbsRenderer ( obj ) - GLUnurbsObj *obj - CODE: - gluDeleteNurbsRenderer(obj); - -void -gluNurbsProperty ( obj, property, value ) - GLUnurbsObj *obj - GLenum property - double value - CODE: - gluNurbsProperty(obj,property,(float)value); - -void -gluLoadSamplingMatrices ( obj, mm, pm, vp ) - GLUnurbsObj *obj - char *mm - char *pm - char *vp - CODE: - gluLoadSamplingMatrices(obj,(GLfloat*)mm,(GLfloat*)pm,(GLint*)vp); - -double -gluGetNurbsProperty ( obj, property ) - GLUnurbsObj *obj - GLenum property - CODE: - float f; - gluGetNurbsProperty(obj,property,&f); - RETVAL = (double)f; - OUTPUT: - RETVAL - -void -gluNurbsCallback ( obj, which, cb ) - GLUnurbsObj *obj - GLenum which - SV *cb - CODE: - switch(which) { - case GLU_ERROR: - sdl_perl_nurbs_error_hook = cb; - gluNurbsCallback(obj,GLU_ERROR,(GLvoid*)sdl_perl_nurbs_error_callback); - break; -#ifdef GLU_NURBS_BEGIN - case GLU_NURBS_BEGIN: - case GLU_NURBS_BEGIN_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_BEGIN_DATA, - (GLvoid*)sdl_perl_nurbs_being_callback); - break; - case GLU_NURBS_TEXTURE_COORD: - case GLU_NURBS_TEXTURE_COORD_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_TEXTURE_COORD_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_COLOR: - case GLU_NURBS_COLOR_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_COLOR_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_NORMAL: - case GLU_NURBS_NORMAL_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_NORMAL_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_VERTEX: - case GLU_NURBS_VERTEX_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_VERTEX_DATA, - (GLvoid*)sdl_perl_nurbs_multi_callback); - break; - case GLU_NURBS_END: - case GLU_NURBS_END_DATA: - gluNurbsCallbackData(obj,(void*)cb); - gluNurbsCallback(obj,GLU_NURBS_END_DATA, - (GLvoid*)sdl_perl_nurbs_end_callback); - break; -#endif - default: - Perl_croak(aTHX_ "SDL::OpenGL::NurbsCallback - invalid type"); - } - -void -gluNurbsCallbackData ( obj, cb ) - GLUnurbsObj *obj - SV *cb - CODE: - gluNurbsCallbackData(obj,(void*)cb); - -void -gluBeginSurface ( obj ) - GLUnurbsObj *obj - CODE: - gluBeginSurface(obj); - -void -gluEndSurface ( obj ) - GLUnurbsObj *obj - CODE: - gluEndSurface(obj); - -void -gluNurbsSurface ( obj, uknot_count, uknot, vknot_count, vknot, u_stride, v_stride, ctlarray, uorder, vorder, type ) - GLUnurbsObj *obj - Sint32 uknot_count - char *uknot - Sint32 vknot_count - char *vknot - Sint32 u_stride - Sint32 v_stride - char *ctlarray - Sint32 uorder - Sint32 vorder - GLenum type - CODE: - gluNurbsSurface(obj,uknot_count,(GLfloat*)uknot,vknot_count,(GLfloat*)vknot, - u_stride,v_stride,(GLfloat*)ctlarray,uorder,vorder,type); - -void -gluBeginCurve ( obj ) - GLUnurbsObj *obj - CODE: - gluBeginCurve(obj); - -void -gluEndCurve ( obj ) - GLUnurbsObj *obj - CODE: - gluEndCurve(obj); - -void -gluNurbsCurve ( obj, uknot_count, uknot, u_stride, ctlarray, uorder, type ) - GLUnurbsObj *obj - Sint32 uknot_count - char *uknot - Sint32 u_stride - char *ctlarray - Sint32 uorder - GLenum type - CODE: - gluNurbsCurve(obj,uknot_count,(GLfloat*)uknot,u_stride,(GLfloat*)ctlarray, - uorder,type); - -void -gluBeginTrim ( obj ) - GLUnurbsObj *obj - CODE: - gluBeginTrim(obj); - -void -gluEndTrim ( obj ) - GLUnurbsObj *obj - CODE: - gluEndTrim(obj); - -void -gluPwlCurve ( obj, count, array, stride, type ) - GLUnurbsObj *obj - Sint32 count - char *array - Sint32 stride - GLenum type - CODE: - gluPwlCurve(obj,count,(GLfloat*)array,stride,type); - -AV* -gluUnProject ( winx, winy, winz, mm, pm, vp ) - double winx - double winy - double winz - char *mm - char *pm - char *vp - CODE: - GLdouble objx, objy, objz; - RETVAL = newAV(); - av_push(RETVAL,newSViv(gluUnProject(winx,winy,winz,(GLdouble*)mm, - (GLdouble*)pm,(GLint*)vp,&objx,&objy,&objz))); - av_push(RETVAL,newSVnv((double)objx)); - av_push(RETVAL,newSVnv((double)objy)); - av_push(RETVAL,newSVnv((double)objz)); - OUTPUT: - RETVAL - - -#ifdef GL_VERSION_1_3 - -AV* -gluUnProject4 ( winx, winy, winz, clipw, mm, pm, vp, n, f ) - double winx - double winy - double winz - double clipw - char *mm - char *pm - char *vp - double n - double f - CODE: - GLdouble objx, objy, objz, objw; - RETVAL = newAV(); - av_push(RETVAL,newSViv(gluUnProject4(winx,winy,winz,clipw,(GLdouble*)mm, - (GLdouble*)pm,(GLint*)vp,(GLclampd)n,(GLclampd)f, - &objx,&objy,&objz,&objw))); - av_push(RETVAL,newSVnv((double)objx)); - av_push(RETVAL,newSVnv((double)objy)); - av_push(RETVAL,newSVnv((double)objz)); - av_push(RETVAL,newSVnv((double)objw)); - OUTPUT: - RETVAL - -#endif // GL_VERSION_1_3 - -AV* -gluProject ( objx, objy, objz, mm, pm, vp ) - double objx - double objy - double objz - char *mm - char *pm - char *vp - CODE: - GLdouble winx, winy, winz; - RETVAL = newAV(); - av_push(RETVAL,newSViv(gluUnProject(objx,objy,objz,(GLdouble*)mm, - (GLdouble*)pm,(GLint*)vp,&winx,&winy,&winz))); - av_push(RETVAL,newSVnv((double)winx)); - av_push(RETVAL,newSVnv((double)winy)); - av_push(RETVAL,newSVnv((double)winz)); - OUTPUT: - RETVAL - -#ifdef GL_VERSION_1_2 - -GLUtesselator* -gluNewTess () - CODE: - RETVAL = gluNewTess(); - OUTPUT: - RETVAL - -void -gluTessCallback ( tess, type ) - GLUtesselator *tess - GLenum type - CODE: - switch(type) { - case GLU_TESS_BEGIN: - case GLU_TESS_BEGIN_DATA: - gluTessCallback(tess,GLU_TESS_BEGIN_DATA, - (GLvoid*)sdl_perl_tess_begin_callback); - break; - - case GLU_TESS_EDGE_FLAG: - case GLU_TESS_EDGE_FLAG_DATA: - gluTessCallback(tess,GLU_TESS_EDGE_FLAG_DATA, - (GLvoid*)sdl_perl_tess_edge_flag_callback); - break; - - case GLU_TESS_VERTEX: - case GLU_TESS_VERTEX_DATA: - gluTessCallback(tess,GLU_TESS_VERTEX_DATA, - (GLvoid*)sdl_perl_tess_vertex_callback); - break; - - case GLU_TESS_END: - case GLU_TESS_END_DATA: - gluTessCallback(tess,GLU_TESS_END_DATA, - (GLvoid*)sdl_perl_tess_end_callback); - break; - - case GLU_TESS_COMBINE: - case GLU_TESS_COMBINE_DATA: - gluTessCallback(tess,GLU_TESS_COMBINE_DATA, - (GLvoid*)sdl_perl_tess_combine_callback); - break; - - case GLU_TESS_ERROR: - case GLU_TESS_ERROR_DATA: - gluTessCallback(tess,GLU_TESS_ERROR_DATA, - (GLvoid*)sdl_perl_tess_error_callback); - break; - } - -void -gluTessProperty ( tessobj, property, value ) - GLUtesselator *tessobj - Uint32 property - double value - CODE: - gluTessProperty(tessobj,property,value); - -double -gluGetTessProperty ( tessobj, property ) - GLUtesselator *tessobj - Uint32 property - CODE: - gluGetTessProperty(tessobj,property,&RETVAL); - OUTPUT: - RETVAL - -void -gluTessNormal ( tessobj, x, y, z ) - GLUtesselator *tessobj - double x - double y - double z - CODE: - gluTessNormal(tessobj,x,y,z); - -void -gluTessBeginPolygon ( tessobj, cb ) - GLUtesselator *tessobj - SV *cb - CODE: - gluTessBeginPolygon(tessobj,cb); - -void -gluTessEndPolygon ( tessobj ) - GLUtesselator *tessobj - CODE: - gluTessEndPolygon(tessobj); - -void -gluTessBeginContour ( tessobj ) - GLUtesselator *tessobj - CODE: - gluTessBeginContour(tessobj); - -void -gluTessEndContour ( tessobj ) - GLUtesselator *tessobj - CODE: - gluTessEndContour(tessobj); - -void -gluDeleteTess ( tessobj ) - GLUtesselator *tessobj - CODE: - gluDeleteTess(tessobj); - -void -gluTessVertex ( tessobj, coords, vd ) - GLUtesselator *tessobj - char *coords - char *vd - CODE: - gluTessVertex(tessobj,(GLdouble*)coords,vd); - -#endif - -#endif - diff --git a/src/SDL/SFont.bs b/src/SDL/SFont.bs deleted file mode 100644 index e69de29..0000000 diff --git a/src/SDL/SFont.c b/src/SDL/SFont.c deleted file mode 100644 index 8e65891..0000000 --- a/src/SDL/SFont.c +++ /dev/null @@ -1,382 +0,0 @@ -/* - * This file was generated automatically by xsubpp version 1.9508 from the - * contents of SFont.xs. Do not edit this file, edit SFont.xs instead. - * - * ANY CHANGES MADE HERE WILL BE LOST! - * - */ - -#line 1 "SFont.xs" -// -// SFont.xs -// -// 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 "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#ifndef aTHX_ -#define aTHX_ -#endif - -#include -#include -#include - -#ifdef USE_THREADS -#define HAVE_TLS_CONTEXT -#endif - -#include "../defines.h" -#include "../SFont.h" - -#ifdef HAVE_SDL_IMAGE -#include - -SFont_FontInfo InternalFont; -Uint32 SFont_GetPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y) -{ - - Uint8 *bits; - Uint32 Bpp; - if (X<0) puts("SFONT ERROR: x too small in SFont_GetPixel. Report this to "); - if (X>=Surface->w) puts("SFONT ERROR: x too big in SFont_GetPixel. Report this to "); - - Bpp = Surface->format->BytesPerPixel; - - bits = ((Uint8 *)Surface->pixels)+Y*Surface->pitch+X*Bpp; - - // Get the pixel - switch(Bpp) { - case 1: - return *((Uint8 *)Surface->pixels + Y * Surface->pitch + X); - break; - case 2: - return *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X); - break; - case 3: { // Format/endian independent - Uint8 r, g, b; - r = *((bits)+Surface->format->Rshift/8); - g = *((bits)+Surface->format->Gshift/8); - b = *((bits)+Surface->format->Bshift/8); - return SDL_MapRGB(Surface->format, r, g, b); - } - break; - case 4: - return *((Uint32 *)Surface->pixels + Y * Surface->pitch/4 + X); - break; - } - - return -1; -} - -void SFont_InitFont2(SFont_FontInfo *Font) -{ - int x = 0, i = 0; - - if ( Font->Surface==NULL ) { - printf("The font has not been loaded!\n"); - exit(1); - } - - if (SDL_MUSTLOCK(Font->Surface)) SDL_LockSurface(Font->Surface); - - while ( x < Font->Surface->w ) { - if(SFont_GetPixel(Font->Surface,x,0)==SDL_MapRGB(Font->Surface->format,255,0,255)) { - Font->CharPos[i++]=x; - while (( x < Font->Surface->w-1) && (SFont_GetPixel(Font->Surface,x,0)==SDL_MapRGB(Font->Surface->format,255,0,255))) - x++; - Font->CharPos[i++]=x; - } - x++; - } - if (SDL_MUSTLOCK(Font->Surface)) SDL_UnlockSurface(Font->Surface); - - Font->h=Font->Surface->h; - SDL_SetColorKey(Font->Surface, SDL_SRCCOLORKEY, SFont_GetPixel(Font->Surface, 0, Font->Surface->h-1)); -} - -void SFont_InitFont(SDL_Surface *Font) -{ - InternalFont.Surface=Font; - SFont_InitFont2(&InternalFont); -} - -void SFont_PutString2(SDL_Surface *Surface, SFont_FontInfo *Font, int x, int y, char *text) -{ - int ofs; - int i=0; - SDL_Rect srcrect,dstrect; - - while (text[i]!='\0') { - if (text[i]==' ') { - x+=Font->CharPos[2]-Font->CharPos[1]; - i++; - } - else { -// printf("-%c- %c - %u\n",228,text[i],text[i]); - ofs=(text[i]-33)*2+1; -// printf("printing %c %d\n",text[i],ofs); - srcrect.w = dstrect.w = (Font->CharPos[ofs+2]+Font->CharPos[ofs+1])/2-(Font->CharPos[ofs]+Font->CharPos[ofs-1])/2; - srcrect.h = dstrect.h = Font->Surface->h-1; - srcrect.x = (Font->CharPos[ofs]+Font->CharPos[ofs-1])/2; - srcrect.y = 1; - dstrect.x = x-(float)(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2; - dstrect.y = y; - - SDL_BlitSurface( Font->Surface, &srcrect, Surface, &dstrect); - - x+=Font->CharPos[ofs+1]-Font->CharPos[ofs]; - i++; - } - } -} - -void SFont_PutString(SDL_Surface *Surface, int x, int y, char *text) -{ - SFont_PutString2(Surface, &InternalFont, x, y, text); -} - -int SFont_TextWidth2(SFont_FontInfo *Font, char *text) -{ - int ofs=0; - int i=0,x=0; - - while (text[i]!='\0') { - if (text[i]==' ') { - x+=Font->CharPos[2]-Font->CharPos[1]; - i++; - } - else { - ofs=(text[i]-33)*2+1; - x+=Font->CharPos[ofs+1]-Font->CharPos[ofs]; - i++; - } - } -// printf ("--%d\n",x); - return x; -} - -int SFont_TextWidth(char *text) -{ - return SFont_TextWidth2(&InternalFont, text); -} - -void SFont_XCenteredString2(SDL_Surface *Surface, SFont_FontInfo *Font, int y, char *text) -{ - SFont_PutString2(Surface, Font, Surface->w/2-SFont_TextWidth2(Font,text)/2, y, text); -} - -void SFont_XCenteredString(SDL_Surface *Surface, int y, char *text) -{ - SFont_XCenteredString2(Surface, &InternalFont, y, text); -} - -void SFont_InternalInput( SDL_Surface *Dest, SFont_FontInfo *Font, int x, int y, int PixelWidth, char *text) -{ - SDL_Event event; - int ch=-1,blink=0; - long blinktimer=0; - SDL_Surface *Back; - SDL_Rect rect; - int previous; -// int ofs=(text[0]-33)*2+1; -// int leftshift=(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2; - - Back = SDL_AllocSurface(Dest->flags, - Dest->w, - Font->h, - Dest->format->BitsPerPixel, - Dest->format->Rmask, - Dest->format->Gmask, - Dest->format->Bmask, 0); - rect.x=0; - rect.y=y; - rect.w=Dest->w; - rect.h=Font->Surface->h; - SDL_BlitSurface(Dest, &rect, Back, NULL); - SFont_PutString2(Dest,Font,x,y,text); - SDL_UpdateRects(Dest, 1, &rect); - - // start input - previous=SDL_EnableUNICODE(1); - blinktimer=SDL_GetTicks(); - while (ch!=SDLK_RETURN) { - if (event.type==SDL_KEYDOWN) { - ch=event.key.keysym.unicode; - if (((ch>31)||(ch=='\b')) && (ch<128)) { - if ((ch=='\b')&&(strlen(text)>0)) - text[strlen(text)-1]='\0'; - else if (ch!='\b') - sprintf(text,"%s%c",text,ch); - if (SFont_TextWidth2(Font,text)>PixelWidth) text[strlen(text)-1]='\0'; - SDL_BlitSurface( Back, NULL, Dest, &rect); - SFont_PutString2(Dest, Font, x, y, text); - SDL_UpdateRects(Dest, 1, &rect); -// printf("%s ## %d\n",text,strlen(text)); - SDL_WaitEvent(&event); - } - } - if (SDL_GetTicks()>blinktimer) { - blink=1-blink; - blinktimer=SDL_GetTicks()+500; - if (blink) { - SFont_PutString2(Dest, Font, x+SFont_TextWidth2(Font,text), y, "|"); - SDL_UpdateRects(Dest, 1, &rect); -// SDL_UpdateRect(Dest, x+SFont_TextWidth2(Font,text), y, SFont_TextWidth2(Font,"|"), Font->Surface->h); - } else { - SDL_BlitSurface( Back, NULL, Dest, &rect); - SFont_PutString2(Dest, Font, x, y, text); - SDL_UpdateRects(Dest, 1, &rect); -// SDL_UpdateRect(Dest, x-(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2, y, PixelWidth, Font->Surface->h); - } - } - SDL_Delay(1); - SDL_PollEvent(&event); - } - text[strlen(text)]='\0'; - SDL_FreeSurface(Back); - SDL_EnableUNICODE(previous); //restore the previous state -} - -void SFont_Input2( SDL_Surface *Dest, SFont_FontInfo *Font, int x, int y, int PixelWidth, char *text) -{ - SFont_InternalInput( Dest, Font, x, y, PixelWidth, text); -} -void SFont_Input( SDL_Surface *Dest, int x, int y, int PixelWidth, char *text) -{ - SFont_Input2( Dest, &InternalFont, x, y, PixelWidth, text); -} - -#endif - -#line 280 "SFont.c" -#ifdef HAVE_SDL_IMAGE -#define XSubPPtmpAAAA 1 - -XS(XS_SDL__SFont_NewFont); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__SFont_NewFont) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::SFont::NewFont(filename)"); - { - char * filename = (char *)SvPV_nolen(ST(0)); - SDL_Surface * RETVAL; - dXSTARG; -#line 279 "SFont.xs" - RETVAL = IMG_Load(filename); - SFont_InitFont(RETVAL); -#line 297 "SFont.c" - XSprePUSH; PUSHi(PTR2IV(RETVAL)); - } - XSRETURN(1); -} - -XS(XS_SDL__SFont_UseFont); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__SFont_UseFont) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::SFont::UseFont(surface)"); - { - SDL_Surface * surface = INT2PTR(SDL_Surface *,SvIV(ST(0))); -#line 288 "SFont.xs" - SFont_InitFont(surface); -#line 313 "SFont.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__SFont_PutString); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__SFont_PutString) -{ - dXSARGS; - if (items != 4) - Perl_croak(aTHX_ "Usage: SDL::SFont::PutString(surface, x, y, text)"); - { - SDL_Surface * surface = INT2PTR(SDL_Surface *,SvIV(ST(0))); - int x = (int)SvIV(ST(1)); - int y = (int)SvIV(ST(2)); - char * text = (char *)SvPV_nolen(ST(3)); -#line 297 "SFont.xs" - SFont_PutString( surface, x, y, text ); -#line 331 "SFont.c" - } - XSRETURN_EMPTY; -} - -XS(XS_SDL__SFont_TextWidth); /* prototype to pass -Wmissing-prototypes */ -XS(XS_SDL__SFont_TextWidth) -{ - dXSARGS; - if (items != 1) - Perl_croak(aTHX_ "Usage: SDL::SFont::TextWidth(text)"); - { - char * text = (char *)SvPV_nolen(ST(0)); - int RETVAL; - dXSTARG; -#line 303 "SFont.xs" - RETVAL = SFont_TextWidth(text); -#line 348 "SFont.c" - XSprePUSH; PUSHi((IV)RETVAL); - } - XSRETURN(1); -} - -#endif -#ifdef __cplusplus -extern "C" -#endif -XS(boot_SDL__SFont); /* prototype to pass -Wmissing-prototypes */ -XS(boot_SDL__SFont) -{ - dXSARGS; - char* file = __FILE__; - - XS_VERSION_BOOTCHECK ; - -#if XSubPPtmpAAAA - newXS("SDL::SFont::NewFont", XS_SDL__SFont_NewFont, file); - newXS("SDL::SFont::UseFont", XS_SDL__SFont_UseFont, file); - newXS("SDL::SFont::PutString", XS_SDL__SFont_PutString, file); - newXS("SDL::SFont::TextWidth", XS_SDL__SFont_TextWidth, file); -#endif - - /* Initialisation Section */ - -#if XSubPPtmpAAAA -#endif -#line 377 "SFont.c" - - /* End of Initialisation Section */ - - XSRETURN_YES; -} - diff --git a/src/SDL/SFont.o b/src/SDL/SFont.o deleted file mode 100644 index 318869e..0000000 Binary files a/src/SDL/SFont.o and /dev/null differ diff --git a/src/SDL/SFont.xs b/src/SDL/SFont.xs deleted file mode 100644 index 2bd9899..0000000 --- a/src/SDL/SFont.xs +++ /dev/null @@ -1,308 +0,0 @@ -// -// SFont.xs -// -// 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 "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#ifndef aTHX_ -#define aTHX_ -#endif - -#include -#include -#include - -#ifdef USE_THREADS -#define HAVE_TLS_CONTEXT -#endif - -#include "../defines.h" -#include "../SFont.h" - -#ifdef HAVE_SDL_IMAGE -#include - -SFont_FontInfo InternalFont; -Uint32 SFont_GetPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y) -{ - - Uint8 *bits; - Uint32 Bpp; - if (X<0) puts("SFONT ERROR: x too small in SFont_GetPixel. Report this to "); - if (X>=Surface->w) puts("SFONT ERROR: x too big in SFont_GetPixel. Report this to "); - - Bpp = Surface->format->BytesPerPixel; - - bits = ((Uint8 *)Surface->pixels)+Y*Surface->pitch+X*Bpp; - - // Get the pixel - switch(Bpp) { - case 1: - return *((Uint8 *)Surface->pixels + Y * Surface->pitch + X); - break; - case 2: - return *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X); - break; - case 3: { // Format/endian independent - Uint8 r, g, b; - r = *((bits)+Surface->format->Rshift/8); - g = *((bits)+Surface->format->Gshift/8); - b = *((bits)+Surface->format->Bshift/8); - return SDL_MapRGB(Surface->format, r, g, b); - } - break; - case 4: - return *((Uint32 *)Surface->pixels + Y * Surface->pitch/4 + X); - break; - } - - return -1; -} - -void SFont_InitFont2(SFont_FontInfo *Font) -{ - int x = 0, i = 0; - - if ( Font->Surface==NULL ) { - printf("The font has not been loaded!\n"); - exit(1); - } - - if (SDL_MUSTLOCK(Font->Surface)) SDL_LockSurface(Font->Surface); - - while ( x < Font->Surface->w ) { - if(SFont_GetPixel(Font->Surface,x,0)==SDL_MapRGB(Font->Surface->format,255,0,255)) { - Font->CharPos[i++]=x; - while (( x < Font->Surface->w-1) && (SFont_GetPixel(Font->Surface,x,0)==SDL_MapRGB(Font->Surface->format,255,0,255))) - x++; - Font->CharPos[i++]=x; - } - x++; - } - if (SDL_MUSTLOCK(Font->Surface)) SDL_UnlockSurface(Font->Surface); - - Font->h=Font->Surface->h; - SDL_SetColorKey(Font->Surface, SDL_SRCCOLORKEY, SFont_GetPixel(Font->Surface, 0, Font->Surface->h-1)); -} - -void SFont_InitFont(SDL_Surface *Font) -{ - InternalFont.Surface=Font; - SFont_InitFont2(&InternalFont); -} - -void SFont_PutString2(SDL_Surface *Surface, SFont_FontInfo *Font, int x, int y, char *text) -{ - int ofs; - int i=0; - SDL_Rect srcrect,dstrect; - - while (text[i]!='\0') { - if (text[i]==' ') { - x+=Font->CharPos[2]-Font->CharPos[1]; - i++; - } - else { -// printf("-%c- %c - %u\n",228,text[i],text[i]); - ofs=(text[i]-33)*2+1; -// printf("printing %c %d\n",text[i],ofs); - srcrect.w = dstrect.w = (Font->CharPos[ofs+2]+Font->CharPos[ofs+1])/2-(Font->CharPos[ofs]+Font->CharPos[ofs-1])/2; - srcrect.h = dstrect.h = Font->Surface->h-1; - srcrect.x = (Font->CharPos[ofs]+Font->CharPos[ofs-1])/2; - srcrect.y = 1; - dstrect.x = x-(float)(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2; - dstrect.y = y; - - SDL_BlitSurface( Font->Surface, &srcrect, Surface, &dstrect); - - x+=Font->CharPos[ofs+1]-Font->CharPos[ofs]; - i++; - } - } -} - -void SFont_PutString(SDL_Surface *Surface, int x, int y, char *text) -{ - SFont_PutString2(Surface, &InternalFont, x, y, text); -} - -int SFont_TextWidth2(SFont_FontInfo *Font, char *text) -{ - int ofs=0; - int i=0,x=0; - - while (text[i]!='\0') { - if (text[i]==' ') { - x+=Font->CharPos[2]-Font->CharPos[1]; - i++; - } - else { - ofs=(text[i]-33)*2+1; - x+=Font->CharPos[ofs+1]-Font->CharPos[ofs]; - i++; - } - } -// printf ("--%d\n",x); - return x; -} - -int SFont_TextWidth(char *text) -{ - return SFont_TextWidth2(&InternalFont, text); -} - -void SFont_XCenteredString2(SDL_Surface *Surface, SFont_FontInfo *Font, int y, char *text) -{ - SFont_PutString2(Surface, Font, Surface->w/2-SFont_TextWidth2(Font,text)/2, y, text); -} - -void SFont_XCenteredString(SDL_Surface *Surface, int y, char *text) -{ - SFont_XCenteredString2(Surface, &InternalFont, y, text); -} - -void SFont_InternalInput( SDL_Surface *Dest, SFont_FontInfo *Font, int x, int y, int PixelWidth, char *text) -{ - SDL_Event event; - int ch=-1,blink=0; - long blinktimer=0; - SDL_Surface *Back; - SDL_Rect rect; - int previous; -// int ofs=(text[0]-33)*2+1; -// int leftshift=(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2; - - Back = SDL_AllocSurface(Dest->flags, - Dest->w, - Font->h, - Dest->format->BitsPerPixel, - Dest->format->Rmask, - Dest->format->Gmask, - Dest->format->Bmask, 0); - rect.x=0; - rect.y=y; - rect.w=Dest->w; - rect.h=Font->Surface->h; - SDL_BlitSurface(Dest, &rect, Back, NULL); - SFont_PutString2(Dest,Font,x,y,text); - SDL_UpdateRects(Dest, 1, &rect); - - // start input - previous=SDL_EnableUNICODE(1); - blinktimer=SDL_GetTicks(); - while (ch!=SDLK_RETURN) { - if (event.type==SDL_KEYDOWN) { - ch=event.key.keysym.unicode; - if (((ch>31)||(ch=='\b')) && (ch<128)) { - if ((ch=='\b')&&(strlen(text)>0)) - text[strlen(text)-1]='\0'; - else if (ch!='\b') - sprintf(text,"%s%c",text,ch); - if (SFont_TextWidth2(Font,text)>PixelWidth) text[strlen(text)-1]='\0'; - SDL_BlitSurface( Back, NULL, Dest, &rect); - SFont_PutString2(Dest, Font, x, y, text); - SDL_UpdateRects(Dest, 1, &rect); -// printf("%s ## %d\n",text,strlen(text)); - SDL_WaitEvent(&event); - } - } - if (SDL_GetTicks()>blinktimer) { - blink=1-blink; - blinktimer=SDL_GetTicks()+500; - if (blink) { - SFont_PutString2(Dest, Font, x+SFont_TextWidth2(Font,text), y, "|"); - SDL_UpdateRects(Dest, 1, &rect); -// SDL_UpdateRect(Dest, x+SFont_TextWidth2(Font,text), y, SFont_TextWidth2(Font,"|"), Font->Surface->h); - } else { - SDL_BlitSurface( Back, NULL, Dest, &rect); - SFont_PutString2(Dest, Font, x, y, text); - SDL_UpdateRects(Dest, 1, &rect); -// SDL_UpdateRect(Dest, x-(Font->CharPos[ofs]-Font->CharPos[ofs-1])/2, y, PixelWidth, Font->Surface->h); - } - } - SDL_Delay(1); - SDL_PollEvent(&event); - } - text[strlen(text)]='\0'; - SDL_FreeSurface(Back); - SDL_EnableUNICODE(previous); //restore the previous state -} - -void SFont_Input2( SDL_Surface *Dest, SFont_FontInfo *Font, int x, int y, int PixelWidth, char *text) -{ - SFont_InternalInput( Dest, Font, x, y, PixelWidth, text); -} -void SFont_Input( SDL_Surface *Dest, int x, int y, int PixelWidth, char *text) -{ - SFont_Input2( Dest, &InternalFont, x, y, PixelWidth, text); -} - -#endif - -MODULE = SDL::SFont PACKAGE = SDL::SFont -PROTOTYPES : DISABLE - -#ifdef HAVE_SDL_IMAGE - -SDL_Surface * -NewFont ( filename ) - char *filename - CODE: - RETVAL = IMG_Load(filename); - SFont_InitFont(RETVAL); - OUTPUT: - RETVAL - -void -UseFont ( surface ) - SDL_Surface *surface - CODE: - SFont_InitFont(surface); - -void -PutString ( surface, x, y, text ) - SDL_Surface *surface - int x - int y - char *text - CODE: - SFont_PutString( surface, x, y, text ); - -int -TextWidth ( text ) - char *text - CODE: - RETVAL = SFont_TextWidth(text); - OUTPUT: - RETVAL - - -#endif diff --git a/src/SDL_perl.xs b/src/SDL_perl.xs deleted file mode 100644 index c327e5e..0000000 --- a/src/SDL_perl.xs +++ /dev/null @@ -1,4536 +0,0 @@ -// -// SDL.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" -#include "XSUB.h" - -#ifndef aTHX_ -#define aTHX_ -#endif - -#include - -#ifdef HAVE_GL -#include -#endif - -#ifdef HAVE_GLU -#include -#endif - -#ifdef HAVE_SDL_IMAGE -#include -#endif - -#ifdef HAVE_SDL_MIXER -#include -void (*mix_music_finished_cv)(); -#endif - -#ifdef HAVE_SDL_SOUND -#include -#endif - -#ifdef HAVE_SDL_NET -#include -#endif - -#ifdef HAVE_SDL_TTF -#include -#define TEXT_SOLID 1 -#define TEXT_SHADED 2 -#define TEXT_BLENDED 4 -#define UTF8_SOLID 8 -#define UTF8_SHADED 16 -#define UTF8_BLENDED 32 -#define UNICODE_SOLID 64 -#define UNICODE_SHADED 128 -#define UNICODE_BLENDED 256 -#endif - -#ifdef HAVE_SMPEG -#include -#ifdef HAVE_SDL_MIXER -static int sdl_perl_use_smpeg_audio = 0; -#endif -#endif - -#ifdef HAVE_SDL_GFX -#include -#include -#include -#include -#endif - -#ifdef HAVE_SDL_SVG -#include -#endif - -#ifdef USE_THREADS -#define HAVE_TLS_CONTEXT -#endif - -#include "defines.h" - -Uint32 -sdl_perl_timer_callback ( Uint32 interval, void* param ) -{ - Uint32 retval; - int back; - SV* cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)param; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(interval))); - PUTBACK; - - if (0 != (back = call_sv(cmd,G_SCALAR))) { - SPAGAIN; - if (back != 1 ) Perl_croak (aTHX_ "Timer Callback failed!"); - retval = POPi; - } else { - Perl_croak(aTHX_ "Timer Callback failed!"); - } - - FREETMPS; - LEAVE; - - LEAVE_TLS_CONTEXT - - return retval; -} - -void -sdl_perl_audio_callback ( void* data, Uint8 *stream, int len ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)data; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - XPUSHs(sv_2mortal(newSViv(PTR2IV(stream)))); - XPUSHs(sv_2mortal(newSViv(len))); - PUTBACK; - - call_sv(cmd,G_VOID|G_DISCARD); - - PUTBACK; - FREETMPS; - LEAVE; - - LEAVE_TLS_CONTEXT -} - -#ifdef HAVE_SDL_MIXER - -void -sdl_perl_music_callback ( void ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)Mix_GetMusicHookData(); - - ENTER; - SAVETMPS; - PUSHMARK(SP); - PUTBACK; - - call_sv(cmd,G_VOID|G_DISCARD); - - PUTBACK; - FREETMPS; - LEAVE; - - LEAVE_TLS_CONTEXT -} - -void -sdl_perl_music_finished_callback ( void ) -{ - SV *cmd; - ENTER_TLS_CONTEXT - dSP; - - cmd = (SV*)mix_music_finished_cv; - if ( cmd == NULL ) return; - - ENTER; - SAVETMPS; - PUSHMARK(SP); - PUTBACK; - - call_sv(cmd,G_VOID|G_DISCARD); - - PUTBACK; - FREETMPS; - LEAVE; - - LEAVE_TLS_CONTEXT -} - -#endif - -#define INIT_NS_APPLICATION -#define QUIT_NS_APPLICATION - - -void -sdl_perl_atexit (void) -{ - QUIT_NS_APPLICATION - SDL_Quit(); -} - -void boot_SDL(); -void boot_SDL__OpenGL(); - -XS(boot_SDL_perl) -{ - GET_TLS_CONTEXT - boot_SDL(); -} - -MODULE = SDL_perl PACKAGE = SDL -PROTOTYPES : DISABLE - -char * -GetError () - CODE: - RETVAL = SDL_GetError(); - OUTPUT: - RETVAL - -int -Init ( flags ) - Uint32 flags - CODE: - INIT_NS_APPLICATION - RETVAL = SDL_Init(flags); -#ifdef HAVE_TLS_CONTEXT - Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0); -#else - atexit(sdl_perl_atexit); -#endif - OUTPUT: - RETVAL - -int -InitSubSystem ( flags ) - Uint32 flags - CODE: - RETVAL = SDL_InitSubSystem(flags); - OUTPUT: - RETVAL - -void -QuitSubSystem ( flags ) - Uint32 flags - CODE: - SDL_QuitSubSystem(flags); - -void -Quit () - CODE: - QUIT_NS_APPLICATION - SDL_Quit(); - -int -WasInit ( flags ) - Uint32 flags - CODE: - RETVAL = SDL_WasInit(flags); - OUTPUT: - RETVAL - -void -Delay ( ms ) - int ms - CODE: - SDL_Delay(ms); - -Uint32 -GetTicks () - CODE: - RETVAL = SDL_GetTicks(); - OUTPUT: - RETVAL - -int -SetTimer ( interval, callback ) - Uint32 interval - SDL_TimerCallback callback - CODE: - RETVAL = SDL_SetTimer(interval,callback); - OUTPUT: - RETVAL - -SDL_TimerID -AddTimer ( interval, callback, param ) - Uint32 interval - SDL_NewTimerCallback callback - void *param - CODE: - RETVAL = SDL_AddTimer(interval,callback,param); - OUTPUT: - RETVAL - -SDL_NewTimerCallback -PerlTimerCallback () - CODE: - RETVAL = sdl_perl_timer_callback; - OUTPUT: - RETVAL - -SDL_TimerID -NewTimer ( interval, cmd ) - Uint32 interval - void *cmd - CODE: - RETVAL = SDL_AddTimer(interval,sdl_perl_timer_callback,cmd); - OUTPUT: - RETVAL - -Uint32 -RemoveTimer ( id ) - SDL_TimerID id - CODE: - RETVAL = SDL_RemoveTimer(id); - OUTPUT: - RETVAL - -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: - RETVAL = SDL_CDNumDrives(); - OUTPUT: - RETVAL - -char * -CDName ( drive ) - int drive - CODE: - RETVAL = strdup(SDL_CDName(drive)); - OUTPUT: - RETVAL - -SDL_CD * -CDOpen ( drive ) - int drive - CODE: - RETVAL = SDL_CDOpen(drive); - OUTPUT: - RETVAL - -Uint8 -CDTrackId ( track ) - SDL_CDtrack *track - CODE: - RETVAL = track->id; - OUTPUT: - RETVAL - -Uint8 -CDTrackType ( track ) - SDL_CDtrack *track - CODE: - RETVAL = track->type; - OUTPUT: - RETVAL - -Uint16 -CDTrackLength ( track ) - SDL_CDtrack *track - CODE: - RETVAL = track->length; - OUTPUT: - RETVAL - -Uint32 -CDTrackOffset ( track ) - SDL_CDtrack *track - CODE: - RETVAL = track->offset; - OUTPUT: - RETVAL - -Uint32 -CDStatus ( cd ) - SDL_CD *cd - CODE: - RETVAL = SDL_CDStatus(cd); - OUTPUT: - RETVAL - -int -CDPlayTracks ( cd, start_track, ntracks, start_frame, nframes ) - SDL_CD *cd - int start_track - int ntracks - int start_frame - int nframes - CODE: - RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes); - OUTPUT: - RETVAL - -int -CDPlay ( cd, start, length ) - SDL_CD *cd - int start - int length - CODE: - RETVAL = SDL_CDPlay(cd,start,length); - OUTPUT: - RETVAL - -int -CDPause ( cd ) - SDL_CD *cd - CODE: - RETVAL = SDL_CDPause(cd); - OUTPUT: - RETVAL - -int -CDResume ( cd ) - SDL_CD *cd - CODE: - RETVAL = SDL_CDResume(cd); - OUTPUT: - RETVAL - -int -CDStop ( cd ) - SDL_CD *cd - CODE: - RETVAL = SDL_CDStop(cd); - OUTPUT: - RETVAL - -int -CDEject ( cd ) - SDL_CD *cd - CODE: - RETVAL = SDL_CDEject(cd); - OUTPUT: - RETVAL - -void -CDClose ( cd ) - SDL_CD *cd - CODE: - SDL_CDClose(cd); - -int -CDId ( cd ) - SDL_CD *cd - CODE: - RETVAL = cd->id; - OUTPUT: - RETVAL - -int -CDNumTracks ( cd ) - SDL_CD *cd - CODE: - RETVAL = cd->numtracks; - OUTPUT: - RETVAL - -int -CDCurTrack ( cd ) - SDL_CD *cd - CODE: - RETVAL = cd->cur_track; - OUTPUT: - RETVAL - -int -CDCurFrame ( cd ) - SDL_CD *cd - CODE: - RETVAL = cd->cur_frame; - OUTPUT: - RETVAL - -SDL_CDtrack * -CDTrack ( cd, number ) - SDL_CD *cd - int number - CODE: - RETVAL = (SDL_CDtrack *)(cd->track + number); - OUTPUT: - RETVAL - -void -PumpEvents () - CODE: - SDL_PumpEvents(); - -int -PushEvent( e ) - SDL_Event *e - CODE: - RETVAL = SDL_PushEvent( e ); - OUTPUT: - RETVAL - -SDL_Event * -NewEvent () - CODE: - RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event)); - OUTPUT: - RETVAL - -void -FreeEvent ( e ) - SDL_Event *e - CODE: - safefree(e); - -int -PollEvent ( e ) - SDL_Event *e - CODE: - RETVAL = SDL_PollEvent(e); - OUTPUT: - RETVAL - -int -WaitEvent ( e ) - SDL_Event *e - CODE: - RETVAL = SDL_WaitEvent(e); - OUTPUT: - RETVAL - -Uint8 -EventState ( type, state ) - Uint8 type - int state - CODE: - RETVAL = SDL_EventState(type,state); - OUTPUT: - RETVAL - -Uint8 -EventType ( e ) - SDL_Event *e - CODE: - RETVAL = e->type; - OUTPUT: - RETVAL - -Uint8 -SetEventType ( e, type ) - SDL_Event *e - Uint8 type - CODE: - RETVAL = e->type; - e->type = type; - OUTPUT: - RETVAL - -Uint8 -ActiveEventGain ( e ) - SDL_Event *e - CODE: - RETVAL = e->active.gain; - OUTPUT: - RETVAL - -Uint8 -ActiveEventState ( e ) - SDL_Event *e - CODE: - RETVAL = e->active.state; - OUTPUT: - RETVAL - -Uint8 -KeyEventState( e ) - SDL_Event *e - CODE: - RETVAL = e->key.state; - OUTPUT: - RETVAL - -int -KeyEventSym ( e ) - SDL_Event *e - CODE: - RETVAL = e->key.keysym.sym; - OUTPUT: - RETVAL - -int -KeyEventMod ( e ) - SDL_Event *e - CODE: - RETVAL = e->key.keysym.mod; - OUTPUT: - RETVAL - -Uint16 -KeyEventUnicode ( e ) - SDL_Event *e - CODE: - RETVAL = e->key.keysym.unicode; - OUTPUT: - RETVAL - -Uint8 -KeyEventScanCode ( e ) - SDL_Event *e - CODE: - RETVAL = e->key.keysym.scancode; - OUTPUT: - RETVAL - -Uint8 -MouseMotionState ( e ) - SDL_Event *e - CODE: - RETVAL = e->motion.state; - OUTPUT: - RETVAL - -Uint16 -MouseMotionX ( e ) - SDL_Event *e - CODE: - RETVAL = e->motion.x; - OUTPUT: - RETVAL - -Uint16 -MouseMotionY ( e ) - SDL_Event *e - CODE: - RETVAL = e->motion.y; - OUTPUT: - RETVAL - -Sint16 -MouseMotionXrel( e ) - SDL_Event *e - CODE: - RETVAL = e->motion.xrel; - OUTPUT: - RETVAL - -Sint16 -MouseMotionYrel ( e ) - SDL_Event *e - CODE: - RETVAL = e->motion.yrel; - OUTPUT: - RETVAL - -Uint8 -MouseButtonState ( e ) - SDL_Event *e - CODE: - RETVAL = e->button.state; - OUTPUT: - RETVAL - -Uint8 -MouseButton ( e ) - SDL_Event *e - CODE: - RETVAL = e->button.button; - OUTPUT: - RETVAL - -Uint16 -MouseButtonX ( e ) - SDL_Event *e - CODE: - RETVAL = e->button.x; - OUTPUT: - RETVAL - -Uint16 -MouseButtonY ( e ) - SDL_Event *e - CODE: - RETVAL = e->button.y; - OUTPUT: - RETVAL - -SDL_SysWMmsg * -SysWMEventMsg ( e ) - SDL_Event *e - CODE: - RETVAL = e->syswm.msg; - OUTPUT: - RETVAL - -int -EnableUnicode ( enable ) - int enable - CODE: - RETVAL = SDL_EnableUNICODE(enable); - OUTPUT: - RETVAL - -void -EnableKeyRepeat ( delay, interval ) - int delay - int interval - CODE: - SDL_EnableKeyRepeat(delay,interval); - -Uint32 -GetModState () - CODE: - RETVAL = SDL_GetModState(); - OUTPUT: - RETVAL - -void -SetModState ( state ) - Uint32 state - CODE: - SDL_SetModState(state); - -char * -GetKeyName ( sym ) - int sym - CODE: - RETVAL = SDL_GetKeyName(sym); - OUTPUT: - RETVAL - -SDL_Surface * -CreateRGBSurface (flags, width, height, depth, Rmask, Gmask, Bmask, Amask ) - Uint32 flags - int width - int height - int depth - Uint32 Rmask - Uint32 Gmask - Uint32 Bmask - Uint32 Amask - CODE: - RETVAL = SDL_CreateRGBSurface ( flags, width, height, - depth, Rmask, Gmask, Bmask, Amask ); - OUTPUT: - RETVAL - - -SDL_Surface * -CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask ) - char *pixels - int width - int height - int depth - int pitch - Uint32 Rmask - Uint32 Gmask - Uint32 Bmask - Uint32 Amask - CODE: - Uint8* pixeldata; - Uint32 len = pitch * height; - New(0,pixeldata,len,Uint8); - Copy(pixels,pixeldata,len,Uint8); - RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height, - depth, pitch, Rmask, Gmask, Bmask, Amask ); - OUTPUT: - RETVAL - -#ifdef HAVE_SDL_IMAGE - -SDL_Surface * -IMGLoad ( fname ) - char *fname - CODE: - RETVAL = IMG_Load(fname); - OUTPUT: - RETVAL - -#endif - -SDL_Surface* -SurfaceCopy ( surface ) - SDL_Surface *surface - CODE: - Uint8* pixels; - Uint32 size = surface->pitch * surface->h; - New(0,pixels,size,Uint8); - Copy(surface->pixels,pixels,size,Uint8); - RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h, - surface->format->BitsPerPixel, surface->pitch, - surface->format->Rmask, surface->format->Gmask, - surface->format->Bmask, surface->format->Amask); - OUTPUT: - RETVAL - -void -FreeSurface ( surface ) - SDL_Surface *surface - CODE: - if (surface) { - Uint8* pixels = surface->pixels; - Uint32 flags = surface->flags; - SDL_FreeSurface(surface); - if (flags & SDL_PREALLOC) - Safefree(pixels); - } - -Uint32 -SurfaceFlags ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->flags; - OUTPUT: - RETVAL - -SDL_Palette * -SurfacePalette ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->palette; - OUTPUT: - RETVAL - -Uint8 -SurfaceBitsPerPixel ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->BitsPerPixel; - OUTPUT: - RETVAL - -Uint8 -SurfaceBytesPerPixel ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->BytesPerPixel; - OUTPUT: - RETVAL - -Uint8 -SurfaceRshift ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Rshift; - OUTPUT: - RETVAL - -Uint8 -SurfaceGshift ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Gshift; - OUTPUT: - RETVAL - -Uint8 -SurfaceBshift ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Bshift; - OUTPUT: - RETVAL - -Uint8 -SurfaceAshift ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Ashift; - OUTPUT: - RETVAL - -Uint32 -SurfaceRmask( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Rmask; - OUTPUT: - RETVAL - -Uint32 -SurfaceGmask ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Gmask; - OUTPUT: - RETVAL - -Uint32 -SurfaceBmask ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Bmask; - OUTPUT: - RETVAL - -Uint32 -SurfaceAmask ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->Amask; - OUTPUT: - RETVAL - -Uint32 -SurfaceColorKey ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->colorkey; - OUTPUT: - RETVAL - -Uint32 -SurfaceAlpha( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->format->alpha; - OUTPUT: - RETVAL - -int -SurfaceW ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->w; - OUTPUT: - RETVAL - -int -SurfaceH ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->h; - OUTPUT: - RETVAL - -Uint16 -SurfacePitch ( surface ) - SDL_Surface *surface - CODE: - RETVAL = surface->pitch; - OUTPUT: - RETVAL - -SV* -SurfacePixels ( surface ) - SDL_Surface *surface - CODE: - RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h); - OUTPUT: - RETVAL - -SDL_Color* -SurfacePixel ( surface, x, y, ... ) - SDL_Surface *surface - Sint32 x - Sint32 y - CODE: - SDL_Color* color; - int pix,index; - Uint8 r,g,b,a; - int bpp = surface->format->BytesPerPixel; - Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y; - if ( items < 3 || items > 4 ) - Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])"); - if ( items == 4) { - color = (SDL_Color*)SvIV(ST(3)); - pix = SDL_MapRGB(surface->format,color->r,color->g,color->b); - switch(bpp) { - case 1: - *(Uint8*)p = pix; - break; - case 2: - *(Uint16*)p = pix; - break; - case 3: - if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { - p[0] = (pix >> 16) & 0xff; - p[1] = (pix >> 8) & 0xff; - p[2] = pix & 0xff; - } else { - p[0] = pix & 0xff; - p[1] = (pix >> 8) & 0xff; - p[2] = (pix >> 16) & 0xff; - } - break; - case 4: - *(Uint32*)p = pix; - break; - } - } - RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color)); - switch(bpp) { - case 1: - index = *(Uint8*)p; - memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color)); - break; - case 2: - pix = *(Uint16*)p; - SDL_GetRGB(pix,surface->format,&r,&g,&b); - RETVAL->r = r; - RETVAL->g = g; - RETVAL->b = b; - break; - case 3: - case 4: - pix = *(Uint32*)p; - SDL_GetRGB(pix,surface->format,&r,&g,&b); - RETVAL->r = r; - RETVAL->g = g; - RETVAL->b = b; - break; - } - OUTPUT: - RETVAL - -int -MUSTLOCK ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_MUSTLOCK(surface); - OUTPUT: - RETVAL - -int -SurfaceLock ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_LockSurface(surface); - OUTPUT: - RETVAL - -void -SurfaceUnlock ( surface ) - SDL_Surface *surface - CODE: - SDL_UnlockSurface(surface); - -SDL_Surface * -GetVideoSurface () - CODE: - RETVAL = SDL_GetVideoSurface(); - OUTPUT: - RETVAL - - -HV * -VideoInfo () - CODE: - HV *hv; - SDL_VideoInfo *info; - info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo)); - memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo)); - hv = newHV(); - hv_store(hv,"hw_available",strlen("hw_available"), - newSViv(info->hw_available),0); - hv_store(hv,"wm_available",strlen("wm_available"), - newSViv(info->wm_available),0); - hv_store(hv,"blit_hw",strlen("blit_hw"), - newSViv(info->blit_hw),0); - hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"), - newSViv(info->blit_hw_CC),0); - hv_store(hv,"blit_hw_A",strlen("blit_hw_A"), - newSViv(info->blit_hw_A),0); - hv_store(hv,"blit_sw",strlen("blit_sw"), - newSViv(info->blit_sw),0); - hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"), - newSViv(info->blit_sw_CC),0); - hv_store(hv,"blit_sw_A",strlen("blit_sw_A"), - newSViv(info->blit_sw_A),0); - hv_store(hv,"blit_fill",strlen("blit_fill"), - newSViv(info->blit_fill),0); - hv_store(hv,"video_mem",strlen("video_mem"), - newSViv(info->video_mem),0); - RETVAL = hv; - OUTPUT: - RETVAL - -SDL_Rect * -NewRect ( x, y, w, h ) - Sint16 x - Sint16 y - Uint16 w - Uint16 h - CODE: - RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect)); - RETVAL->x = x; - RETVAL->y = y; - RETVAL->w = w; - RETVAL->h = h; - OUTPUT: - RETVAL - -void -FreeRect ( rect ) - SDL_Rect *rect - CODE: - safefree(rect); - -Sint16 -RectX ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->x = SvIV(ST(1)); - RETVAL = rect->x; - OUTPUT: - RETVAL - -Sint16 -RectY ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->y = SvIV(ST(1)); - RETVAL = rect->y; - OUTPUT: - RETVAL - -Uint16 -RectW ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->w = SvIV(ST(1)); - RETVAL = rect->w; - OUTPUT: - RETVAL - -Uint16 -RectH ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->h = SvIV(ST(1)); - RETVAL = rect->h; - OUTPUT: - RETVAL - -AV* -ListModes ( format, flags ) - Uint32 flags - SDL_PixelFormat *format - CODE: - SDL_Rect **mode; - RETVAL = newAV(); - mode = SDL_ListModes(format,flags); - if (mode == (SDL_Rect**)-1 ) { - av_push(RETVAL,newSVpv("all",0)); - } else if (! mode ) { - av_push(RETVAL,newSVpv("none",0)); - } else { - for (;*mode;mode++) { - av_push(RETVAL,newSViv(PTR2IV(*mode))); - } - } - OUTPUT: - RETVAL - - -SDL_Color * -NewColor ( r, g, b ) - Uint8 r - Uint8 g - Uint8 b - CODE: - RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color)); - RETVAL->r = r; - RETVAL->g = g; - RETVAL->b = b; - OUTPUT: - RETVAL - -Uint8 -ColorR ( color, ... ) - SDL_Color *color - CODE: - if (items > 1 ) color->r = SvIV(ST(1)); - RETVAL = color->r; - OUTPUT: - RETVAL - -Uint8 -ColorG ( color, ... ) - SDL_Color *color - CODE: - if (items > 1 ) color->g = SvIV(ST(1)); - RETVAL = color->g; - OUTPUT: - RETVAL - -Uint8 -ColorB ( color, ... ) - SDL_Color *color - CODE: - if (items > 1 ) color->b = SvIV(ST(1)); - RETVAL = color->b; - OUTPUT: - RETVAL - -void -FreeColor ( color ) - SDL_Color *color - CODE: - return; safefree(color); - -SDL_Palette * -NewPalette ( number ) - int number - CODE: - RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette)); - RETVAL->colors = (SDL_Color *)safemalloc(number * - sizeof(SDL_Color)); - RETVAL->ncolors = number; - OUTPUT: - RETVAL - -int -PaletteNColors ( palette, ... ) - SDL_Palette *palette - CODE: - if ( items > 1 ) palette->ncolors = SvIV(ST(1)); - RETVAL = palette->ncolors; - OUTPUT: - RETVAL - -SDL_Color * -PaletteColors ( palette, index, ... ) - SDL_Palette *palette - int index - CODE: - if ( items > 2 ) { - palette->colors[index].r = SvUV(ST(2)); - palette->colors[index].g = SvUV(ST(3)); - palette->colors[index].b = SvUV(ST(4)); - } - RETVAL = (SDL_Color *)(palette->colors + index); - OUTPUT: - RETVAL - -int -VideoModeOK ( width, height, bpp, flags ) - int width - int height - int bpp - Uint32 flags - CODE: - RETVAL = SDL_VideoModeOK(width,height,bpp,flags); - OUTPUT: - RETVAL - -SDL_Surface * -SetVideoMode ( width, height, bpp, flags ) - int width - int height - int bpp - Uint32 flags - CODE: - RETVAL = SDL_SetVideoMode(width,height,bpp,flags); - OUTPUT: - RETVAL - -void -UpdateRect ( surface, x, y, w ,h ) - SDL_Surface *surface - int x - int y - int w - int h - CODE: - SDL_UpdateRect(surface,x,y,w,h); - -void -UpdateRects ( surface, ... ) - SDL_Surface *surface - CODE: - SDL_Rect *rects, *temp; - int num_rects,i; - if ( items < 2 ) return; - num_rects = items - 1; - rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items); - for(i=0;ix; - rects[i].y = temp->y; - rects[i].w = temp->w; - rects[i].h = temp->h; - } - SDL_UpdateRects(surface,num_rects,rects); - safefree(rects); - -int -Flip ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_Flip(surface); - OUTPUT: - RETVAL - -int -SetColors ( surface, start, ... ) - SDL_Surface *surface - int start - CODE: - SDL_Color *colors,*temp; - int i, length; - if ( items < 3 ) { RETVAL = 0; goto all_done; } - length = items - 2; - colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1)); - for ( i = 0; i < length ; i++ ) { - temp = (SDL_Color *)SvIV(ST(i+2)); - colors[i].r = temp->r; - colors[i].g = temp->g; - colors[i].b = temp->b; - } - RETVAL = SDL_SetColors(surface, colors, start, length ); - safefree(colors); -all_done: - OUTPUT: - RETVAL - -Uint32 -MapRGB ( surface, r, g, b ) - SDL_Surface *surface - Uint8 r - Uint8 g - Uint8 b - CODE: - RETVAL = SDL_MapRGB(surface->format,r,g,b); - OUTPUT: - RETVAL - -Uint32 -MapRGBA ( surface, r, g, b, a ) - SDL_Surface *surface - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = SDL_MapRGBA(surface->format,r,g,b,a); - OUTPUT: - RETVAL - -AV * -GetRGB ( surface, pixel ) - SDL_Surface *surface - Uint32 pixel - CODE: - Uint8 r,g,b; - SDL_GetRGB(pixel,surface->format,&r,&g,&b); - RETVAL = newAV(); - av_push(RETVAL,newSViv(r)); - av_push(RETVAL,newSViv(g)); - av_push(RETVAL,newSViv(b)); - OUTPUT: - RETVAL - -AV * -GetRGBA ( surface, pixel ) - SDL_Surface *surface - Uint32 pixel - CODE: - Uint8 r,g,b,a; - SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a); - RETVAL = newAV(); - av_push(RETVAL,newSViv(r)); - av_push(RETVAL,newSViv(g)); - av_push(RETVAL,newSViv(b)); - av_push(RETVAL,newSViv(a)); - OUTPUT: - RETVAL - -int -SaveBMP ( surface, filename ) - SDL_Surface *surface - char *filename - CODE: - RETVAL = SDL_SaveBMP(surface,filename); - OUTPUT: - RETVAL - -int -SetColorKey ( surface, flag, key ) - SDL_Surface *surface - Uint32 flag - SDL_Color *key - CODE: - Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b); - RETVAL = SDL_SetColorKey(surface,flag,pixel); - OUTPUT: - RETVAL - -int -SetAlpha ( surface, flag, alpha ) - SDL_Surface *surface - Uint32 flag - Uint8 alpha - CODE: - RETVAL = SDL_SetAlpha(surface,flag,alpha); - OUTPUT: - RETVAL - -SDL_Surface * -DisplayFormat ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_DisplayFormat(surface); - OUTPUT: - RETVAL - -SDL_Surface* -DisplayFormatAlpha ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_DisplayFormatAlpha(surface); - OUTPUT: - RETVAL - -SDL_Surface* -ConvertRGB ( surface ) - SDL_Surface * surface - CODE: - SDL_PixelFormat fmt; - fmt.palette = NULL; - fmt.BitsPerPixel = 24; - fmt.BytesPerPixel = 3; - fmt.Rmask = 0x000000ff; - fmt.Gmask = 0x0000ff00; - fmt.Bmask = 0x00ff0000; - fmt.Amask = 0x00000000; - fmt.Rloss = 0; - fmt.Gloss = 0; - fmt.Bloss = 0; - fmt.Aloss = 0; - fmt.Rshift = 0; - fmt.Gshift = 8; - fmt.Bshift = 16; - fmt.Ashift = 24; - fmt.colorkey = 0; - fmt.alpha = 0; - RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags); - OUTPUT: - RETVAL - -SDL_Surface* -ConvertRGBA ( surface ) - SDL_Surface * surface - CODE: - SDL_PixelFormat fmt; - fmt.palette = NULL; - fmt.BitsPerPixel = 32; - fmt.BytesPerPixel = 4; - fmt.Rmask = 0x000000ff; - fmt.Gmask = 0x0000ff00; - fmt.Bmask = 0x00ff0000; - fmt.Amask = 0xff000000; - fmt.Rloss = 0; - fmt.Gloss = 0; - fmt.Bloss = 0; - fmt.Aloss = 0; - fmt.Rshift = 0; - fmt.Gshift = 8; - fmt.Bshift = 16; - fmt.Ashift = 24; - fmt.colorkey = 0; - fmt.alpha = 0; - RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags); - OUTPUT: - RETVAL - -int -BlitSurface ( src, src_rect, dest, dest_rect ) - SDL_Surface *src - SDL_Rect *src_rect - SDL_Surface *dest - SDL_Rect *dest_rect - CODE: - RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect); - OUTPUT: - RETVAL - -int -FillRect ( dest, dest_rect, color ) - SDL_Surface *dest - SDL_Rect *dest_rect - SDL_Color *color - CODE: - Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b); - RETVAL = SDL_FillRect(dest,dest_rect,pixel); - OUTPUT: - RETVAL - -Uint8 -GetAppState () - CODE: - RETVAL = SDL_GetAppState(); - OUTPUT: - RETVAL - - -void -WMSetCaption ( title, icon ) - char *title - char *icon - CODE: - SDL_WM_SetCaption(title,icon); - -AV * -WMGetCaption () - CODE: - char *title,*icon; - SDL_WM_GetCaption(&title,&icon); - RETVAL = newAV(); - av_push(RETVAL,newSVpv(title,0)); - av_push(RETVAL,newSVpv(icon,0)); - OUTPUT: - RETVAL - -void -WMSetIcon ( icon ) - SDL_Surface *icon - CODE: - SDL_WM_SetIcon(icon,NULL); - -void -WarpMouse ( x, y ) - Uint16 x - Uint16 y - CODE: - SDL_WarpMouse(x,y); - -AV* -GetMouseState () - CODE: - Uint8 mask; - int x; - int y; - mask = SDL_GetMouseState(&x,&y); - RETVAL = newAV(); - av_push(RETVAL,newSViv(mask)); - av_push(RETVAL,newSViv(x)); - av_push(RETVAL,newSViv(y)); - OUTPUT: - RETVAL - -AV* -GetRelativeMouseState () - CODE: - Uint8 mask; - int x; - int y; - mask = SDL_GetRelativeMouseState(&x,&y); - RETVAL = newAV(); - av_push(RETVAL,newSViv(mask)); - av_push(RETVAL,newSViv(x)); - av_push(RETVAL,newSViv(y)); - OUTPUT: - RETVAL - -SDL_Cursor * -NewCursor ( data, mask, x ,y ) - SDL_Surface *data - SDL_Surface *mask - int x - int y - CODE: - RETVAL = SDL_CreateCursor((Uint8*)data->pixels, - (Uint8*)mask->pixels,data->w,data->h,x,y); - OUTPUT: - RETVAL - -void -FreeCursor ( cursor ) - SDL_Cursor *cursor - CODE: - SDL_FreeCursor(cursor); - -void -SetCursor ( cursor ) - SDL_Cursor *cursor - CODE: - SDL_SetCursor(cursor); - -SDL_Cursor * -GetCursor () - CODE: - RETVAL = SDL_GetCursor(); - OUTPUT: - RETVAL - -int -ShowCursor ( toggle ) - int toggle - CODE: - RETVAL = SDL_ShowCursor(toggle); - OUTPUT: - RETVAL - -SDL_AudioSpec * -NewAudioSpec ( freq, format, channels, samples ) - int freq - Uint16 format - Uint8 channels - Uint16 samples - CODE: - RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec)); - RETVAL->freq = freq; - RETVAL->format = format; - RETVAL->channels = channels; - RETVAL->samples = samples; - OUTPUT: - RETVAL - -void -FreeAudioSpec ( spec ) - SDL_AudioSpec *spec - CODE: - safefree(spec); - -SDL_AudioCVT * -NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate) - Uint16 src_format - Uint8 src_channels - int src_rate - Uint16 dst_format - Uint8 dst_channels - int dst_rate - CODE: - RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT)); - if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate, - dst_format, dst_channels, dst_rate)) { - safefree(RETVAL); RETVAL = NULL; } - OUTPUT: - RETVAL - -void -FreeAudioCVT ( cvt ) - SDL_AudioCVT *cvt - CODE: - safefree(cvt); - -int -ConvertAudioData ( cvt, data, len ) - SDL_AudioCVT *cvt - Uint8 *data - int len - CODE: - cvt->len = len; - cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult); - memcpy(cvt->buf,data,cvt->len); - RETVAL = SDL_ConvertAudio(cvt); - OUTPUT: - RETVAL - -int -OpenAudio ( spec, callback ) - SDL_AudioSpec *spec - SV* callback - CODE: - spec->userdata = (void*)callback; - spec->callback = sdl_perl_audio_callback; - RETVAL = SDL_OpenAudio(spec,NULL); - OUTPUT: - RETVAL - -Uint32 -GetAudioStatus () - CODE: - RETVAL = SDL_GetAudioStatus (); - OUTPUT: - RETVAL - -void -PauseAudio ( p_on ) - int p_on - CODE: - SDL_PauseAudio(p_on); - -void -LockAudio () - CODE: - SDL_LockAudio(); - -void -UnlockAudio () - CODE: - SDL_UnlockAudio(); - -void -CloseAudio () - CODE: - SDL_CloseAudio(); - -void -FreeWAV ( buf ) - Uint8 *buf - CODE: - SDL_FreeWAV(buf); - -AV * -LoadWAV ( filename, spec ) - char *filename - SDL_AudioSpec *spec - CODE: - SDL_AudioSpec *temp; - Uint8 *buf; - Uint32 len; - - RETVAL = newAV(); - temp = SDL_LoadWAV(filename,spec,&buf,&len); - if ( ! temp ) goto error; - av_push(RETVAL,newSViv(PTR2IV(temp))); - av_push(RETVAL,newSViv(PTR2IV(buf))); - av_push(RETVAL,newSViv(len)); -error: - OUTPUT: - RETVAL - -#ifdef HAVE_SDL_MIXER - -void -MixAudio ( dst, src, len, volume ) - Uint8 *dst - Uint8 *src - Uint32 len - int volume - CODE: - SDL_MixAudio(dst,src,len,volume); - -int -MixOpenAudio ( frequency, format, channels, chunksize ) - int frequency - Uint16 format - int channels - int chunksize - CODE: - RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize); - OUTPUT: - RETVAL - -int -MixAllocateChannels ( number ) - int number - CODE: - RETVAL = Mix_AllocateChannels(number); - OUTPUT: - RETVAL - -AV * -MixQuerySpec () - CODE: - int freq, channels, status; - Uint16 format; - status = Mix_QuerySpec(&freq,&format,&channels); - RETVAL = newAV(); - av_push(RETVAL,newSViv(status)); - av_push(RETVAL,newSViv(freq)); - av_push(RETVAL,newSViv(format)); - av_push(RETVAL,newSViv(channels)); - OUTPUT: - RETVAL - -Mix_Chunk * -MixLoadWAV ( filename ) - char *filename - CODE: - RETVAL = Mix_LoadWAV(filename); - OUTPUT: - RETVAL - -Mix_Music * -MixLoadMusic ( filename ) - char *filename - CODE: - RETVAL = Mix_LoadMUS(filename); - OUTPUT: - RETVAL - -Mix_Chunk * -MixQuickLoadWAV ( buf ) - Uint8 *buf - CODE: - RETVAL = Mix_QuickLoad_WAV(buf); - OUTPUT: - RETVAL - -void -MixFreeChunk( chunk ) - Mix_Chunk *chunk - CODE: - Mix_FreeChunk(chunk); - -void -MixFreeMusic ( music ) - Mix_Music *music - CODE: - Mix_FreeMusic(music); - -void -MixSetPostMixCallback ( func, arg ) - void *func - void *arg - CODE: - Mix_SetPostMix(func,arg); - -void* -PerlMixMusicHook () - CODE: - RETVAL = sdl_perl_music_callback; - OUTPUT: - RETVAL - -void -MixSetMusicHook ( func, arg ) - void *func - void *arg - CODE: - Mix_HookMusic(func,arg); - -void -MixSetMusicFinishedHook ( func ) - void *func - CODE: - mix_music_finished_cv = func; - Mix_HookMusicFinished(sdl_perl_music_finished_callback); - -void * -MixGetMusicHookData () - CODE: - RETVAL = Mix_GetMusicHookData(); - OUTPUT: - RETVAL - -int -MixReverseChannels ( number ) - int number - CODE: - RETVAL = Mix_ReserveChannels ( number ); - OUTPUT: - RETVAL - -int -MixGroupChannel ( which, tag ) - int which - int tag - CODE: - RETVAL = Mix_GroupChannel(which,tag); - OUTPUT: - RETVAL - -int -MixGroupChannels ( from, to, tag ) - int from - int to - int tag - CODE: - RETVAL = Mix_GroupChannels(from,to,tag); - OUTPUT: - RETVAL - -int -MixGroupAvailable ( tag ) - int tag - CODE: - RETVAL = Mix_GroupAvailable(tag); - OUTPUT: - RETVAL - -int -MixGroupCount ( tag ) - int tag - CODE: - RETVAL = Mix_GroupCount(tag); - OUTPUT: - RETVAL - -int -MixGroupOldest ( tag ) - int tag - CODE: - RETVAL = Mix_GroupOldest(tag); - OUTPUT: - RETVAL - -int -MixGroupNewer ( tag ) - int tag - CODE: - RETVAL = Mix_GroupNewer(tag); - OUTPUT: - RETVAL - -int -MixPlayChannel ( channel, chunk, loops ) - int channel - Mix_Chunk *chunk - int loops - CODE: - RETVAL = Mix_PlayChannel(channel,chunk,loops); - OUTPUT: - RETVAL - -int -MixPlayChannelTimed ( channel, chunk, loops, ticks ) - int channel - Mix_Chunk *chunk - int loops - int ticks - CODE: - RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks); - OUTPUT: - RETVAL - -int -MixPlayMusic ( music, loops ) - Mix_Music *music - int loops - CODE: - RETVAL = Mix_PlayMusic(music,loops); - OUTPUT: - RETVAL - -int -MixFadeInChannel ( channel, chunk, loops, ms ) - int channel - Mix_Chunk *chunk - int loops - int ms - CODE: - RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms); - OUTPUT: - RETVAL - -int -MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks ) - int channel - Mix_Chunk *chunk - int loops - int ticks - int ms - CODE: - RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks); - OUTPUT: - RETVAL - -int -MixFadeInMusic ( music, loops, ms ) - Mix_Music *music - int loops - int ms - CODE: - RETVAL = Mix_FadeInMusic(music,loops,ms); - OUTPUT: - RETVAL - -int -MixVolume ( channel, volume ) - int channel - int volume - CODE: - RETVAL = Mix_Volume(channel,volume); - OUTPUT: - RETVAL - -int -MixVolumeChunk ( chunk, volume ) - Mix_Chunk *chunk - int volume - CODE: - RETVAL = Mix_VolumeChunk(chunk,volume); - OUTPUT: - RETVAL - -int -MixVolumeMusic ( volume ) - int volume - CODE: - RETVAL = Mix_VolumeMusic(volume); - OUTPUT: - RETVAL - -int -MixHaltChannel ( channel ) - int channel - CODE: - RETVAL = Mix_HaltChannel(channel); - OUTPUT: - RETVAL - -int -MixHaltGroup ( tag ) - int tag - CODE: - RETVAL = Mix_HaltGroup(tag); - OUTPUT: - RETVAL - -int -MixHaltMusic () - CODE: - RETVAL = Mix_HaltMusic(); - OUTPUT: - RETVAL - -int -MixExpireChannel ( channel, ticks ) - int channel - int ticks - CODE: - RETVAL = Mix_ExpireChannel ( channel,ticks); - OUTPUT: - RETVAL - -int -MixFadeOutChannel ( which, ms ) - int which - int ms - CODE: - RETVAL = Mix_FadeOutChannel(which,ms); - OUTPUT: - RETVAL - -int -MixFadeOutGroup ( which, ms ) - int which - int ms - CODE: - RETVAL = Mix_FadeOutGroup(which,ms); - OUTPUT: - RETVAL - -int -MixFadeOutMusic ( ms ) - int ms - CODE: - RETVAL = Mix_FadeOutMusic(ms); - OUTPUT: - RETVAL - -Mix_Fading -MixFadingMusic() - CODE: - RETVAL = Mix_FadingMusic(); - OUTPUT: - RETVAL - -Mix_Fading -MixFadingChannel( which ) - int which - CODE: - RETVAL = Mix_FadingChannel(which); - OUTPUT: - RETVAL - -void -MixPause ( channel ) - int channel - CODE: - Mix_Pause(channel); - -void -MixResume ( channel ) - int channel - CODE: - Mix_Resume(channel); - -int -MixPaused ( channel ) - int channel - CODE: - RETVAL = Mix_Paused(channel); - OUTPUT: - RETVAL - -void -MixPauseMusic () - CODE: - Mix_PauseMusic(); - -void -MixResumeMusic () - CODE: - Mix_ResumeMusic(); - -void -MixRewindMusic () - CODE: - Mix_RewindMusic(); - -int -MixPausedMusic () - CODE: - RETVAL = Mix_PausedMusic(); - OUTPUT: - RETVAL - -int -MixPlaying( channel ) - int channel - CODE: - RETVAL = Mix_Playing(channel); - OUTPUT: - RETVAL - -int -MixPlayingMusic() - CODE: - RETVAL = Mix_PlayingMusic(); - OUTPUT: - RETVAL - - -void -MixCloseAudio () - CODE: - Mix_CloseAudio(); - -#endif - -int -GLLoadLibrary ( path ) - char *path - CODE: - RETVAL = SDL_GL_LoadLibrary(path); - OUTPUT: - RETVAL - -void* -GLGetProcAddress ( proc ) - char *proc - CODE: - RETVAL = SDL_GL_GetProcAddress(proc); - OUTPUT: - RETVAL - -int -GLSetAttribute ( attr, value ) - int attr - int value - CODE: - RETVAL = SDL_GL_SetAttribute(attr, value); - OUTPUT: - RETVAL - -AV * -GLGetAttribute ( attr ) - int attr - CODE: - int value; - RETVAL = newAV(); - av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value))); - av_push(RETVAL,newSViv(value)); - OUTPUT: - RETVAL - -void -GLSwapBuffers () - CODE: - SDL_GL_SwapBuffers (); - - -int -BigEndian () - CODE: - RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN); - OUTPUT: - RETVAL - -int -NumJoysticks () - CODE: - RETVAL = SDL_NumJoysticks(); - OUTPUT: - RETVAL - -char * -JoystickName ( index ) - int index - CODE: - RETVAL = (char*)SDL_JoystickName(index); - OUTPUT: - RETVAL - -SDL_Joystick * -JoystickOpen ( index ) - int index - CODE: - RETVAL = SDL_JoystickOpen(index); - OUTPUT: - RETVAL - -int -JoystickOpened ( index ) - int index - CODE: - RETVAL = SDL_JoystickOpened(index); - OUTPUT: - RETVAL - -int -JoystickIndex ( joystick ) - SDL_Joystick *joystick - CODE: - RETVAL = SDL_JoystickIndex(joystick); - OUTPUT: - RETVAL - -int -JoystickNumAxes ( joystick ) - SDL_Joystick *joystick - CODE: - RETVAL = SDL_JoystickNumAxes(joystick); - OUTPUT: - RETVAL - -int -JoystickNumBalls ( joystick ) - SDL_Joystick *joystick - CODE: - RETVAL = SDL_JoystickNumBalls(joystick); - OUTPUT: - RETVAL - -int -JoystickNumHats ( joystick ) - SDL_Joystick *joystick - CODE: - RETVAL = SDL_JoystickNumHats(joystick); - OUTPUT: - RETVAL - -int -JoystickNumButtons ( joystick ) - SDL_Joystick *joystick - CODE: - RETVAL = SDL_JoystickNumButtons(joystick); - OUTPUT: - RETVAL - -void -JoystickUpdate () - CODE: - SDL_JoystickUpdate(); - -Sint16 -JoystickGetAxis ( joystick, axis ) - SDL_Joystick *joystick - int axis - CODE: - RETVAL = SDL_JoystickGetAxis(joystick,axis); - OUTPUT: - RETVAL - -Uint8 -JoystickGetHat ( joystick, hat ) - SDL_Joystick *joystick - int hat - CODE: - RETVAL = SDL_JoystickGetHat(joystick,hat); - OUTPUT: - RETVAL - -Uint8 -JoystickGetButton ( joystick, button) - SDL_Joystick *joystick - int button - CODE: - RETVAL = SDL_JoystickGetButton(joystick,button); - OUTPUT: - RETVAL - -AV * -JoystickGetBall ( joystick, ball ) - SDL_Joystick *joystick - int ball - CODE: - int success,dx,dy; - success = SDL_JoystickGetBall(joystick,ball,&dx,&dy); - RETVAL = newAV(); - av_push(RETVAL,newSViv(success)); - av_push(RETVAL,newSViv(dx)); - av_push(RETVAL,newSViv(dy)); - OUTPUT: - RETVAL - -void -JoystickClose ( joystick ) - SDL_Joystick *joystick - CODE: - SDL_JoystickClose(joystick); - -Sint16 -JoyAxisEventWhich ( e ) - SDL_Event *e - CODE: - RETVAL = e->jaxis.which; - OUTPUT: - RETVAL - -Uint8 -JoyAxisEventAxis ( e ) - SDL_Event *e - CODE: - RETVAL = e->jaxis.axis; - OUTPUT: - RETVAL - -Uint8 -JoyAxisEventValue ( e ) - SDL_Event *e - CODE: - RETVAL = e->jaxis.value; - OUTPUT: - RETVAL - -Uint8 -JoyButtonEventWhich ( e ) - SDL_Event *e - CODE: - RETVAL = e->jbutton.which; - OUTPUT: - RETVAL - -Uint8 -JoyButtonEventButton ( e ) - SDL_Event *e - CODE: - RETVAL = e->jbutton.button; - OUTPUT: - RETVAL - -Uint8 -JoyButtonEventState ( e ) - SDL_Event *e - CODE: - RETVAL = e->jbutton.state; - OUTPUT: - RETVAL - -Uint8 -JoyHatEventWhich ( e ) - SDL_Event *e - CODE: - RETVAL = e->jhat.which; - OUTPUT: - RETVAL - -Uint8 -JoyHatEventHat ( e ) - SDL_Event *e - CODE: - RETVAL = e->jhat.hat; - OUTPUT: - RETVAL - -Uint8 -JoyHatEventValue ( e ) - SDL_Event *e - CODE: - RETVAL = e->jhat.value; - OUTPUT: - RETVAL - -Uint8 -JoyBallEventWhich ( e ) - SDL_Event *e - CODE: - RETVAL = e->jball.which; - OUTPUT: - RETVAL - -Uint8 -JoyBallEventBall ( e ) - SDL_Event *e - CODE: - RETVAL = e->jball.ball; - OUTPUT: - RETVAL - -Sint16 -JoyBallEventXrel ( e ) - SDL_Event *e - CODE: - RETVAL = e->jball.xrel; - OUTPUT: - RETVAL - -Sint16 -JoyBallEventYrel ( e ) - SDL_Event *e - CODE: - RETVAL = e->jball.yrel; - OUTPUT: - RETVAL - -void -SetClipRect ( surface, rect ) - SDL_Surface *surface - SDL_Rect *rect - CODE: - SDL_SetClipRect(surface,rect); - -SDL_Rect* -GetClipRect ( surface ) - SDL_Surface *surface - CODE: - RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect)); - SDL_GetClipRect(surface,RETVAL); - OUTPUT: - RETVAL - - -#ifdef HAVE_SDL_NET - -int -NetInit () - CODE: - RETVAL = SDLNet_Init(); - OUTPUT: - RETVAL - -void -NetQuit () - CODE: - SDLNet_Quit(); - -IPaddress* -NetNewIPaddress ( host, port ) - Uint32 host - Uint16 port - CODE: - RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress)); - RETVAL->host = host; - RETVAL->port = port; - OUTPUT: - RETVAL - -Uint32 -NetIPaddressHost ( ip ) - IPaddress *ip - CODE: - RETVAL = ip->host; - OUTPUT: - RETVAL - -Uint16 -NetIPaddressPort ( ip ) - IPaddress *ip - CODE: - RETVAL = ip->port; - OUTPUT: - RETVAL - -void -NetFreeIPaddress ( ip ) - IPaddress *ip - CODE: - safefree(ip); - -const char* -NetResolveIP ( address ) - IPaddress *address - CODE: - RETVAL = SDLNet_ResolveIP(address); - OUTPUT: - RETVAL - -int -NetResolveHost ( address, host, port ) - IPaddress *address - const char *host - Uint16 port - CODE: - RETVAL = SDLNet_ResolveHost(address,host,port); - OUTPUT: - RETVAL - -TCPsocket -NetTCPOpen ( ip ) - IPaddress *ip - CODE: - RETVAL = SDLNet_TCP_Open(ip); - OUTPUT: - RETVAL - -TCPsocket -NetTCPAccept ( server ) - TCPsocket server - CODE: - RETVAL = SDLNet_TCP_Accept(server); - OUTPUT: - RETVAL - -IPaddress* -NetTCPGetPeerAddress ( sock ) - TCPsocket sock - CODE: - RETVAL = SDLNet_TCP_GetPeerAddress(sock); - OUTPUT: - RETVAL - -int -NetTCPSend ( sock, data, len ) - TCPsocket sock - void *data - int len - CODE: - RETVAL = SDLNet_TCP_Send(sock,data,len); - OUTPUT: - RETVAL - -AV* -NetTCPRecv ( sock, maxlen ) - TCPsocket sock - int maxlen - CODE: - int status; - void *buffer; - buffer = safemalloc(maxlen); - RETVAL = newAV(); - status = SDLNet_TCP_Recv(sock,buffer,maxlen); - av_push(RETVAL,newSViv(status)); - av_push(RETVAL,newSVpvn((char*)buffer,maxlen)); - OUTPUT: - RETVAL - -void -NetTCPClose ( sock ) - TCPsocket sock - CODE: - SDLNet_TCP_Close(sock); - -UDPpacket* -NetAllocPacket ( size ) - int size - CODE: - RETVAL = SDLNet_AllocPacket(size); - OUTPUT: - RETVAL - -UDPpacket** -NetAllocPacketV ( howmany, size ) - int howmany - int size - CODE: - RETVAL = SDLNet_AllocPacketV(howmany,size); - OUTPUT: - RETVAL - -int -NetResizePacket ( packet, newsize ) - UDPpacket *packet - int newsize - CODE: - RETVAL = SDLNet_ResizePacket(packet,newsize); - OUTPUT: - RETVAL - -void -NetFreePacket ( packet ) - UDPpacket *packet - CODE: - SDLNet_FreePacket(packet); - -void -NetFreePacketV ( packet ) - UDPpacket **packet - CODE: - SDLNet_FreePacketV(packet); - -UDPsocket -NetUDPOpen ( port ) - Uint16 port - CODE: - RETVAL = SDLNet_UDP_Open(port); - OUTPUT: - RETVAL - -int -NetUDPBind ( sock, channel, address ) - UDPsocket sock - int channel - IPaddress *address - CODE: - RETVAL = SDLNet_UDP_Bind(sock,channel,address); - OUTPUT: - RETVAL - -void -NetUDPUnbind ( sock, channel ) - UDPsocket sock - int channel - CODE: - SDLNet_UDP_Unbind(sock,channel); - -IPaddress* -NetUDPGetPeerAddress ( sock, channel ) - UDPsocket sock - int channel - CODE: - RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel); - OUTPUT: - RETVAL - -int -NetUDPSendV ( sock, packets, npackets ) - UDPsocket sock - UDPpacket **packets - int npackets - CODE: - RETVAL = SDLNet_UDP_SendV(sock,packets,npackets); - OUTPUT: - RETVAL - -int -NetUDPSend ( sock, channel, packet ) - UDPsocket sock - int channel - UDPpacket *packet - CODE: - RETVAL = SDLNet_UDP_Send(sock,channel,packet); - OUTPUT: - RETVAL - -int -NetUDPRecvV ( sock, packets ) - UDPsocket sock - UDPpacket **packets - CODE: - RETVAL = SDLNet_UDP_RecvV(sock,packets); - OUTPUT: - RETVAL - -int -NetUDPRecv ( sock, packet ) - UDPsocket sock - UDPpacket *packet - CODE: - RETVAL = SDLNet_UDP_Recv(sock,packet); - OUTPUT: - RETVAL - -void -NetUDPClose ( sock ) - UDPsocket sock - CODE: - SDLNet_UDP_Close(sock); - -SDLNet_SocketSet -NetAllocSocketSet ( maxsockets ) - int maxsockets - CODE: - RETVAL = SDLNet_AllocSocketSet(maxsockets); - OUTPUT: - RETVAL - -int -NetTCP_AddSocket ( set, sock ) - SDLNet_SocketSet set - TCPsocket sock - CODE: - RETVAL = SDLNet_TCP_AddSocket(set,sock); - OUTPUT: - RETVAL - -int -NetUDP_AddSocket ( set, sock ) - SDLNet_SocketSet set - UDPsocket sock - CODE: - RETVAL = SDLNet_UDP_AddSocket(set,sock); - OUTPUT: - RETVAL - -int -NetTCP_DelSocket ( set, sock ) - SDLNet_SocketSet set - TCPsocket sock - CODE: - RETVAL = SDLNet_TCP_DelSocket(set,sock); - OUTPUT: - RETVAL - -int -NetUDP_DelSocket ( set, sock ) - SDLNet_SocketSet set - UDPsocket sock - CODE: - RETVAL = SDLNet_UDP_DelSocket(set,sock); - OUTPUT: - RETVAL - -int -NetCheckSockets ( set, timeout ) - SDLNet_SocketSet set - Uint32 timeout - CODE: - RETVAL = SDLNet_CheckSockets(set,timeout); - OUTPUT: - RETVAL - -int -NetSocketReady ( sock ) - SDLNet_GenericSocket sock - CODE: - RETVAL = SDLNet_SocketReady(sock); - OUTPUT: - RETVAL - -void -NetFreeSocketSet ( set ) - SDLNet_SocketSet set - CODE: - SDLNet_FreeSocketSet(set); - -void -NetWrite16 ( value, area ) - Uint16 value - void *area - CODE: - SDLNet_Write16(value,area); - -void -NetWrite32 ( value, area ) - Uint32 value - void *area - CODE: - SDLNet_Write32(value,area); - -Uint16 -NetRead16 ( area ) - void *area - CODE: - RETVAL = SDLNet_Read16(area); - OUTPUT: - RETVAL - -Uint32 -NetRead32 ( area ) - void *area - CODE: - RETVAL = SDLNet_Read32(area); - OUTPUT: - RETVAL - -#endif - -#ifdef HAVE_SDL_TTF - -int -TTFInit () - CODE: - RETVAL = TTF_Init(); - OUTPUT: - RETVAL - -void -TTFQuit () - CODE: - TTF_Quit(); - -TTF_Font* -TTFOpenFont ( file, ptsize ) - char *file - int ptsize - CODE: - RETVAL = TTF_OpenFont(file,ptsize); - OUTPUT: - RETVAL - -int -TTFGetFontStyle ( font ) - TTF_Font *font - CODE: - RETVAL = TTF_GetFontStyle(font); - OUTPUT: - RETVAL - -void -TTFSetFontStyle ( font, style ) - TTF_Font *font - int style - CODE: - TTF_SetFontStyle(font,style); - -int -TTFFontHeight ( font ) - TTF_Font *font - CODE: - RETVAL = TTF_FontHeight(font); - OUTPUT: - RETVAL - -int -TTFFontAscent ( font ) - TTF_Font *font - CODE: - RETVAL = TTF_FontAscent(font); - OUTPUT: - RETVAL - -int -TTFFontDescent ( font ) - TTF_Font *font - CODE: - RETVAL = TTF_FontDescent(font); - OUTPUT: - RETVAL - -int -TTFFontLineSkip ( font ) - TTF_Font *font - CODE: - RETVAL = TTF_FontLineSkip(font); - OUTPUT: - RETVAL - -AV* -TTFGlyphMetrics ( font, ch ) - TTF_Font *font - Uint16 ch - CODE: - int minx, miny, maxx, maxy, advance; - RETVAL = newAV(); - TTF_GlyphMetrics(font, ch, &minx, &miny, &maxx, &maxy, &advance); - av_push(RETVAL,newSViv(minx)); - av_push(RETVAL,newSViv(miny)); - av_push(RETVAL,newSViv(maxx)); - av_push(RETVAL,newSViv(maxy)); - av_push(RETVAL,newSViv(advance)); - OUTPUT: - RETVAL - -AV* -TTFSizeText ( font, text ) - TTF_Font *font - char *text - CODE: - int w,h; - RETVAL = newAV(); - TTF_SizeText(font,text,&w,&h); - av_push(RETVAL,newSViv(w)); - av_push(RETVAL,newSViv(h)); - OUTPUT: - RETVAL - -AV* -TTFSizeUTF8 ( font, text ) - TTF_Font *font - char *text - CODE: - int w,h; - RETVAL = newAV(); - TTF_SizeUTF8(font,text,&w,&h); - av_push(RETVAL,newSViv(w)); - av_push(RETVAL,newSViv(h)); - OUTPUT: - RETVAL - -AV* -TTFSizeUNICODE ( font, text ) - TTF_Font *font - const Uint16 *text - CODE: - int w,h; - RETVAL = newAV(); - TTF_SizeUNICODE(font,text,&w,&h); - av_push(RETVAL,newSViv(w)); - av_push(RETVAL,newSViv(h)); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderTextSolid ( font, text, fg ) - TTF_Font *font - char *text - SDL_Color *fg - CODE: - RETVAL = TTF_RenderText_Solid(font,text,*fg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderUTF8Solid ( font, text, fg ) - TTF_Font *font - char *text - SDL_Color *fg - CODE: - RETVAL = TTF_RenderUTF8_Solid(font,text,*fg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderUNICODESolid ( font, text, fg ) - TTF_Font *font - const Uint16 *text - SDL_Color *fg - CODE: - RETVAL = TTF_RenderUNICODE_Solid(font,text,*fg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderGlyphSolid ( font, ch, fg ) - TTF_Font *font - Uint16 ch - SDL_Color *fg - CODE: - RETVAL = TTF_RenderGlyph_Solid(font,ch,*fg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderTextShaded ( font, text, fg, bg ) - TTF_Font *font - char *text - SDL_Color *fg - SDL_Color *bg - CODE: - RETVAL = TTF_RenderText_Shaded(font,text,*fg,*bg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderUTF8Shaded( font, text, fg, bg ) - TTF_Font *font - char *text - SDL_Color *fg - SDL_Color *bg - CODE: - RETVAL = TTF_RenderUTF8_Shaded(font,text,*fg,*bg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderUNICODEShaded( font, text, fg, bg ) - TTF_Font *font - const Uint16 *text - SDL_Color *fg - SDL_Color *bg - CODE: - RETVAL = TTF_RenderUNICODE_Shaded(font,text,*fg,*bg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderGlyphShaded ( font, ch, fg, bg ) - TTF_Font *font - Uint16 ch - SDL_Color *fg - SDL_Color *bg - CODE: - RETVAL = TTF_RenderGlyph_Shaded(font,ch,*fg,*bg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderTextBlended( font, text, fg ) - TTF_Font *font - char *text - SDL_Color *fg - CODE: - RETVAL = TTF_RenderText_Blended(font,text,*fg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderUTF8Blended( font, text, fg ) - TTF_Font *font - char *text - SDL_Color *fg - CODE: - RETVAL = TTF_RenderUTF8_Blended(font,text,*fg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderUNICODEBlended( font, text, fg ) - TTF_Font *font - const Uint16 *text - SDL_Color *fg - CODE: - RETVAL = TTF_RenderUNICODE_Blended(font,text,*fg); - OUTPUT: - RETVAL - -SDL_Surface* -TTFRenderGlyphBlended( font, ch, fg ) - TTF_Font *font - Uint16 ch - SDL_Color *fg - CODE: - RETVAL = TTF_RenderGlyph_Blended(font,ch,*fg); - OUTPUT: - RETVAL - -void -TTFCloseFont ( font ) - TTF_Font *font - CODE: - TTF_CloseFont(font); - -SDL_Surface* -TTFPutString ( font, mode, surface, x, y, fg, bg, text ) - TTF_Font *font - int mode - SDL_Surface *surface - int x - int y - SDL_Color *fg - SDL_Color *bg - char *text - CODE: - SDL_Surface *img; - SDL_Rect dest; - int w,h; - dest.x = x; - dest.y = y; - RETVAL = NULL; - switch (mode) { - case TEXT_SOLID: - img = TTF_RenderText_Solid(font,text,*fg); - TTF_SizeText(font,text,&w,&h); - dest.w = w; - dest.h = h; - break; - case TEXT_SHADED: - img = TTF_RenderText_Shaded(font,text,*fg,*bg); - TTF_SizeText(font,text,&w,&h); - dest.w = w; - dest.h = h; - break; - case TEXT_BLENDED: - img = TTF_RenderText_Blended(font,text,*fg); - TTF_SizeText(font,text,&w,&h); - dest.w = w; - dest.h = h; - break; - case UTF8_SOLID: - img = TTF_RenderUTF8_Solid(font,text,*fg); - TTF_SizeUTF8(font,text,&w,&h); - dest.w = w; - dest.h = h; - break; - case UTF8_SHADED: - img = TTF_RenderUTF8_Shaded(font,text,*fg,*bg); - TTF_SizeUTF8(font,text,&w,&h); - dest.w = w; - dest.h = h; - break; - case UTF8_BLENDED: - img = TTF_RenderUTF8_Blended(font,text,*fg); - TTF_SizeUTF8(font,text,&w,&h); - dest.w = w; - dest.h = h; - break; - case UNICODE_SOLID: - img = TTF_RenderUNICODE_Solid(font,(Uint16*)text,*fg); - TTF_SizeUNICODE(font,(Uint16*)text,&w,&h); - dest.w = w; - dest.h = h; - break; - case UNICODE_SHADED: - img = TTF_RenderUNICODE_Shaded(font,(Uint16*)text,*fg,*bg); - TTF_SizeUNICODE(font,(Uint16*)text,&w,&h); - dest.w = w; - dest.h = h; - break; - case UNICODE_BLENDED: - img = TTF_RenderUNICODE_Blended(font,(Uint16*)text,*fg); - TTF_SizeUNICODE(font,(Uint16*)text,&w,&h); - dest.w = w; - dest.h = h; - break; - default: - img = TTF_RenderText_Shaded(font,text,*fg,*bg); - TTF_SizeText(font,text,&w,&h); - dest.w = w; - dest.h = h; - } - if ( img && img->format && img->format->palette ) { - SDL_Color *c = &img->format->palette->colors[0]; - Uint32 key = SDL_MapRGB( img->format, c->r, c->g, c->b ); - SDL_SetColorKey(img,SDL_SRCCOLORKEY,key ); - if (0 > SDL_BlitSurface(img,NULL,surface,&dest)) { - SDL_FreeSurface(img); - RETVAL = NULL; - } else { - RETVAL = img; - } - } - OUTPUT: - RETVAL - -#endif - -SDL_Overlay* -CreateYUVOverlay ( width, height, format, display ) - int width - int height - Uint32 format - SDL_Surface *display - CODE: - RETVAL = SDL_CreateYUVOverlay ( width, height, format, display ); - OUTPUT: - RETVAL - -int -LockYUVOverlay ( overlay ) - SDL_Overlay *overlay - CODE: - RETVAL = SDL_LockYUVOverlay(overlay); - OUTPUT: - RETVAL - -void -UnlockYUVOverlay ( overlay ) - SDL_Overlay *overlay - CODE: - SDL_UnlockYUVOverlay(overlay); - -int -DisplayYUVOverlay ( overlay, dstrect ) - SDL_Overlay *overlay - SDL_Rect *dstrect - CODE: - RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect ); - OUTPUT: - RETVAL - -void -FreeYUVOverlay ( overlay ) - SDL_Overlay *overlay - CODE: - SDL_FreeYUVOverlay ( overlay ); - -Uint32 -OverlayFormat ( overlay, ... ) - SDL_Overlay *overlay - CODE: - if ( items > 1 ) - overlay->format = SvIV(ST(1)); - RETVAL = overlay->format; - OUTPUT: - RETVAL - -int -OverlayW ( overlay, ... ) - SDL_Overlay *overlay - CODE: - if ( items > 1 ) - overlay->w = SvIV(ST(1)); - RETVAL = overlay->w; - OUTPUT: - RETVAL - -int -OverlayH ( overlay, ... ) - SDL_Overlay *overlay - CODE: - if ( items > 1 ) - overlay->h = SvIV(ST(1)); - RETVAL = overlay->h; - OUTPUT: - RETVAL - -int -OverlayPlanes ( overlay, ... ) - SDL_Overlay *overlay - CODE: - if ( items > 1 ) - overlay->planes = SvIV(ST(1)); - RETVAL = overlay->planes; - OUTPUT: - RETVAL - -Uint32 -OverlayHW ( overlay ) - SDL_Overlay *overlay - CODE: - RETVAL = overlay->hw_overlay; - OUTPUT: - RETVAL - -Uint16* -OverlayPitches ( overlay ) - SDL_Overlay *overlay - CODE: - RETVAL = overlay->pitches; - OUTPUT: - RETVAL - -Uint8** -OverlayPixels ( overlay ) - SDL_Overlay *overlay - CODE: - RETVAL = overlay->pixels; - OUTPUT: - RETVAL - -int -WMToggleFullScreen ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_WM_ToggleFullScreen(surface); - OUTPUT: - RETVAL - -Uint32 -WMGrabInput ( mode ) - Uint32 mode - CODE: - RETVAL = SDL_WM_GrabInput(mode); - OUTPUT: - RETVAL - -int -WMIconifyWindow () - CODE: - RETVAL = SDL_WM_IconifyWindow(); - OUTPUT: - RETVAL - -int -ResizeEventW ( e ) - SDL_Event *e - CODE: - RETVAL = e->resize.w; - OUTPUT: - RETVAL - -int -ResizeEventH ( e ) - SDL_Event *e - CODE: - RETVAL = e->resize.h; - OUTPUT: - RETVAL - -char* -AudioDriverName () - CODE: - char name[32]; - RETVAL = SDL_AudioDriverName(name,32); - OUTPUT: - RETVAL - -Uint32 -GetKeyState ( k ) - SDLKey k - CODE: - if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range"); - RETVAL = SDL_GetKeyState(NULL)[k]; - OUTPUT: - RETVAL - -#ifdef HAVE_SMPEG - -SMPEG_Info * -NewSMPEGInfo() - CODE: - RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info)); - OUTPUT: - RETVAL - -void -FreeSMPEGInfo ( info ) - SMPEG_Info *info - CODE: - safefree(info); - -int -SMPEGInfoHasAudio ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->has_audio; - OUTPUT: - RETVAL - -int -SMPEGInfoHasVideo ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->has_video; - OUTPUT: - RETVAL - -int -SMPEGInfoWidth ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->width; - OUTPUT: - RETVAL - -int -SMPEGInfoHeight ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->height; - OUTPUT: - RETVAL - -int -SMPEGInfoCurrentFrame ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->current_frame; - OUTPUT: - RETVAL - -double -SMPEGInfoCurrentFPS ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->current_fps; - OUTPUT: - RETVAL - -int -SMPEGInfoCurrentAudioFrame ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->audio_current_frame; - OUTPUT: - RETVAL - -int -SMPEGInfoCurrentOffset ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->current_offset; - OUTPUT: - RETVAL - -int -SMPEGInfoTotalSize ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->total_size; - OUTPUT: - RETVAL - -double -SMPEGInfoCurrentTime ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->current_time; - OUTPUT: - RETVAL - -double -SMPEGInfoTotalTime ( info ) - SMPEG_Info* info - CODE: - RETVAL = info->total_time; - OUTPUT: - RETVAL - -char * -SMPEGError ( mpeg ) - SMPEG* mpeg - CODE: - RETVAL = SMPEG_error(mpeg); - OUTPUT: - RETVAL - -SMPEG* -NewSMPEG ( filename, info, use_audio ) - char* filename - SMPEG_Info* info - int use_audio - CODE: -#ifdef HAVE_SDL_MIXER - RETVAL = SMPEG_new(filename,info,0); -#else - RETVAL = SMPEG_new(filename,info,use_audio); -#endif - OUTPUT: - RETVAL - -void -FreeSMPEG ( mpeg ) - SMPEG* mpeg - CODE: - SMPEG_delete(mpeg); - -void -SMPEGEnableAudio ( mpeg , flag ) - SMPEG* mpeg - int flag - CODE: - SMPEG_enableaudio(mpeg,flag); -#ifdef HAVE_SDL_MIXER - sdl_perl_use_smpeg_audio = flag; -#endif - -void -SMPEGEnableVideo ( mpeg , flag ) - SMPEG* mpeg - int flag - CODE: - SMPEG_enablevideo(mpeg,flag); - -void -SMPEGSetVolume ( mpeg , volume ) - SMPEG* mpeg - int volume - CODE: - SMPEG_setvolume(mpeg,volume); - -void -SMPEGSetDisplay ( mpeg, dest, surfLock ) - SMPEG* mpeg - SDL_Surface* dest - SDL_mutex* surfLock - CODE: - SMPEG_setdisplay(mpeg,dest,surfLock,NULL); - -void -SMPEGScaleXY ( mpeg, w, h) - SMPEG* mpeg - int w - int h - CODE: - SMPEG_scaleXY(mpeg,w,h); - -void -SMPEGScale ( mpeg, scale ) - SMPEG* mpeg - int scale - CODE: - SMPEG_scale(mpeg,scale); - -void -SMPEGPlay ( mpeg ) - SMPEG* mpeg - CODE: - SDL_AudioSpec audiofmt; - Uint16 format; - int freq, channels; -#ifdef HAVE_SDL_MIXER - if (sdl_perl_use_smpeg_audio ) { - SMPEG_enableaudio(mpeg, 0); - Mix_QuerySpec(&freq, &format, &channels); - audiofmt.format = format; - audiofmt.freq = freq; - audiofmt.channels = channels; - SMPEG_actualSpec(mpeg, &audiofmt); - Mix_HookMusic(SMPEG_playAudioSDL, mpeg); - SMPEG_enableaudio(mpeg, 1); - } -#endif - SMPEG_play(mpeg); - -SMPEGstatus -SMPEGStatus ( mpeg ) - SMPEG* mpeg - CODE: - RETVAL = SMPEG_status(mpeg); - OUTPUT: - RETVAL - -void -SMPEGPause ( mpeg ) - SMPEG* mpeg - CODE: - SMPEG_pause(mpeg); - -void -SMPEGLoop ( mpeg, repeat ) - SMPEG* mpeg - int repeat - CODE: - SMPEG_loop(mpeg,repeat); - -void -SMPEGStop ( mpeg ) - SMPEG* mpeg - CODE: - SMPEG_stop(mpeg); -#ifdef HAVE_SDL_MIXER - Mix_HookMusic(NULL, NULL); -#endif - -void -SMPEGRewind ( mpeg ) - SMPEG* mpeg - CODE: - SMPEG_rewind(mpeg); - -void -SMPEGSeek ( mpeg, bytes ) - SMPEG* mpeg - int bytes - CODE: - SMPEG_seek(mpeg,bytes); - -void -SMPEGSkip ( mpeg, seconds ) - SMPEG* mpeg - float seconds - CODE: - SMPEG_skip(mpeg,seconds); - -void -SMPEGSetDisplayRegion ( mpeg, rect ) - SMPEG* mpeg - SDL_Rect* rect - CODE: - SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h); - -void -SMPEGRenderFrame ( mpeg, frame ) - SMPEG* mpeg - int frame - CODE: - SMPEG_renderFrame(mpeg,frame); - -SMPEG_Info * -SMPEGGetInfo ( mpeg ) - SMPEG* mpeg - CODE: - RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info)); - SMPEG_getinfo(mpeg,RETVAL); - OUTPUT: - RETVAL - - -#endif - -#ifdef HAVE_SDL_GFX - -SDL_Surface * -GFXRotoZoom ( src, angle, zoom, smooth) - SDL_Surface * src - double angle - double zoom - int smooth - CODE: - RETVAL = rotozoomSurface( src, angle, zoom, smooth); - OUTPUT: - RETVAL - -SDL_Surface * -GFXZoom ( src, zoomx, zoomy, smooth) - SDL_Surface *src - double zoomx - double zoomy - int smooth - CODE: - RETVAL = zoomSurface( src, zoomx, zoomy, smooth); - OUTPUT: - RETVAL - -int -GFXPixelColor ( dst, x, y, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - Uint32 color - CODE: - RETVAL = pixelColor( dst, x, y, color); - OUTPUT: - RETVAL - -int -GFXPixelRGBA ( dst, x, y, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = pixelRGBA( dst, x, y, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXHlineColor ( dst, x1, x2, y, color ) - SDL_Surface* dst - Sint16 x1 - Sint16 x2 - Sint16 y - Uint32 color - CODE: - RETVAL = hlineColor( dst, x1, x2, y, color ); - OUTPUT: - RETVAL - -int -GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a ) - SDL_Surface* dst - Sint16 x1 - Sint16 x2 - Sint16 y - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXVlineColor ( dst, x, y1, y2, color ) - SDL_Surface* dst - Sint16 x - Sint16 y1 - Sint16 y2 - Uint32 color - CODE: - RETVAL = vlineColor( dst, x, y1, y2, color ); - OUTPUT: - RETVAL - -int -GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y1 - Sint16 y2 - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXRectangleColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint32 color - CODE: - RETVAL = rectangleColor( dst, x1, y1, x2, y2, color ); - OUTPUT: - RETVAL - -int -GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXBoxColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint32 color - CODE: - RETVAL = boxColor( dst, x1, y1, x2, y2, color ); - OUTPUT: - RETVAL - -int -GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst; - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXLineColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint32 color - CODE: - RETVAL = lineColor( dst, x1, y1, x2, y2, color ); - OUTPUT: - RETVAL - -int -GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXAalineColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint32 color - CODE: - RETVAL = aalineColor( dst, x1, y1, x2, y2, color ); - OUTPUT: - RETVAL - -int -GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst - Sint16 x1 - Sint16 y1 - Sint16 x2 - Sint16 y2 - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXCircleColor ( dst, x, y, r, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 r - Uint32 color - CODE: - RETVAL = circleColor( dst, x, y, r, color ); - OUTPUT: - RETVAL - -int -GFXCircleRGBA ( dst, x, y, rad, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rad - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXAacircleColor ( dst, x, y, r, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 r - Uint32 color - CODE: - RETVAL = aacircleColor( dst, x, y, r, color ); - OUTPUT: - RETVAL - -int -GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rad - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXFilledCircleColor ( dst, x, y, r, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 r - Uint32 color - CODE: - RETVAL = filledCircleColor( dst, x, y, r, color ); - OUTPUT: - RETVAL - -int -GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rad - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXEllipseColor ( dst, x, y, rx, ry, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rx - Sint16 ry - Uint32 color - CODE: - RETVAL = ellipseColor( dst, x, y, rx, ry, color ); - OUTPUT: - RETVAL - -int -GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rx - Sint16 ry - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXAaellipseColor ( dst, xc, yc, rx, ry, color ) - SDL_Surface* dst - Sint16 xc - Sint16 yc - Sint16 rx - Sint16 ry - Uint32 color - CODE: - RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color ); - OUTPUT: - RETVAL - -int -GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rx - Sint16 ry - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXFilledEllipseColor ( dst, x, y, rx, ry, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rx - Sint16 ry - Uint32 color - CODE: - RETVAL = filledEllipseColor( dst, x, y, rx, ry, color ); - OUTPUT: - RETVAL - -int -GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rx - Sint16 ry - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXFilledPieColor ( dst, x, y, rad, start, end, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rad - Sint16 start - Sint16 end - Uint32 color - CODE: - RETVAL = filledPieColor( dst, x, y, rad, start, end, color ); - OUTPUT: - RETVAL - -int -GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - Sint16 rad - Sint16 start - Sint16 end - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXPolygonColor ( dst, vx, vy, n, color ) - SDL_Surface* dst - Sint16* vx - Sint16* vy - int n - Uint32 color; - CODE: - RETVAL = polygonColor( dst, vx, vy, n, color ); - OUTPUT: - RETVAL - -int -GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a ) - SDL_Surface* dst - Sint16* vx - Sint16* vy - int n - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXAapolygonColor ( dst, vx, vy, n, color ) - SDL_Surface* dst - Sint16* vx - Sint16* vy - int n - Uint32 color - CODE: - RETVAL = aapolygonColor( dst, vx, vy, n, color ); - OUTPUT: - RETVAL - -int -GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a ) - SDL_Surface* dst - Sint16* vx - Sint16* vy - int n - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXFilledPolygonColor ( dst, vx, vy, n, color ) - SDL_Surface* dst - Sint16* vx - Sint16* vy - int n - int color - CODE: - RETVAL = filledPolygonColor( dst, vx, vy, n, color ); - OUTPUT: - RETVAL - -int -GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a ) - SDL_Surface* dst - Sint16* vx - Sint16* vy - int n - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXCharacterColor ( dst, x, y, c, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - char c - Uint32 color - CODE: - RETVAL = characterColor( dst, x, y, c, color ); - OUTPUT: - RETVAL - -int -GFXCharacterRGBA ( dst, x, y, c, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - char c - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = characterRGBA( dst, x, y, c, r, g, b, a ); - OUTPUT: - RETVAL - -int -GFXStringColor ( dst, x, y, c, color ) - SDL_Surface* dst - Sint16 x - Sint16 y - char* c - Uint32 color - CODE: - RETVAL = stringColor( dst, x, y, c, color ); - OUTPUT: - RETVAL - -int -GFXStringRGBA ( dst, x, y, c, r, g, b, a ) - SDL_Surface* dst - Sint16 x - Sint16 y - char* c - Uint8 r - Uint8 g - Uint8 b - Uint8 a - CODE: - RETVAL = stringRGBA( dst, x, y, c, r, g, b, a ); - OUTPUT: - RETVAL - -#endif - - -#ifdef HAVE_SDL_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 - -#ifdef HAVE_SDL_SOUND - -Uint16 -SoundAudioInfoFormat ( audioinfo ) - Sound_AudioInfo* audioinfo - CODE: - RETVAL = audioinfo->format; - OUTPUT: - RETVAL - -Uint8 -SoundAudioInfoChannels ( audioinfo ) - Sound_AudioInfo* audioinfo - CODE: - RETVAL = audioinfo->channels; - OUTPUT: - RETVAL - -Uint32 -SoundAudioInforate ( audioinfo ) - Sound_AudioInfo* audioinfo - CODE: - RETVAL = audioinfo->rate; - OUTPUT: - RETVAL - -AV* -SoundDecoderInfoExtensions ( decoderinfo ) - Sound_DecoderInfo* decoderinfo - CODE: - const char **ext; - for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){ - av_push(RETVAL,newSVpv(*ext,0)); - } - OUTPUT: - RETVAL - -const char* -SoundDecoderInfoDescription ( decoderinfo ) - Sound_DecoderInfo* decoderinfo - CODE: - RETVAL = decoderinfo->description; - OUTPUT: - RETVAL - -const char* -SoundDecoderInfoAuthor ( decoderinfo ) - Sound_DecoderInfo* decoderinfo - CODE: - RETVAL = decoderinfo->author; - OUTPUT: - RETVAL - -const char* -SoundDecoderInfoUrl ( decoderinfo ) - Sound_DecoderInfo* decoderinfo - CODE: - RETVAL = decoderinfo->url; - OUTPUT: - RETVAL - -const Sound_DecoderInfo* -SoundSampleDecoder ( sample ) - Sound_Sample* sample - CODE: - RETVAL = sample->decoder; - OUTPUT: - RETVAL - -Sound_AudioInfo* -SoundSampleDesired ( sample ) - Sound_Sample* sample - CODE: - RETVAL = &sample->desired; - OUTPUT: - RETVAL - -Sound_AudioInfo* -SoundSampleAcutal ( sample ) - Sound_Sample* sample - CODE: - RETVAL = &sample->actual; - OUTPUT: - RETVAL - -char* -SoundSampleBuffer ( sample ) - Sound_Sample* sample - CODE: - RETVAL = sample->buffer; - OUTPUT: - RETVAL - -Uint32 -SoundSampleBufferSize ( sample ) - Sound_Sample* sample - CODE: - RETVAL = sample->buffer_size; - OUTPUT: - RETVAL - -Uint32 -SoundSampleFlags ( sample ) - Sound_Sample* sample - CODE: - RETVAL = (Uint32)sample->flags; - 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 - -MODULE = SDL PACKAGE = SDL -PROTOTYPES : DISABLE - - diff --git a/test/OpenGL/test1.sdlpl b/test/OpenGL/test1.sdlpl deleted file mode 100644 index a9ff01d..0000000 --- a/test/OpenGL/test1.sdlpl +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env perl -# -# test1.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 SDL; -use SDL::App; -use SDL::Surface; -use SDL::Event; -use SDL::OpenGL; -use SDL::OpenGL::Constants; - -#for ( keys %main:: ) { -# print "$_\n"; -#} - -print "Starting $0\n"; - -my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1; - -print "Initializing OpenGL settings\n"; -printf "%-24s%s\n", "GL_RED_SIZE ", $app->attribute( SDL_GL_RED_SIZE() ); -printf "%-24s%s\n", "GL_GREEN_SIZE ", $app->attribute( SDL_GL_GREEN_SIZE()); -printf "%-24s%s\n", "GL_BLUE_SIZE ", $app->attribute( SDL_GL_BLUE_SIZE() ); -printf "%-24s%s\n", "GL_DEPTH_SIZE ", $app->attribute( SDL_GL_DEPTH_SIZE() ); -printf "%-24s%s\n", "GL_DOUBLEBUFFER ", $app->attribute( SDL_GL_DOUBLEBUFFER() ); - -sub DrawScene { - - glClear( GL_DEPTH_BUFFER_BIT() - | GL_COLOR_BUFFER_BIT()); - - glLoadIdentity(); - - glTranslate(-1.5,0,-6); - - glColor(1,1,1); - - glBegin(GL_TRIANGLES()); - glColor(1,0,0) if (@_); - glVertex(0,1,0); - glColor(0,1,0) if (@_); - glVertex(-1,-1,0); - glColor(0,0,1) if (@_); - glVertex(1,-1,0); - glEnd(); - - glTranslate(3,0,0); - - glBegin(GL_QUADS()); - glColor(1,0,0) if (@_); - glVertex(-1,1,0); - glColor(0,1,0) if (@_); - glVertex(1,1,0); - glColor(0,0,1) if (@_); - glVertex(1,-1,0); - glColor(1,1,0) if (@_); - glVertex(-1,-1,0); - glEnd(); -} - -sub DrawColorScene { - DrawScene 'with color'; -} - -sub InitView { - glViewport(0,0,800,600); - - glMatrixMode(GL_PROJECTION()); - glLoadIdentity(); - - if ( @_ ) { - gluPerspective(45.0,4/3,0.1,100.0); - } else { - glFrustum(-0.1,0.1,-0.075,0.075,0.175,100.0); - } - - glMatrixMode(GL_MODELVIEW()); - glLoadIdentity(); -} - -InitView(); - -DrawScene(); - -$app->sync(); - -my $toggle = 1; - -$app->loop( { - SDL_QUIT() => sub { exit(0); }, - SDL_KEYDOWN() => sub { $toggle = ($toggle) ? 0 : 1; - ($toggle) ? DrawScene() : DrawColorScene(); - $app->sync(); - }, - } ); diff --git a/test/OpenGL/test2.sdlpl b/test/OpenGL/test2.sdlpl deleted file mode 100644 index 9461793..0000000 --- a/test/OpenGL/test2.sdlpl +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env perl -# -# test2.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 SDL; -use SDL::App; -use SDL::Surface; -use SDL::Event; -use SDL::OpenGL; - -package SDL::OpenGL::Cube; -use SDL; -use SDL::OpenGL; - -my $vertex_array = pack "d24", - -0.5,-0.5,-0.5, 0.5,-0.5,-0.5, 0.5,0.5,-0.5, -0.5,0.5,-0.5, # back - -0.5,-0.5,0.5, 0.5,-0.5,0.5, 0.5,0.5,0.5, -0.5,0.5,0.5 ; # front - -my $indicies = pack "C24", - 4,5,6,7, # front - 1,2,6,5, # right - 0,1,5,4, # bottom - 0,3,2,1, # back - 0,4,7,3, # left - 2,3,7,6; # top - -sub new { - my $proto = shift; - my $class = ref($proto) || $proto; - my $self = {}; - bless $self,$class; - $self; -} - -sub draw { - my ($self) = @_; - $self->color(); - glEnableClientState(SDL::GL_VERTEX_ARRAY()); - glVertexPointer(3,SDL::GL_DOUBLE(),0,$vertex_array); - glDrawElements(SDL::GL_QUADS(), 24, SDL::GL_UNSIGNED_BYTE(), $indicies); -} - -sub color { - my ($self,@colors) = @_; - - if (@colors) { - $$self{colored} = 1; - die "SDL::OpenGL::Cube::color requires 24 floating point color values\n" - unless (scalar(@colors) == 24); - $$self{-colors} = pack "f24",@colors; - } - - if ($$self{colored}) { - glEnableClientState(SDL::GL_COLOR_ARRAY); - glColorPointer(3,SDL::GL_FLOAT,0,$$self{-colors}); - } else { - glDisableClientState(SDL::GL_COLOR_ARRAY); - } -} - - -1; - - -$delay = $ARGV[0] || 5; - -print "Starting $0\n"; - -my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl =>1; - -print "Initializing OpenGL settings\n"; -printf "%-24s%s\n", "GL_RED_SIZE ", $app->attribute( SDL::SDL_GL_RED_SIZE() ); -printf "%-24s%s\n", "GL_GREEN_SIZE ", $app->attribute( SDL::SDL_GL_GREEN_SIZE()); -printf "%-24s%s\n", "GL_BLUE_SIZE ", $app->attribute( SDL::SDL_GL_BLUE_SIZE() ); -printf "%-24s%s\n", "GL_DEPTH_SIZE ", $app->attribute( SDL::SDL_GL_DEPTH_SIZE() ); -printf "%-24s%s\n", "GL_DOUBLEBUFFER ", $app->attribute( SDL::SDL_GL_DOUBLEBUFFER() ); - -$angle = 0; -$other = 0; - -my @colors = ( - 1.0,1.0,0.0, 1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0, #back - 0.4,0.4,0.4, 0.3,0.3,0.3, 0.2,0.2,0.2, 0.1,0.1,0.1 ); #front - - -$cube = new SDL::OpenGL::Cube; -$cube->color(@colors); - -$white = new SDL::OpenGL::Cube; - -$toggle = 1; - -glEnable(GL_CULL_FACE); -glFrontFace(GL_CCW); -glCullFace(GL_BACK); - -sub DrawScene { - - glClear( SDL::GL_DEPTH_BUFFER_BIT() - | SDL::GL_COLOR_BUFFER_BIT()); - - glLoadIdentity(); - - glTranslate(0,0,-6.0); - glRotate($angle % 360,1,1,0); - glRotate($other % 360,0,1,1); - - $angle += 6; - $other += $angle % 5; - - glColor(1,1,1); - $toggle ? $cube->draw() : $white->draw(); - - $app->sync(); - -} - -sub InitView { - glViewport(0,0,800,600); - - glMatrixMode(SDL::GL_PROJECTION()); - glLoadIdentity(); - - if ( @_ ) { - gluPerspective(45.0,4/3,0.1,100.0); - } else { - glFrustum(-0.1,0.1,-0.075,0.075,0.3,100.0); - } - - glMatrixMode(SDL::GL_MODELVIEW()); - glLoadIdentity(); -} - -InitView(); - -DrawScene(); -$app->sync(); - -my $event = new SDL::Event; - -for (;;) { - for (0 .. 5) { - $event->pump(); - $event->poll(); - exit(0) if ($event->type() == SDL::SDL_QUIT()); - if (SDL::GetKeyState(SDL::SDLK_SPACE()) == SDL::SDL_PRESSED()) { - $toggle = 0; - } else { - $toggle = 1; - } - $app->delay($delay); - } - DrawScene(); -} - diff --git a/test/OpenGL/test3.sdlpl b/test/OpenGL/test3.sdlpl deleted file mode 100644 index 8922167..0000000 --- a/test/OpenGL/test3.sdlpl +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env perl -# -# test3.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 SDL; -use SDL::App; -use SDL::Surface; -use SDL::Event; -use SDL::OpenGL; - -my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1; - -my @points = ( [-4.0, -4.0, 0.0 ], - [-2.0, 4.0, 0.0 ], - [ 2.0, -4.0, 0.0 ], - [ 4.0, 4.0, 0.0 ] ); - -my $ctrlpoints = pack "d12", map { @$_ } @points; - -sub init { - - glViewport(0,0,800,600); - glMatrixMode(GL_PROJECTION()); - glLoadIdentity(); - - glFrustum (-0.1,0.1,-0.075,0.075,0.3,100.0 ); - - glMatrixMode(GL_MODELVIEW()); - glLoadIdentity(); - - glTranslate(0,0,-30); - - glClearColor(0.0, 0.0, 0.0, 0.0); - glShadeModel(GL_FLAT()); - glMap1(GL_MAP1_VERTEX_3(), 0.0, 1.0, 3, 4, $ctrlpoints); - glEnable(GL_MAP1_VERTEX_3()); -} - -sub display { - glClear(GL_COLOR_BUFFER_BIT); - glColor(1.0,1.0,1.0); - glBegin(GL_LINE_STRIP); - for my $i ( 0 .. 30 ) { - glEvalCoord1($i/30); - } - glEnd(); - - glPointSize(5); - glColor(1.0,1.0,0); - glBegin(GL_POINTS); - for my $i ( 0 .. 3 ) { - glVertex( @{$points[$i]} ); - } - glEnd(); - $app->sync(); -} - -init(); -display(); - -$app->loop({ SDL_QUIT() => sub { exit(); } }); - diff --git a/test/OpenGL/test4.sdlpl b/test/OpenGL/test4.sdlpl deleted file mode 100644 index 53af368..0000000 --- a/test/OpenGL/test4.sdlpl +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env perl -# -# test4.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 SDL; -use SDL::App; -use SDL::Event; -use SDL::OpenGL; - -our $toggle = 0; -my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1; - -my @points = ( [-1.5, -1.5, 4.0 ], [-0.5, -1.5, 2.0 ], - [-0.5, -1.5, -1.0 ], [ 1.5, -1.5, 2.0 ], - [-1.5, -0.5, 1.0 ], [-0.5, -0.5, 3.0 ], - [ 0.5, -0.5, 0.0 ], [ 1.5, -0.5, -1.0 ], - [-1.5, 0.5, 4.0 ], [-0.5, 0.5, 0.0 ], - [ 0.5, 0.5, 3.0 ], [ 1.5, 0.5, 4.0 ], - [-1.5, 1.5, -2.0 ], [-0.5, 1.5, -2.0 ], - [ 0.5, 1.5, 0.0 ], [ 1.5, 1.5, -1.0 ], - ); - -my $ctrlpoints = pack "d48", map { @$_ } @points; - -sub init { - - glViewport(0,0,800,600); - glMatrixMode(GL_PROJECTION()); - glLoadIdentity(); - - glFrustum (-0.1,0.1,-0.075,0.075,0.3,100.0 ); - - glMatrixMode(GL_MODELVIEW()); - glLoadIdentity(); - - glTranslate(0,0,-15); - - glClearColor(0.0, 0.0, 0.0, 0.0); - glMap2(GL_MAP2_VERTEX_3(), 0, 1, 3, 4, 0, 1, 12, 4, $ctrlpoints); - glEnable(GL_MAP2_VERTEX_3()); - glMapGrid2(20,0,1,20,0,1); - glEnable(GL_DEPTH_TEST); - glShadeModel(GL_SMOOTH()); -} - -sub initlight { - - glEnable(GL_LIGHTING()); - glEnable(GL_LIGHT0()); - - glLight(GL_LIGHT0(),GL_AMBIENT(),0.2,0.2,0.2,1.0); - glLight(GL_LIGHT0(),GL_POSITION(), 0.0,0.0,2.0,1.0); - - glMaterial(GL_FRONT(), GL_DIFFUSE(),0.6,0.6,0.6,1.0); - glMaterial(GL_FRONT(), GL_SPECULAR(), 1.0, 1.0, 1.0, 1.0); - glMaterial(GL_FRONT(), GL_SHININESS(), 50.0); - -} - -my ($a1,$a2) = (89,305); - -sub display { - glClear(GL_COLOR_BUFFER_BIT() | GL_DEPTH_BUFFER_BIT()); - glColor(1.0,1.0,1.0); - glPushMatrix(); - glRotate($a1 % 360, 0.0, 1.0, 1.0); - glRotate($a2 % 360, 1.0, 1.0, 0.0); - if ($toggle) { - glEvalMesh2(GL_FILL,0,20,0,20); - } else { - glBegin(GL_LINE_STRIP); - for my $j ( 0 .. 8 ) { - for my $i ( 0 .. 30 ) { - glEvalCoord2($i/30,$j/8); - } - for my $i ( 0 .. 30 ) { - glEvalCoord2($j/8,$i/30); - } - } - glEnd(); - } - glPopMatrix(); - $app->sync(); -} - -print STDERR <loop ({ - SDL_QUIT() => sub { exit(); }, - SDL_KEYDOWN() => sub { - my ($event) = @_; - if ( $event->key_sym() == SDLK_f ) { - $app->fullscreen(); - display(); - } elsif ( $event->key_sym() == SDLK_t ) { - $toggle = $toggle ? 0 : 1; - display(); - } elsif ( $event->key_sym() == SDLK_q ) { - exit(); - } else { - $a1 += 33; $a2 += 5; - display(); - } - }, -}); - diff --git a/test/OpenGL/test5.sdlpl b/test/OpenGL/test5.sdlpl deleted file mode 100644 index 1960b4e..0000000 --- a/test/OpenGL/test5.sdlpl +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env perl -# -# test5.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 SDL; -use SDL::App; -use SDL::Event; -use SDL::OpenGL; - -my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1; -my $toggle; - -my $knots = pack "f8", 0,0,0,0,1,1,1,1; -my $edgePts = pack "f10", 0,0,1,0,1,1,0,1,0,0; -my $curvePts = pack "f8", 0.25,0.5,0.25,0.75,0.75,0.75,0.75,0.5; -my $curveKnots = pack "f8", 0,0,0,0,1,1,1,1; -my $pwlPts = pack "f8", 0.75, 0.5, 0.5, 0.25, 0.25, 0.5, 0, 0; - -sub init { - glViewport(0,0,800,600); - glMatrixMode(GL_PROJECTION()); - glLoadIdentity(); - glFrustum (-0.1,0.1,-0.075,0.075,0.3,100.0 ); - glMatrixMode(GL_MODELVIEW()); - glLoadIdentity(); - glTranslate(0,0,-15); - glClearColor(0.0, 0.0, 0.0, 0.0); - glShadeModel(GL_SMOOTH()); -} - -sub initlight { - glEnable(GL_LIGHTING()); - glEnable(GL_LIGHT0()); - glEnable(GL_DEPTH_TEST()); - glEnable(GL_AUTO_NORMAL()); - glEnable(GL_NORMALIZE()); - glLight(GL_LIGHT0(),GL_AMBIENT(),0.3,0.3,0.3,1.0); - glLight(GL_LIGHT0(),GL_POSITION(), 1.0,0.0,2.0,1.0); - glMaterial(GL_FRONT(), GL_DIFFUSE(),0.6,0.6,0.6,1.0); - glMaterial(GL_FRONT(), GL_SPECULAR(), 1.0, 1.0, 1.0, 1.0); - glMaterial(GL_FRONT(), GL_SHININESS(), 40.0); -} - -my ($a,$b) = (0,90); - -my $ctrldata; -sub initpts { - my @points; - for my $u ( 0 .. 3 ) { - for my $v ( 0 .. 3 ) { - push @points, 2.0 * ($u - 1.5); - push @points, 2.0 * ($v - 1.5); - if (( $u == 1 || $u == 2 ) && ( $v == 1 || $v == 2 )) { - push @points, 3.0; - } else { - push @points, -3.0; - } - } - } - $ctrldata = pack "f48", @points; -} - -sub display { - glClear(GL_COLOR_BUFFER_BIT() | GL_DEPTH_BUFFER_BIT()); - glPushMatrix(); - glRotate($a%360,0,1,0); - glRotate($b%360,-1,0,0); - glScale(0.5,0.5,0.5); - my $nurb = gluNewNurbsRenderer(); - gluNurbsProperty($nurb,GLU_CULLING,GL_TRUE); - gluBeginSurface($nurb); - gluNurbsSurface($nurb, 8, $knots, 8, $knots, - 4*3, 3, $ctrldata, - 4, 4, GL_MAP2_VERTEX_3); - if ($toggle) { - gluBeginTrim($nurb); - gluPwlCurve($nurb,5,$edgePts,2,GLU_MAP1_TRIM_2); - gluEndTrim($nurb); - gluBeginTrim($nurb); - gluNurbsCurve($nurb,8,$curveKnots, 2, $curvePts, 4, GLU_MAP1_TRIM_2); - gluPwlCurve($nurb,3,$pwlPts,2,GLU_MAP1_TRIM_2); - gluEndTrim($nurb); - } - - gluEndSurface($nurb); - - glPopMatrix(); - $app->sync(); -} - -init(); -initlight(); -initpts(); -display(); - -print STDERR <loop ({ - SDL_QUIT() => sub { exit(); }, - SDL_KEYDOWN() => sub { - my ($event) = @_; - if ( $event->key_sym() == SDLK_f ) { - $app->fullscreen(); - display(); - } elsif ( $event->key_sym() == SDLK_t ) { - $toggle = $toggle ? 0 : 1; - display(); - } elsif ( $event->key_sym() == SDLK_q ) { - exit(); - } else { - if ($event->key_sym() == SDLK_LEFT()) { - $a -= 10; - } elsif ($event->key_sym() == SDLK_RIGHT()) { - $a += 10; - } elsif ($event->key_sym() == SDLK_UP()) { - $b += 10; - } elsif ($event->key_sym() == SDLK_DOWN()) { - $b -= 10; - } - display(); - } - }, -}); - diff --git a/test/checkkeys.sdlpl b/test/checkkeys.sdlpl deleted file mode 100644 index 0d5fe8f..0000000 --- a/test/checkkeys.sdlpl +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env perl -# -# checkkeys.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 SDL; -use SDL::App; -use SDL::Event; - -my %options; - -$options{-flags} = SDL_SWSURFACE; -$options{-title} = $0; -$options{-width} ||= 640; -$options{-height} ||= 480; -$options{-depth} ||= $options{-bpp} || 24; - -my $app = new SDL::App %options; - -# SDL::EventState(SDL_KEYUP,SDL_DISABLE); - -sub print_modifiers -{ - $mod = SDL::GetModState(); - - print " modifiers:", - ($mod & KMOD_LSHIFT) ? " LSHIFT" : "", - ($mod & KMOD_RSHIFT) ? " RSHIFT" : "", - ($mod & KMOD_LCTRL) ? " LCTRL" : "", - ($mod & KMOD_RCTRL) ? " RCTRL" : "", - ($mod & KMOD_LALT) ? " LALT" : "", - ($mod & KMOD_RALT) ? " RALT" : "", - ($mod & KMOD_LMETA) ? " LMETA" : "", - ($mod & KMOD_RMETA) ? " RMETA" : "", - ($mod & KMOD_CAPS) ? " CAPS" : "", - ($mod & KMOD_NUM) ? " NUM" : "", - ($mod & KMOD_MODE) ? " MODE" : "", - "\n" ; -} - -sub print_key -{ - my ($e) = @_; - - print "pressed " if (SDL::KeyEventState($e) == SDL_PRESSED); - print "released " if ( SDL::KeyEventState($e) == SDL_RELEASED); - - my $sym = SDL::KeyEventSym($e); - - if ($sym) { - print SDL::GetKeyName($sym); - } else { - printf "Unknown Key (scancode = %d) ", SDL::KeyEventScanCode($e); - } - -} - -my $event = new SDL::Event; - -my $done = 0; - -$process_keys = sub { - print_key($_[0]); - print_modifiers(); - }; - -my %events = ( - SDL_KEYUP() => $process_keys, - SDL_KEYDOWN() => $process_keys, - SDL_QUIT() => sub { $done = 1; }, -); - -while (!$done && $event->wait()) -{ - if ( $events{$event->type()}) { - &{$events{$event->type()}}($$event); - } -}; - diff --git a/test/graywin.sdlpl b/test/graywin.sdlpl deleted file mode 100644 index e1902dd..0000000 --- a/test/graywin.sdlpl +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env perl -# -# graywin.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 SDL; -use SDL::App; -use SDL::Rect; -use SDL::Event; -use SDL::Color; - -my %options; -$options{-flags} = SDL::SWSURFACE; -$options{-title} = $0; -$options{-width} ||= 640; -$options{-height} ||= 480; -$options{-depth} ||= $options{-bpp} || 8; - -my $app = new SDL::App %options; - -sub DrawBox { - my ($x,$y) = @_; - - my ($w, $h) = ( int(rand(640)), int(rand(480)) ); - - my $rect = new SDL::Rect -width => $w, -height => $h, - -x => ($x - int($w/2)), -y => ($y - int($h/2)); - - my $color = new SDL::Color -r => rand(256), -g => rand(256), -b => rand(256); - - $app->fill($rect,$color); - $app->update($rect); -}; - -$app->loop( { - SDL_MOUSEBUTTONDOWN() => sub { - my ($event) = @_; - DrawBox($event->button_x(),$event->button_y()); - }, - SDL_KEYDOWN() => sub { - my ($event) = @_; - $app->warp($options{-width}/2,$options{-height}/2) - if ($event->key_sym() == SDLK_SPACE); - $app->fullscreen() - if ($event->key_sym() == SDLK_f); - exit(0) if ($event->key_sym() == SDLK_ESCAPE); - }, - SDL_QUIT() => sub { exit(0); } -} ); - - diff --git a/test/loopwave.sdlpl b/test/loopwave.sdlpl deleted file mode 100644 index 39cd8b0..0000000 --- a/test/loopwave.sdlpl +++ /dev/null @@ -1,6494 +0,0 @@ -#!/usr/bin/env perl -# -# loopwave.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 SDL; -use MIME::Base64 qw(decode_base64); - -die "Could not initialize SDL: ", SDL::GetError() - if ( 0 > SDL::Init(SDL_INIT_AUDIO())); - -my $filename = '/tmp/sample.wav'; - -my ($wav_spec,$wav_buffer,$wav_len,$wav_pos) = (0,0,0,0); - -my $done = 0; - -$fillerup = sub { - my ($data,$len) = @_; - - $wav_ptr = $wav_buffer + $wav_pos; - $wav_remainder = $wav_len - $wav_pos; - - while ( $wav_remainder <= $len ) { - SDL::MixAudio($data,$wav_ptr,$wav_remainder,SDL_MIX_MAXVOLUME); - $data += $wav_remainder; - $len -= $wav_remainder; - $wav_ptr = $wav_buffer; - $wav_remainder = $wav_len; - $wav_pos = 0; - } - SDL::MixAudio($data,$wav_ptr,$len,SDL_MIX_MAXVOLUME); - $wav_pos += $len; -}; - -$poked = sub { - $done = 1; -}; - -$SIG{HUP} = $poked; -$SIG{INT} = $poked; -$SIG{QUIT} = $poked; -$SIG{TERM} = $poked; - -$spec = SDL::NewAudioSpec(44100,AUDIO_S16,2,4096); - -write_wav(); - -$wave = SDL::LoadWAV($filename,$spec); - -($wav_spec,$wav_buffer,$wav_len) = @$wave; - -die "Could not load wav file $filename, ", SDL::GetError(), "\n" unless ( $wav_len ); - -die "Could not open audio ", SDL::GetError() - if (0 > SDL::OpenAudio($wav_spec,$fillerup)); - -SDL::PauseAudio(0); - -print "Using audio driver: ", SDL::AudioDriverName(), "\n"; - -while (10 > $done && ( SDL::GetAudioStatus() == SDL_AUDIO_PLAYING())) { - SDL::Delay(1000); - ++$done; -} - -sub write_wav { - $wav = decode_base64 < $filename" or die "Failed to write to $!"; - print FP $wav; - close FP; -} diff --git a/test/testcolor.sdlpl b/test/testcolor.sdlpl deleted file mode 100644 index e7b644c..0000000 --- a/test/testcolor.sdlpl +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env perl -# -# testcolor.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 SDL; -use SDL::App; -use SDL::Event; - -use vars qw/ $app /; - -print STDERR < 320, -height => 240, -depth => 8; - -my %colors = ( - red => (new SDL::Color -r => 255, -g => 0, -b => 0 ), - green => (new SDL::Color -r => 0, -g => 255, -b => 0), - blue => (new SDL::Color -r => 0, -g => 0, -b => 255), - yellow => (new SDL::Color -r => 255, -g => 255, -b => 0), - purple => (new SDL::Color -r => 255, -g => 0, -b => 255), - white => (new SDL::Color -r => 255, -g => 255, -b => 255) -); - - -$x = 0; $y = 0; -$rect = new SDL::Rect -x => $x, -y => $y, - -w => $app->width / scalar(keys %colors), -h => $app->height(); - -print "Sorted colors:\n"; - -for ( sort keys %colors ) { - print "$_ " . join (",",$colors{$_}->r(), $colors{$_}->g(), - $colors{$_}->b()) . "\n"; -} - -for ( sort keys %colors ) { - $rect->x($x); - $x += $rect->width(); - $app->fill($rect,$colors{$_}); -} - -$app->sync(); - -$last = new SDL::Color -r => 128, -g => 128, -b => 128; - -$app->sync(); -$app->loop( { - SDL_QUIT() => sub { exit(0); }, - SDL_KEYDOWN() => sub { $app->fullscreen(); }, - SDL_MOUSEBUTTONDOWN() => sub { - my $e = shift; - if ($e->button == 3) { - $last = $app->pixel($e->button_x(),$e->button_y()); - print STDERR "X: ", $e->button_x(), " Y: ", $e->button_y(), - " R: ", $last->r(), " G: ", $last->g(), - " B: ", $last->b(), "\n"; - } else { - $app->pixel($e->button_x(),$e->button_y(),$last); - } - }, -}); diff --git a/test/testfonttool.sdlpl b/test/testfonttool.sdlpl deleted file mode 100644 index 1bebd9a..0000000 --- a/test/testfonttool.sdlpl +++ /dev/null @@ -1,2168 +0,0 @@ -#!/usr/bin/env perl -# -# testfonttool.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 SDL; -use SDL::App; -use SDL::Event; -use SDL::Tool::Font; -use SDL::Color; -use MIME::Base64 qw(decode_base64); - -my (%options,$app,$mode); - -$options{-flags} = SDL_SWSURFACE; -$options{-title} = $0; -$options{-width} ||= 800; -$options{-height} ||= 600; -$options{-depth} ||= $options{-bpp} || 32; - -$app = new SDL::App %options; - -my %ttfonts = ( - 'ttf1.ttf' => 0, - 'ttf2.ttf' => 0, -); - -my %sfonts = ( - 'sfont1.png' => 0, - 'sfont2.png' => 0, -); - -my @fonts; - -write_fonts(); - -for ( reverse keys %ttfonts ) { - for $mode ( qw/ -normal -bold -italic -underline / ) { - if (-e "/tmp/$_") { - print STDERR "Loading $_\n"; - $ttfonts{"$_$mode"} = new SDL::Tool::Font - $mode => 1, - -ttfont => "/tmp/$_", - -size => 20, - -fg => $SDL::Color::black, - -bg => $SDL::Color::black; - push @fonts, $ttfonts{"$_$mode"}; - } - } -} - -%ttfonts = reverse %ttfonts; - -for ( reverse keys %sfonts) { - if (-e "/tmp/$_") { - print STDERR "Loading $_\n"; - $sfonts{$_} = new SDL::Tool::Font -sfont => "/tmp/$_"; - push @fonts, $sfonts{$_}; - } -} - -%sfonts = reverse %sfonts; - -sub DrawFonts { - $app->fill(0,$SDL::Color::white); - my ($x,$y) = @_; - for my $font ( @fonts) { - $font->print($app,$x,$y,"SDLperl font test. ", - "This is " . ($ttfonts{$font} || $sfonts{$font})); - $y += 40; - } - $app->flip(); -} - -DrawFonts(10,10); - -$app->loop( { - SDL_KEYDOWN() => sub { - my ($event) = @_; - $app->warp($options{-width}/2,$options{-height}/2) if ($event->key_sym() == SDLK_SPACE); - $app->fullscreen() if ($event->key_sym() == SDLK_f); - exit(0) if ($event->key_sym() == SDLK_ESCAPE); - }, - SDL_QUIT() => sub { exit(0); } -} ); - - -sub write_fonts() { - my $ttf1 = decode_base64 < /tmp/ttf1.ttf" or die "Failed to write font $!\n"; - print FP $ttf2; - close FP; - open FP, "> /tmp/ttf2.ttf" or die "Failed to write font $!\n"; - print FP $ttf2; - close FP; - open FP, "> /tmp/sfont1.png" or die "Failed to write font $!\n"; - print FP $sfont1; - close FP; - open FP, "> /tmp/sfont2.png" or die "Failed to write font $!\n"; - print FP $sfont2; - close FP; -} diff --git a/test/testgfxprim.sdlpl b/test/testgfxprim.sdlpl deleted file mode 100644 index 859ebbb..0000000 --- a/test/testgfxprim.sdlpl +++ /dev/null @@ -1,275 +0,0 @@ -#!/usr/bin/env perl -# -# testgfxprim.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 Getopt::Long; -use Data::Dumper; -use MIME::Base64 qw(decode_base64); - -use SDL; -use SDL::App; -use SDL::Event; -use SDL::Surface; -use SDL::Color; -use SDL::Rect; -use SDL::Config; - -use vars qw/ $app $app_rect $background $event $sprite $sprite_rect $videoflags /; - -die "Your system is not configured with SDL_gfx support!\n" - unless (SDL::Config->has('SDL_gfx')); - -## User tweakable settings (via cmd-line) -my %settings = ( - 'numsprites' => 10, - 'screen_width' => 640, - 'screen_height' => 480, - 'video_bpp' => 8, - 'fast' => 0, - 'hw' => 0, - 'fullscreen' => 0, - 'bpp' => undef, -); - -## Process commandline arguments - -sub get_cmd_args -{ - GetOptions( "width:i" => \$settings{screen_width}, - "height:i" => \$settings{screen_height}, - "bpp:i" => \$settings{bpp}, - "fast!" => \$settings{fast}, - "hw!" => \$settings{hw}, - "fullscreen!" => \$settings{fullscreen}, - "numsprites=i" => \$settings{numsprites}, - ); -} - -## Initialize application options - -sub set_app_args -{ - $settings{bpp} ||= 8; # default to 8 bits per pix - - $videoflags |= SDL_HWACCEL if $settings{hw}; - $videoflags |= SDL_FULLSCREEN if $settings{fullscreen}; -} - -## Setup - -sub init_game_context -{ - $app = new SDL::App - -width => $settings{screen_width}, - -height=> $settings{screen_height}, - -title => "testsprite", - -flags => $videoflags; - - $app_rect= new SDL::Rect - -height => $settings{screen_height}, - -width => $settings{screen_width}; - - $background = $SDL::Color::black; - - $sprite = new SDL::Surface -name =>"/tmp/icon.bmp"; - - # Set transparent pixel as the pixel at (0,0) - $sprite->set_color_key(SDL_SRCCOLORKEY,$sprite->pixel(0,0)); - - print STDERR "Got past that\n"; - - $sprite->display_format(); - - $sprite_rect = new SDL::Rect - -x => 0, - -y => 0, - -width => $sprite->width, - -height=> $sprite->height; - - $event = new SDL::Event(); -} - -## Prints diagnostics - -sub instruments -{ - if ( ($app->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - printf("Screen is in video memory\n"); - } else { - printf("Screen is in system memory\n"); - } - - if ( ($app->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { - printf("Screen has double-buffering enabled\n"); - } - - if ( ($sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - printf("Sprite is in video memory\n"); - } else { - printf("Sprite is in system memory\n"); - } - - # Run a sample blit to trigger blit (if posssible) - # acceleration before the check just after - $sprite->blit(0,$app,0); - - if ( ($sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) { - printf("Sprite blit uses hardware acceleration\n"); - } - if ( ($sprite->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - printf("Sprite blit uses RLE acceleration\n"); - } - -} - -sub game_loop -{ - my $surf = $$app; - my $surfWidth=$settings{screen_width}; - my $surfHeight=$settings{screen_height}; - my $surfMidWidth=$settings{screen_width}>>1;; - my $surfMidHeight=$settings{screen_height}>>1; - - $app->fill($app_rect, $background); - - # TODO: polygon's, GFX*Color - - #lines - - SDL::GFXHlineRGBA($surf, - 0,$surfWidth, - $surfMidHeight, - 255,255,255,255); - - SDL::GFXVlineRGBA($surf, - $surfMidWidth, - 0,$surfHeight, - 255,255,255,255); - - # rectangles - - SDL::GFXRectangleRGBA($surf, - 0,0, - $surfMidWidth/2,$surfMidHeight/2, - 255,0,0,255); - - SDL::GFXBoxRGBA($surf, - 0,0, - $surfMidWidth/3,$surfMidHeight/3, - 0,255,0,255); - - SDL::GFXLineRGBA($surf, - 0,0, - $surfWidth,$surfHeight, - 0,255,255,255); - - SDL::GFXAalineRGBA($surf, $surfWidth,0,0,$surfHeight,0,255,255,255); - - # circles - - SDL::GFXCircleRGBA( $surf,$surfMidWidth*.3, $surfMidHeight, - $surfMidWidth*.3, 255,255,0,255); - - - SDL::GFXAacircleRGBA($surf, $surfMidWidth*.6, $surfMidHeight, - $surfMidWidth*.3, 255,255,0,255); - - - SDL::GFXFilledCircleRGBA($surf,$surfMidWidth*.3, $surfMidHeight, - $surfMidWidth*.25,255,255,0,255); - - - # ellipses - - SDL::GFXEllipseRGBA($surf,$surfWidth- $surfMidWidth*.3, $surfMidHeight, - $surfMidWidth*.3,$surfMidHeight*.15, 255,255,0,255); - - SDL::GFXAaellipseRGBA($surf,$surfWidth- $surfMidWidth*.6, $surfMidHeight, - $surfMidWidth*.3,$surfMidHeight*.15,255,255,0,255); - - SDL::GFXFilledEllipseRGBA($surf,$surfWidth- $surfMidWidth*.3, $surfMidHeight, - $surfMidWidth*.25,$surfMidHeight*.10,255,255,0,255); - - # pie slices - SDL::GFXFilledPieRGBA($surf,$surfMidWidth,$surfMidHeight, $surfMidWidth*.1, - 0,90,0,0,255,255); - - SDL::GFXFilledPieRGBA($surf,$surfMidWidth,$surfMidHeight, $surfMidWidth*.1, - 180,270,0,0,255,255); - - # polygons - - # TBD... - - - # characters & strings - - SDL::GFXCharacterRGBA($surf,$surfMidWidth,0, - "!",255,255,255,255); - - SDL::GFXStringRGBA($surf,$surfMidWidth,$surfHeight*.75, - "SDL_Perl Primitive Test.",255,255,255,255); - - $app->flip(); - - $app->loop({ - SDL_QUIT() => sub { exit(0); }, - SDL_KEYDOWN() => sub { exit(0) if (SDL::GetKeyState(SDLK_ESCAPE)); }, - }); -} - -## Main program loop - -write_bmp(); -get_cmd_args(); -set_app_args(); -init_game_context(); -instruments(); -game_loop(); - -sub write_bmp { - my $bmp = decode_base64 < /tmp/icon.bmp"; - print FP $bmp; - close FP; -} - diff --git a/test/testgfxroto.sdlpl b/test/testgfxroto.sdlpl deleted file mode 100644 index 1aaf518..0000000 --- a/test/testgfxroto.sdlpl +++ /dev/null @@ -1,396 +0,0 @@ -#!/usr/bin/env perl -# -# testgfxroto.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 Getopt::Long; -use Data::Dumper; -use MIME::Base64 qw(decode_base64); - -use SDL; -use SDL::App; -use SDL::Event; -use SDL::Surface; -use SDL::Color; -use SDL::Rect; -use SDL::Config; - -use vars qw/ $app $app_rect $background $event $sprite $sprite_rect $videoflags /; - -## Test for SDL_gfx support - -die "Your system was not configured with SDL_gfx support!\n" - unless SDL::Config->has('SDL_gfx'); - - -## User tweakable settings (via cmd-line) -my %settings = ( - 'numsprites' => 10, - 'screen_width' => 200, - 'screen_height' => 200, - 'video_bpp' => 8, - 'fast' => 0, - 'hw' => 0, - 'flip' => 1, - 'fullscreen' => 0, - 'bpp' => undef, -); - -## Process commandline arguments - -sub get_cmd_args -{ - GetOptions("width:i" => \$settings{screen_width}, - "height:i" => \$settings{screen_height}, - "bpp:i" => \$settings{bpp}, - "fast!" => \$settings{fast}, - "hw!" => \$settings{hw}, - "flip!" => \$settings{flip}, - "fullscreen!" => \$settings{fullscreen}, - "numsprites=i" => \$settings{numsprites}, - ); -} - -## Initialize application options - -sub set_app_args -{ - $settings{bpp} ||= 8; # default to 8 bits per pix - - $videoflags |= SDL_HWACCEL if $settings{hw}; - $videoflags |= SDL_DOUBLEBUF if $settings{flip}; - $videoflags |= SDL_FULLSCREEN if $settings{fullscreen}; -} - -## Setup - -sub init_game_context -{ - $app = new SDL::App ( - -width => $settings{screen_width}, - -height=> $settings{screen_height}, - -title => "testsprite", - -flags => $videoflags, - ); - - $app_rect= new SDL::Rect( - -height => $settings{screen_height}, - -width => $settings{screen_width}, - ); - - $background = $SDL::Color::black; - - $sprite = new SDL::Surface -name =>"/tmp/spiral.png"; - - $sprite->display_format(); - - SDL::SetColorKey($$sprite, SDL_SRCCOLORKEY, SDL::SurfacePixel($$sprite,0,0)); - - $sprite_rect = new SDL::Rect(-x => 0, - -y => 0, - -width => $sprite->width, - -height=> $sprite->height, - ); - - $event = new SDL::Event(); -} - -## Prints diagnostics - -sub instruments -{ - if ( ($app->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - printf("Screen is in video memory\n"); - } else { - printf("Screen is in system memory\n"); - } - - if ( ($app->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { - printf("Screen has double-buffering enabled\n"); - } - - if ( ($sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - printf("Sprite is in video memory\n"); - } else { - printf("Sprite is in system memory\n"); - } - - # Run a sample blit to trigger blit (if posssible) - # acceleration before the check just after - put_sprite_rotated($sprite, - $settings{screen_width}/2, $settings{screen_height}/2, - 0,0,0); - - if ( ($sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) { - printf("Sprite blit uses hardware acceleration\n"); - } - if ( ($sprite->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - printf("Sprite blit uses RLE acceleration\n"); - } - -} - - - - -# this can get silly in terms of -# memory usage, and maybe key lookup. -# it would be better to 'tie' the hash -# to an object which can -# better manage memory usage. - -my %rotate_cache =(); - -sub generate_sprite_rotated -{ - my ($surface, $angle, $zoom, $smooth) = @_; - - $angle %= 360; - my $key = "$surface$angle$zoom$smooth"; - - if ( $rotate_cache{$key} ) - { - return $rotate_cache{$key}; - } - else - { - my $sur = SDL::GFXRotoZoom($surface, $angle, $zoom, $smooth); - - $rotate_cache{$key}= SDL::DisplayFormat($sur); - } - return $rotate_cache{$key}; -} - -sub put_sprite_rotated -{ - my ($surface, $x, $y, $angle, $zoom, $smooth) = @_; - - my $roto = generate_sprite_rotated($$surface, $angle, $zoom, $smooth); - - die "Failed to create rotozoom surface" unless $roto; - - my ($w,$h) = (SDL::SurfaceW($roto),SDL::SurfaceH($roto));; - - - my $dest_rect = new SDL::Rect - -x => $x - ($w/2), - -y => $y - ($h/2), - -width => $w, - -height => $h; - - - SDL::BlitSurface($roto, 0, $$app, $$dest_rect); -} - - -sub game_loop -{ - my $ox=$settings{screen_width}>>1;; - my $oy=$settings{screen_height}>>1; - my $sectors = 12; - my $angleDelta = 360/$sectors;; - my $zoom = 1; - my $smooth =1; - - my $angle =0; - my $radius =128; - - FRAME: - while (1) - { - # process event queue - $event->pump; - if ($event->poll) - { - my $etype=$event->type(); - - # handle quit events - last FRAME if ($etype == SDL_QUIT() ); - last FRAME if (SDL::GetKeyState(SDLK_ESCAPE)); - } - - # needed for HW surface locking - #$app->lock() if $app->lockp(); - #$app->unlock(); - $app->flip if $settings{flip}; - - ################################################ - # do some drawing - - $app->fill($app_rect, $background); - - $angle += 16; - - put_sprite_rotated($sprite, - $settings{screen_width}/2, $settings{screen_height}/2, - $angle, $zoom, $smooth); - - } - print "Cache entries: " . scalar(keys %rotate_cache) . "\n"; -} - - - -## Main program loop - -write_spiral(); -get_cmd_args(); -set_app_args(); -init_game_context(); -instruments(); -game_loop(); -exit(0); - -sub write_spiral { - my $png = decode_base64 < /tmp/spiral.png"; - print FP $png; - close FP; -} diff --git a/test/testgraphictool.sdlpl b/test/testgraphictool.sdlpl deleted file mode 100644 index e7b8ccc..0000000 --- a/test/testgraphictool.sdlpl +++ /dev/null @@ -1,216 +0,0 @@ -#!/usr/bin/env perl -# -# testgraphictool.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; -use MIME::Base64 qw(decode_base64); -use SDL; -use SDL::Surface; -use SDL::App; -use SDL::Tool::Graphic; - -my $app = new SDL::App(-title => "Graphic Tool Test", - -width => 640, - -height => 480, - -depth => 16, - -fullscreen => 0); -my $app_rect = new SDL::Rect( -x=>0, - -y=>0, - -width=>$app->width, - -height=>$app->height); - -write_spiral(); -my $sprite = new SDL::Surface(-name => "/tmp/spiral.png"); -$sprite->display_format(); - -#Test Zoom -my $graphicTool = new SDL::Tool::Graphic(); -$graphicTool->zoom($sprite, .5, .5, 1); - -my $sprite_rect = new SDL::Rect( -x=>0, - -y=>0, - -width=>$sprite->width, - -height=>$sprite->height); -$sprite->blit($sprite_rect, $app, $sprite_rect); -$app->flip(); -sleep 4; -$app->fill($app_rect, $SDL::Color::black); - - -#Test Rotate -$graphicTool->rotoZoom($sprite, 90, 1, 1); - -$sprite_rect = new SDL::Rect( -x=>0, - -y=>0, - -width=>$sprite->width, - -height=>$sprite->height); -$sprite->blit($sprite_rect, $app, $sprite_rect); -$app->flip(); -sleep 4; - -+print "GrayScaling\n"; -+$app->fill($app_rect, $SDL::Color::black); - -#Test GrayScale -$graphicTool->grayScale($sprite); - -$sprite->blit($sprite_rect, $app, $sprite_rect); -$app->flip(); -sleep 4; - - - -sub write_spiral { - my $png = decode_base64 < /tmp/spiral.png"; - print FP $png; - close FP; -} diff --git a/test/testjoystick.sdlpl b/test/testjoystick.sdlpl deleted file mode 100644 index b7167e1..0000000 --- a/test/testjoystick.sdlpl +++ /dev/null @@ -1,240 +0,0 @@ -#!/usr/bin/env perl -# -# testjoystick.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 SDL; -use SDL::App; -use SDL::Rect; -use SDL::Event; - - -sub WatchJoystick($){ - (my $joystick) = @_; - my $screenWidth = 640; - my $screenHeight = 480; - - my $app = new SDL::App(-title => "Joystick Test", - -width => $screenWidth, - -height => $screenHeight, - -depth=> 16 ); - #Print information about the joystick we are watching - my $name = SDL::JoystickName(SDL::JoystickIndex($joystick)); - print "Watching joystick ".SDL::JoystickIndex($joystick). - ": (".($name ? $name : "Unknown Joystick" ).")\n"; - print "Joystick has ".SDL::JoystickNumAxes($joystick)." axes, ". - SDL::JoystickNumHats($joystick)." hats, ". - SDL::JoystickNumBalls($joystick)." balls, and ". - SDL::JoystickNumButtons($joystick)." buttons\n"; - - my $event = new SDL::Event; - my $done = 0; - my $colorWhite = new SDL::Color(-r=>255, -g=>255, -b=>255); - my $colorBlack = new SDL::Color(); - my @axisRect = (); - my $numAxes=SDL::JoystickNumAxes($joystick); - - - while(!$done) - { - while($event->poll()) - { - if($event->type() eq SDL::JOYAXISMOTION()) - { - print "Joystick ".SDL::JoyAxisEventWhich($$event). - " axis ".SDL::JoyAxisEventAxis($$event). - " value: ".SDL::JoyAxisEventValue($$event)."\n"; - } - elsif($event->type() eq SDL::JOYHATMOTION()) - { - print "Joystick ".SDL::JoyHatEventWhich($$event). - " hat ".SDL::JoyHatEventHat($$event); - if(SDL::JoyHatEventValue($$event) == SDL::HAT_CENTERED() ) - { - print " centered"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_UP() ) { - print " up"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_RIGHT() ) { - print " right"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_DOWN() ) { - print " down"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_LEFT()) { - print " left"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_RIGHTUP() ) { - print " right & up"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_RIGHTDOWN() ) { - print " right & down"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_LEFTDOWN() ) { - print " left & down"; - } elsif(SDL::JoyHatEventValue($$event) == SDL::HAT_LEFTUP()) { - print " left & up"; - } - print "\n"; - } elsif($event->type() eq SDL::JOYBALLMOTION()){ - print "Joystick ".SDL::JoyBallEventWhich($$event). - " ball ".SDL::JoyBallEventBall($$event). - " delta: (".SDL::JoyBallEventXrel($$event). - ",".SDL::JoyBallEventYrel($$event)."\n"; - } elsif($event->type() eq SDL::JOYBUTTONDOWN()){ - print "Joystick ".SDL::JoyButtonEventWhich($$event). - " button ".SDL::JoyButtonEventButton($$event)." down\n"; - } elsif($event->type() eq SDL::JOYBUTTONUP()){ - print "Joystick ".SDL::JoyButtonEventWhich($$event). - " button ".SDL::JoyButtonEventButton($$event)." up\n"; - } elsif($event->type() eq SDL_QUIT() or - ($event->type() eq SDL_KEYDOWN() and - $event->key_sym() == SDLK_ESCAPE)){ - $done = 1; - } - - - - #Update visual joystick state - for(my $i =0; $i < SDL::JoystickNumButtons($joystick); $i++) - { - my $rect = new SDL::Rect( -width => 32, - -height => 32, - -x => $i*34, - -y => $screenHeight-34); - if(SDL::JoystickGetButton($joystick, $i) eq SDL::PRESSED()) - { - $app->fill($rect, $colorWhite); - } else { - $app->fill($rect, $colorBlack); - } - $app->update($rect); - } - - - for (my $i = 0; $i < $numAxes; $i+=1) - { - #Remove previous axis box - if($axisRect[$i]){ - $app->fill($axisRect[$i], $colorBlack); - $app->update($axisRect[$i]); - } - # Draw the axis - my $ox = SDL::JoystickGetAxis($joystick, $i); - my $x= abs ($ox/256); - if( $x < 0) { - $x=0; - } elsif ( $x > ($screenWidth-16) ){ - $x = $screenWidth-16; - } - - - if ($ox < 0) - { - $axisRect[$i] = new SDL::Rect( -width=> $x, - -height=> 32, - -x => ($screenWidth/2) - $x, - -y => $i*34 - ); - } - else - { - $axisRect[$i] = new SDL::Rect( -width=> $x, - -height=> 32, - -x => $screenWidth/2 , - -y => $i*34 - ); - } - - - $app->fill($axisRect[$i], $colorWhite); - $app->update($axisRect[$i]); - } - } - } - } - -die "Could not initialize SDL: ", SDL::GetError() - if( 0 > SDL::Init(SDL_INIT_JOYSTICK())); - -printf "There are %d joysticks attched\n", SDL::NumJoysticks(); -for(my $i = 0; $i < SDL::NumJoysticks(); $i++){ - my $name = SDL::JoystickName($i); - print "Joystick ".$i.": ".($name ? $name : "Unknown Joystick")."\n"; -} - -if ( $ARGV[0] ne undef){ - my $joystick = SDL::JoystickOpen($ARGV[0]); - if(!$joystick){ - print "Couldn't open joystick ".$ARGV[0].": ".SDL::GetError()."\n"; - } else { - WatchJoystick($joystick); - SDL::JoystickClose($joystick); - } - SDL::QuitSubSystem(SDL_INIT_JOYSTICK()); -} - - -exit; - -sub draw_axis_method_2() -{ -} - -__DATA__ -sub draw_axis_method_1() -{ - for (my $i = 0; $i < ($numAxes/2); $i+=2) - { - #Remove previous axis box - if($axisRect[$i]){ - $app->fill($axisRect[$i], $colorBlack); - $app->update($axisRect[$i]); - } - # Draw the X/Y axis - my $x = SDL::JoystickGetAxis($joystick, $i)+32768; - $x *= $screenWidth; - $x /= 65535; - if( $x < 0) { - $x=0; - } elsif ( $x > ($screenWidth-16) ){ - $x = $screenWidth-16; - } - my $y = SDL::JoystickGetAxis($joystick, $i+1)+32768; - $y *= $screenHeight; - $y /= 65535; - if( $y < 0) { - $y=0; - } elsif ( $y > ($screenHeight-16) ){ - $y = $screenHeight-16; - } - $axisRect[$i] = new SDL::Rect( -width=> 16, - -height=> 16, - -x => $x, - -y => $y); - $app->fill($axisRect[$i], $colorWhite); - $app->update($axisRect[$i]); - } - } - -} diff --git a/test/testmenu.sdlpl b/test/testmenu.sdlpl deleted file mode 100644 index 67aaaf8..0000000 --- a/test/testmenu.sdlpl +++ /dev/null @@ -1,994 +0,0 @@ -#!/usr/bin/env perl -# -# testmenu.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 SDL; -use SDL::App; -use SDL::Surface; -use SDL::Rect; -use SDL::Event; -use MIME::Base64 qw/ decode_base64 /; - -write_pngs(); - -my $menu = new SDL::Surface -name => '/tmp/menu.png'; - -my $app = new SDL::App -w => $menu->width(), -h => $menu->height(), -resizeable => 1; - -my $hilight = new SDL::Surface -name => '/tmp/highlight.png'; - -my %menu = ( - 'start' => [ 115, 30, 160, 40 ], - 'help' => [ 120, 100, 120, 40 ], - 'giveup' => [ 120, 230, 120, 40 ], - 'spawnserver' => [ 115, 170, 165, 40 ], - 'credits' => [ 115, 285, 160, 40 ], -); - -my $needblit; -sub drawMenu { - my ($a,$dx,$dy,$no,$hi,%m) = @_; - for (keys %m) { - my ($x,$y,$w,$h) = @{$m{$_}}; - next unless $dx >= $x && $dx <= $x+$w - && $dy >= $y && $dy <= $y+$h; - unless ($needblit) { - my $rect = new SDL::Rect -w => $w, -h => $h, - -x => $x, -y => $y; - $hi->blit($rect,$a,$rect); - $needblit = 1; - } - return $_; - } - $no->blit(NULL,$a,NULL) if $needblit; - $needblit = 0; - return 0; -} - -sub help { - print STDERR < sub { - my ($e) = @_; - drawMenu($app, - $e->motion_x(), - $e->motion_y(), - $menu, - $hilight, - %menu); - }, - SDL_MOUSEBUTTONUP() => sub { - my ($e) = @_; - my $routine = drawMenu($app, - $e->motion_x(), - $e->motion_y(), - $menu, - $hilight, - %menu); - &{$routine} if ($routine); - }, - SDL_QUIT() => sub { exit(0); }, - SDL_KEYDOWN() => sub { - my ($e) = @_; - exit(0) if ($e->key_sym() == SDLK_ESCAPE); - }, -); - -$menu->blit(NULL,$app,NULL); -$app->sync(); -$app->loop(\%events); - -sub write_pngs { - $png1 = decode_base64 < /tmp/highlight.png" or die "$!\n"; - print FP $png1; - close FP; - open FP, "> /tmp/menu.png" or die "$!\n"; - print FP $png2; - close FP; -} diff --git a/test/testsprite.sdlpl b/test/testsprite.sdlpl deleted file mode 100644 index 69e0af6..0000000 --- a/test/testsprite.sdlpl +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/env perl -# -# testsprite.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 Data::Dumper; -use MIME::Base64 qw(decode_base64); - -use SDL; -use SDL::App; -use SDL::Event; -use SDL::Surface; -use SDL::Color; -use SDL::Rect; - -use vars qw/ $app $app_rect $background $event $sprite $sprite_rect $videoflags /; - -## User tweakable settings (via cmd-line) -my %settings = ( - 'numsprites' => 75, - 'screen_width' => 640, - 'screen_height' => 480, - 'video_bpp' => 8, - 'fast' => 0, - 'hw' => 0, - 'flip' => 1, - 'fullscreen' => 0, - 'bpp' => undef, -); - -## Initialize application options - -sub set_app_args -{ - $settings{bpp} ||= 8; # default to 8 bits per pix - $videoflags |= SDL_HWACCEL if $settings{hw}; - $videoflags |= SDL_DOUBLEBUF if $settings{flip}; - $videoflags |= SDL_FULLSCREEN if $settings{fullscreen}; -} - -## Setup - -our $bmp; - -sub init_game_context -{ - write_bmp(); - $app = new SDL::App ( - -width => $settings{screen_width}, - -height=> $settings{screen_height}, - -title => "testsprite", - -icon => "/tmp/icon.bmp", - -flags => $videoflags, - ); - - $app_rect= new SDL::Rect( - -height => $settings{screen_height}, - -width => $settings{screen_width}, - ); - - $background = $SDL::Color::black; - - $sprite = new SDL::Surface(-name => '/tmp/icon.bmp'); - - # Set transparent pixel as the pixel at (0,0) - - $sprite->display_format(); - - $sprite->set_color_key(SDL_SRCCOLORKEY,$sprite->pixel(0,0)); # sets the transparent color to that at (0,0) - - - $sprite_rect = new SDL::Rect(-x => 0, - -y => 0, - -width => $sprite->width, - -height=> $sprite->height, - ); - - $event = new SDL::Event(); -} - -## Prints diagnostics - -sub instruments -{ - if ( ($app->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - printf("Screen is in video memory\n"); - } else { - printf("Screen is in system memory\n"); - } - - if ( ($app->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { - printf("Screen has double-buffering enabled\n"); - } - - if ( ($sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - printf("Sprite is in video memory\n"); - } else { - printf("Sprite is in system memory\n"); - } - - # Run a sample blit to trigger blit (if posssible) - # acceleration before the check just after - put_sprite(0,0); - - if ( ($sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) { - printf("Sprite blit uses hardware acceleration\n"); - } - if ( ($sprite->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - printf("Sprite blit uses RLE acceleration\n"); - } - -} - - - - -sub put_sprite -{ - my ($x,$y) = @_; - - my $dest_rect = new SDL::Rect(-x => $x, - -y => $y, - -width => $sprite->width, - -height => $sprite->height, - ); - $sprite->blit($sprite_rect, $app, $dest_rect); -} - - - -sub game_loop -{ - my $x=0; - my $y=$settings{screen_height}>>1; - my $i=0; - - while (1) - { - # process event queue - $event->pump; - $event->poll; - my $etype=$event->type; - - # handle user events - last if ($etype eq SDL_QUIT ); - last if (SDL::GetKeyState(SDLK_ESCAPE)); - - #$app->lock() if $app->lockp(); - - # page flip - - # __draw gfx - - $app->fill($app_rect, $background); - - foreach (1..$settings{numsprites}) - { - put_sprite( $_*8, $y + (sin(($i+$_)*0.2)*($settings{screen_height}/3))); - } - $i+=30; - - # __graw gfx end - #$app->unlock(); - $app->flip if $settings{flip}; - } -} - -## Main program loop - -set_app_args(); -init_game_context(); -instruments(); -game_loop(); -system 'rm /tmp/icon.bmp'; -exit(0); - - -sub write_bmp { - $bmp = decode_base64 < /tmp/icon.bmp"; - print FP $bmp; - close FP; -} - diff --git a/test/testtimer.sdlpl b/test/testtimer.sdlpl deleted file mode 100644 index efe3a20..0000000 --- a/test/testtimer.sdlpl +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env perl -# -# testtimer.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 SDL; -use SDL::Timer; - -die "usage: $0\n" if in($ARGV[0], qw/ -? -h --help/); - -SDL::Init(SDL_INIT_EVERYTHING()); - -print STDERR "Waiting 4 seconds\n"; -SDL::Delay(4000); - -$a = new SDL::Timer sub { my $timer = shift; - print STDERR "Timer A: $$timer{-times} runs\n" }, - -delay => 1000, - -times => 10; - -$b = new SDL::Timer sub { print STDERR "Timer B: ", ++$i,"\n" }, -delay => 3000; - -$c = new SDL::Timer sub { print STDERR "Timer C: restarting Timer A\n"; $a->run(1000,10) }, - -delay => 19000, - -times => 1; - -SDL::Delay(30000); - -print STDERR "Cleaning up...\n"; -SDL::Delay(300); - -SDL::Quit(); -