X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcore_surface.t;h=3fe549e435b1c9623075360069e27ee23fdee381;hb=f7de3b2346513e78feab9aa9958ea5da1b18eb14;hp=bfdf4e894517627fedfe69d5e3ded63e59bad157;hpb=2e2fd270bb6786a1bec87b18b0c648a5ceb0991e;p=sdlgit%2FSDL_perl.git diff --git a/t/core_surface.t b/t/core_surface.t index bfdf4e8..3fe549e 100644 --- a/t/core_surface.t +++ b/t/core_surface.t @@ -15,6 +15,7 @@ use SDL::Surface; use SDL::App; use SDL::Rect; use SDL::Color; +use SDL::Video; use SDL::PixelFormat; use Test::More tests => 35; @@ -57,9 +58,7 @@ is( $pixel_format->alpha, 255, '255 alpha' ); my $pixel = SDL::MapRGB( $pixel_format, 255, 127, 0 ); is( $pixel, 32767, '32767 pixel' ); - -$surface->fill_rect( SDL::Rect->new( 0, 0, 32, 32 ), - SDL::Color->new( 200, 200, 200 ) ); +SDL::FillRect( $surface, SDL::Rect->new( 0, 0, 32, 32 ), $pixel ); ok( 1, 'Managed to fill_rect' ); my $small_rect = SDL::Rect->new( 0, 0, 64, 64 ); @@ -81,19 +80,23 @@ my $app = SDL::App->new( pass 'did this pass'; -my $image_format = $image->display; +my $image_format = SDL::DisplayFormat($image); isa_ok( $image_format, 'SDL::Surface' ); -my $image_format_alpha = $image->display_alpha; +my $image_format_alpha = SDL::DisplayFormatAlpha($image); isa_ok( $image_format_alpha, 'SDL::Surface' ); -my $rect = SDL::Rect->new( 0, 0, $app->w, $app->h ); +my $app_pixel_format = $app->format; -my $blue = SDL::Color->new( 0x00, 0x00, 0xff, ); +my $rect = SDL::Rect->new( 0, 0, $app->w, $app->h ); -$app->fill_rect( $rect, $blue ); +my $blue_pixel = SDL::MapRGB( $app_pixel_format, 0x00, 0x00, 0xff ); +SDL::FillRect( $app, $rect, $blue_pixel ); +SDL::Video::update_rect( $app, 0, 0, 0, 0 ); +SDL::Video::update_rects( $app, $small_rect ); diag( 'This is in surface : ' . SDL::Surface::get_pixels($app) ); pass 'did this pass'; +SDL::Delay(100);