Skip to content
Browse files

Mare Overlay an object with new and DESTROY. Bootstrapper made to

  • Loading branch information...
1 parent ae2d159 commit fcd68a9037ae3d5260f6cc2c96dec31ca54fc662 @kthakore kthakore committed Oct 21, 2009
Showing with 33 additions and 4 deletions.
  1. +12 −0 lib/SDL/Overlay.pm
  2. +20 −1 src/Core/objects/Overlay.xs
  3. +0 −2 t/core_video.t
  4. +1 −1 typemap
View
12 lib/SDL/Overlay.pm
@@ -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__
+
View
21 src/Core/objects/Overlay.xs
@@ -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);
+
+
View
2 t/core_video.t
@@ -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
/);
View
2 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

0 comments on commit fcd68a9

Please sign in to comment.
Something went wrong with that request. Please try again.