X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fintergation1.t;h=9bbc49171ebadd04f149bb02d1375231d19e5124;hb=34a219f78b8882f5cee508265a87b4dfec27eb26;hp=1947864ae77334af531029486a3af6fc9c04db8a;hpb=2e2fd270bb6786a1bec87b18b0c648a5ceb0991e;p=sdlgit%2FSDL_perl.git diff --git a/t/intergation1.t b/t/intergation1.t index 1947864..9bbc491 100644 --- a/t/intergation1.t +++ b/t/intergation1.t @@ -60,32 +60,23 @@ can_ok ('SDL::App', qw/ sync attribute /); -my $app = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init => SDL_INIT_VIDEO); + my $app = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init => SDL_INIT_VIDEO); my $rect = SDL::Rect->new( 0,0, $app->w, $app->h); - my $blue = SDL::Color->new( - 0x00, - 0x00, - 0xff, - ); - - my $col = SDL::Color->new( - 0xf0, - 0x00, - 0x33, - ); + my $pixel_format = $app->format; + my $blue_pixel = SDL::MapRGB( $pixel_format, 0x00, 0x00, 0xff ); + my $col_pixel = SDL::MapRGB( $pixel_format, 0xf0, 0x00, 0x33 ); my $grect = SDL::Game::Rect->new(10, 10, 30, 35); foreach(0..80) { - $grect->x($_ ); $grect->centery($_ * 3); $grect->size( ($_ / 40) * $_, ($_/38) * $_ ); - $app->fill_rect($rect, $blue); - $app->fill_rect($grect, $col); + SDL::FillRect( $app, $rect, $blue_pixel ); + SDL::FillRect( $app, $grect, $col_pixel ); SDL::Surface::update_rect($app, 0, 0, 640, 480); SDL::Delay(10);