From 9346cc6bf06dec0a3c4d215f20f67df880027b34 Mon Sep 17 00:00:00 2001 From: Kartik Thakore Date: Wed, 21 Oct 2009 21:26:30 -0400 Subject: [PATCH] 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 --- Build.PL | 15 +++++++++++---- src/Core/objects/Overlay.xs | 2 +- src/SDL.xs | 17 ----------------- t/core_overlay.t | 18 ++++++++++++++++++ 4 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 t/core_overlay.t diff --git a/Build.PL b/Build.PL index a4a35b94..3bd4e706 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 e13c1bfc..fb6fe27d 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 630e3274..13d20c68 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 00000000..2b0660b3 --- /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'); + + +