Mare Overlay an object with new and DESTROY. Bootstrapper made to
Kartik Thakore [Wed, 21 Oct 2009 22:57:26 +0000 (18:57 -0400)]
lib/SDL/Overlay.pm [new file with mode: 0644]
src/Core/objects/Overlay.xs
t/core_video.t
typemap

diff --git a/lib/SDL/Overlay.pm b/lib/SDL/Overlay.pm
new file mode 100644 (file)
index 0000000..4da6f86
--- /dev/null
@@ -0,0 +1,12 @@
+package SDL::Overlay;
+use strict;
+use warnings;
+require Exporter;
+require DynaLoader;
+our @ISA = qw(Exporter DynaLoader);
+bootstrap SDL::Overlay;
+
+1;
+
+__END__
+
index 0793345..e13c1bf 100644 (file)
@@ -22,7 +22,26 @@ typedef struct{
   Uint8 **pixels;
   Uint32 hw_overlay:1;
 } SDL_Overlay;
-}
+
 
 =cut
 
+SDL_Overlay *
+overlay_new(CLASS, width, height, Uint32 format, display)
+       char* CLASS
+       int width
+       int height
+       Uint32 format
+       SDL_Surface *display;
+       CODE:
+               RETVAL = SDL_CreateYUVOverlay(width, height, format, display);
+       OUTPUT:
+               RETVAL
+
+void
+overlay_DESTROY(overlay)
+       SDL_Overlay *overlay
+       CODE:
+               SDL_FreeYUVOverlay(overlay);
+
+
index 5f2b5b9..51aa077 100644 (file)
@@ -52,10 +52,8 @@ can_ok ('SDL::Video', qw/
        GL_set_attribute
        GL_swap_buffers
        GL_attr
-       create_YUV_overlay
        lock_YUV_overlay
        unlock_YUV_overlay
        display_YUV_overlay
-       free_YUV_overlay
        /);
 
diff --git a/typemap b/typemap
index c0e4469..146a6ae 100644 (file)
--- a/typemap
+++ b/typemap
@@ -43,7 +43,7 @@ UDPpacket **          T_PTR
 IPaddress*             T_PTR
 SDLNet_GenericSocket   T_PTR
 TTF_Font *             O_OBJECT
-SDL_Overlay *          T_PTR
+SDL_Overlay *          O_OBJECT        
 SMPEG_Info *           T_PTR
 SMPEG *                        T_PTR
 SMPEGstatus            T_IV