implemented normalize
[sdlgit/SDL_perl.git] / t / sdlgamerect.t
index 560fcdd..d3725e5 100644 (file)
@@ -1,5 +1,8 @@
 use Test::More tests => 87;
 use strict;
+use SDL;
+use SDL::App;
+use SDL::Color;
 
 use_ok( 'SDL::Game::Rect' ); 
   
@@ -17,8 +20,20 @@ can_ok ('SDL::Game::Rect', qw/
        centery
         /);
 
+my $app = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init => SDL_INIT_VIDEO);
+
 my $rect = SDL::Game::Rect->new();
 
+       
+       my $blue = SDL::Color->new(
+               -r => 0x00,
+               -g => 0x00,
+               -b => 0xff,
+       );
+       $app->fill($rect,$blue);
+       $app->update($rect);
+       $app->sync;
+       sleep(1);
 isa_ok ($rect, 'SDL::Game::Rect','new went ok');
 
 foreach my $attr (qw(x y top    left  width   height 
@@ -38,6 +53,12 @@ is ($rect->y, 132, 'y and top point to the same place');
 is ($rect->y(123), 123, 'y is now 123');
 is ($rect->top, 123, 'top is an alias to y');
 
+       $app->fill($rect,$blue);
+       $app->update($rect);
+       $app->sync;
+       sleep(1);
+
+
 is ($rect->w(54), 54, 'w is now 54');
 is ($rect->width, 54, 'w and width point to the same place');
 is ($rect->width(45), 45, 'w is now 45');