From: Kartik Thakore Date: Thu, 22 Oct 2009 01:26:30 +0000 (-0400) Subject: Added test for Overlay, updated Build.PL to add Overlay, Also made sure that right... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9346cc6bf06dec0a3c4d215f20f67df880027b34;p=sdlgit%2FSDL_perl.git Added test for Overlay, updated Build.PL to add Overlay, Also made sure that right libraries are called to speed up Building time. Removed Create Overlay and Free Overlay from SDL.xs --- diff --git a/Build.PL b/Build.PL index a4a35b9..3bd4e70 100644 --- a/Build.PL +++ b/Build.PL @@ -46,7 +46,7 @@ my %subsystems = from => 'src/Core/objects/Rect.xs', to => 'lib/SDL/Rect.xs', }, - libraries => [qw( SDL )], + libraries => [qw( SDL )], }, Color => { file => { @@ -60,14 +60,21 @@ my %subsystems = from => 'src/Core/objects/Surface.xs', to => 'lib/SDL/Surface.xs', }, - libraries => [qw( SDL SDL_image )], + libraries => [qw( SDL )], + }, + Overlay => { + file => { + from => 'src/Core/objects/Overlay.xs', + to => 'lib/SDL/Overlay.xs', + }, + libraries => [qw( SDL )], }, PixelFormat => { file => { from => 'src/Core/objects/PixelFormat.xs', to => 'lib/SDL/PixelFormat.xs', }, - libraries => [qw( SDL SDL_image )], + libraries => [qw( SDL )], }, TTF_Font => { file => { @@ -88,7 +95,7 @@ my %subsystems = from => 'src/SFont.xs', to => 'lib/SDL/SFont.xs', }, - libraries => [qw( SDL SDL_image SDL_ttf )], + libraries => [qw( SDL SDL_ttf )], }, ); diff --git a/src/Core/objects/Overlay.xs b/src/Core/objects/Overlay.xs index e13c1bf..fb6fe27 100644 --- a/src/Core/objects/Overlay.xs +++ b/src/Core/objects/Overlay.xs @@ -27,7 +27,7 @@ typedef struct{ =cut SDL_Overlay * -overlay_new(CLASS, width, height, Uint32 format, display) +overlay_new(CLASS, width, height, format, display) char* CLASS int width int height diff --git a/src/SDL.xs b/src/SDL.xs index 630e327..13d20c6 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -2787,17 +2787,6 @@ NetRead32 ( area ) #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 @@ -2821,12 +2810,6 @@ DisplayYUVOverlay ( overlay, dstrect ) OUTPUT: RETVAL -void -FreeYUVOverlay ( overlay ) - SDL_Overlay *overlay - CODE: - SDL_FreeYUVOverlay ( overlay ); - Uint32 OverlayFormat ( overlay, ... ) SDL_Overlay *overlay diff --git a/t/core_overlay.t b/t/core_overlay.t new file mode 100644 index 0000000..2b0660b --- /dev/null +++ b/t/core_overlay.t @@ -0,0 +1,18 @@ +#!perl +use strict; +use warnings; +use Test::More tests => 2; +use SDL; + +use_ok('SDL::Overlay'); + +SDL::Init(SDL_INIT_VIDEO); + +my $display = SDL::SetVideoMode(640,480,32,0); + +my $overlay = SDL::Overlay->new( 0, 0, 0, $display); + +isa_ok( $overlay, 'SDL::Overlay'); + + +