Added Some fixes
[sdlgit/SDL_perl.git] / src / SDL.xs
index ce0c2f0..f04ad58 100644 (file)
@@ -3,7 +3,7 @@
 // SDL Perl by David J. Goehrig <dgoehrig@cpan.org>
 //
 // Copyright (C) 2000,2001,2002,2003,2004 David J. Goehrig 
-//
+// Copyright (C) 2009 Kartik Thakore
 // This software is under the GNU Library General Public License (LGPL)
 // see the file COPYING for terms of use
 
@@ -527,6 +527,19 @@ FreeEvent ( e )
        CODE:
                safefree(e);
 
+
+int
+PeepEvents( e, numevents, action, mask)
+       SDL_Event *e
+       int numevents
+       SDL_eventaction action
+       Uint32 mask
+       CODE:
+               RETVAL = (int)SDL_PeepEvents( e, numevents, action, mask);
+       OUTPUT:
+               RETVAL
+
+
 int
 PollEvent ( e )
        SDL_Event *e
@@ -1208,6 +1221,20 @@ ColorB ( color, ... )
                RETVAL
 
 void
+ColorRGB ( color, ... )
+       SDL_Color *color
+       PPCODE:
+               if (items > 1 ) {
+                       color->r = SvIV(ST(1)); 
+                       color->g = SvIV(ST(2)); 
+                       color->b = SvIV(ST(3)); 
+               }
+               mXPUSHi( color->r );
+               mXPUSHi( color->g );
+               mXPUSHi( color->b );
+               XSRETURN(3);
+
+void
 FreeColor ( color )
        SDL_Color *color
        CODE:
@@ -2323,7 +2350,7 @@ JoyAxisEventValue ( e )
         OUTPUT:
                 RETVAL
 
-Uint8
+Sint16
 JoyButtonEventWhich ( e )
         SDL_Event *e
         CODE:
@@ -2467,7 +2494,7 @@ NetFreeIPaddress ( ip )
        CODE:
                safefree(ip);
 
-char*
+const char*
 NetResolveIP ( address )
        IPaddress *address
        CODE: