From: Kartik Thakore Date: Mon, 26 Oct 2009 15:17:31 +0000 (-0400) Subject: Added SDL::Video::flip and test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19f3ee7bb3a37eb86e32da3ac9def56b729ef979;p=sdlgit%2FSDL_perl.git Added SDL::Video::flip and test --- diff --git a/src/Core/Video.xs b/src/Core/Video.xs index b6b8fa3..6e318e7 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -128,3 +128,11 @@ video_update_rects ( surface, ... ) safefree(rects); +int +video_flip ( surface ) + SDL_Surface *surface + CODE: + RETVAL = SDL_Flip(surface); + OUTPUT: + RETVAL + diff --git a/t/core_video.t b/t/core_video.t index ec81d97..4f03b98 100644 --- a/t/core_video.t +++ b/t/core_video.t @@ -8,7 +8,7 @@ use Data::Dumper; use Test::More; use SDL::Rect; -plan ( tests => 9 ); +plan ( tests => 10 ); use_ok( 'SDL::Video' ); @@ -21,6 +21,7 @@ can_ok ('SDL::Video', qw/ video_mode_ok update_rect update_rects + flip /); #testing get_video_surface @@ -55,6 +56,8 @@ SDL::Video::update_rect($display, 0, 0, 0, 0); #TODO: Write to surface and check inf pixel in that area got updated. SDL::Video::update_rects($display, SDL::Rect->new(0, 10, 20, 20)); +is( (SDL::Video::flip($display) == 0 || -1), 1, '[flip] returns 0 or -1' ); + pass "Are we still alive?"; =skip