X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcore_video.t;h=93c5b99800c336b13d54624f4f6be90371ea7a78;hb=991130f6069f6d7bb700f608130d85bdbee87608;hp=445492c6866c173ced0d3698af1f0313d0e62d6f;hpb=2d2bb7560a4cbc81f6507f0cfbfbad442976787f;p=sdlgit%2FSDL_perl.git diff --git a/t/core_video.t b/t/core_video.t index 445492c..93c5b99 100644 --- a/t/core_video.t +++ b/t/core_video.t @@ -9,7 +9,7 @@ use Data::Dumper; use Test::More; use SDL::Rect; -plan ( tests => 19 ); +plan ( tests => 23); use_ok( 'SDL::Video' ); @@ -30,6 +30,8 @@ my @done = set_gamma_ramp map_RGB map_RGBA + unlock_surface + lock_surface /; can_ok ('SDL::Video', @done); @@ -40,7 +42,7 @@ SDL::init(SDL_INIT_VIDEO); my $display = SDL::Video::set_video_mode(640,480,32, SDL_SWSURFACE ); if(!$display){ - plan skip_all => 'Couldn\'t set video mode: '. SDL::geterror(); + plan skip_all => 'Couldn\'t set video mode: '. SDL::get_error(); } #diag('Testing SDL::Video'); @@ -92,7 +94,7 @@ for(my $i=0;$i<256;$i++){ my $hwdisplay = SDL::Video::set_video_mode(640,480,8, SDL_HWSURFACE ); if(!$hwdisplay){ - plan skip_all => 'Couldn\'t set video mode: '. SDL::geterror(); + plan skip_all => 'Couldn\'t set video mode: '. SDL::get_error(); } $value = SDL::Video::set_colors($hwdisplay, 0); @@ -110,18 +112,17 @@ $value = SDL::Video::set_palette($hwdisplay, SDL_LOGPAL|SDL_PHYSPAL, 0, @b_w_col is( $value , 1, '[set_palette] returns 1' ); +$value = SDL::Video::lock_surface($hwdisplay); pass '[lock_surface] ran returned: '.$value; + +SDL::Video::unlock_surface($hwdisplay); pass '[unlock_surface] ran'; is( SDL::Video::map_RGB($hwdisplay->format, 10, 10 ,10) > 0, 1, '[map_RGB] maps correctly to 8-bit surface'); is( SDL::Video::map_RGBA($hwdisplay->format, 10, 10 ,10, 10) > 0, 1, '[map_RGBA] maps correctly to 8-bit surface'); my @left = qw/ get_gamma_ramp - map_RGBA get_RGB get_RGBA - create_RGB_surface_from - lock_surface - unlock_surface convert_surface display_format display_format_alpha