From: Kartik Thakore Date: Sun, 23 Aug 2009 01:10:49 +0000 (-0400) Subject: Added types for GLU and Tels Faster color function X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45f7368964390b1b6e48edfba3dfa4b0d6cc74ce;p=sdlgit%2FSDL_perl.git Added types for GLU and Tels Faster color function --- diff --git a/META.yml b/META.yml index ee2ead4..94ce854 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SDL_Perl -version: v2.2.1 +version: v2.2.1.8 author: - 'David J. Goehrig ' abstract: Simple DirectMedia Layer for Perl diff --git a/lib/SDL/Color.pm b/lib/SDL/Color.pm index 287a3ca..2c426e4 100644 --- a/lib/SDL/Color.pm +++ b/lib/SDL/Color.pm @@ -38,8 +38,10 @@ use SDL; sub new { my $proto = shift; my $class = ref($proto) || $proto; - my $self; + return bless \SDL::NewColor(@_), $class if (@_ == 3); + my $self; + my (%options) = @_; verify (%options, qw/ -color -surface -pixel -r -g -b /) if $SDL::DEBUG; @@ -82,6 +84,11 @@ sub b { SDL::ColorB($$self,@_); } +sub rgb { + my $self = shift; + SDL::ColorRGB($$self,@_); +} + sub pixel { croak "SDL::Color::pixel requires an SDL::Surface" unless !$SDL::DEBUG || $_[1]->isa("SDL::Surface"); diff --git a/src/OpenGL.xs b/src/OpenGL.xs index 47f22c2..ad8dee2 100644 --- a/src/OpenGL.xs +++ b/src/OpenGL.xs @@ -2734,5 +2734,60 @@ gluTessVertex ( tessobj, coords, vd ) #endif +GLUquadric * +gluNewQuadric () + CODE: + RETVAL = gluNewQuadric (); + OUTPUT: + RETVAL + +void +gluDeleteQuadric (quad) + GLUquadric *quad + +void +gluQuadricNormals ( quad, normal ) + GLUquadric *quad + GLenum normal + +void +gluQuadricTexture ( quad, texture ) + GLUquadric *quad + GLboolean texture + +void +gluCylinder ( quad, base, top, height, slices, stacks ) + GLUquadric *quad + GLdouble base + GLdouble top + GLdouble height + GLint slices + GLint stacks + +void +gluDisk ( quad, inner, outer, slices, loops ) + GLUquadric *quad + GLdouble inner + GLdouble outer + GLint slices + GLint loops + +void +gluPartialDisk ( quad, inner, outer, slices, loops, start, sweep ) + GLUquadric *quad + GLdouble inner + GLdouble outer + GLint slices + GLint loops + GLdouble start + GLdouble sweep + +void +gluSphere ( quad, radius, slices, stacks ) + GLUquadric *quad + GLdouble radius + GLint slices + GLint stacks + #endif diff --git a/src/SDL.xs b/src/SDL.xs index f6660fa..3ebfcf8 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -1323,6 +1323,21 @@ ColorB ( color, ... ) OUTPUT: RETVAL + +void +ColorRGB ( color, ... ) + SDL_Color *color + PPCODE: + if (items > 1 ) { + color->r = SvIV(ST(1)); + color->g = SvIV(ST(2)); + color->b = SvIV(ST(3)); + } + mXPUSHi( color->r ); + mXPUSHi( color->g ); + mXPUSHi( color->b ); + XSRETURN(3); + void FreeColor ( color ) SDL_Color *color diff --git a/typemap b/typemap index 392972f..572311b 100644 --- a/typemap +++ b/typemap @@ -52,6 +52,8 @@ GLbitfield T_IV GLenum T_IV ConsoleInformation * T_PTR GLboolean T_U_CHAR +GLUquadric * T_PTR +GLdouble T_NV GLUnurbsObj * T_PTR GLUtesselator * T_PTR GLuint T_UV