From: Kartik Thakore Date: Mon, 2 Nov 2009 01:25:05 +0000 (-0500) Subject: Added SDL::Video::display_format* functions. 50% of SDL::Video. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=40be9eb74307c7c33db48245ed2354b19f1db876;p=sdlgit%2FSDL_perl.git Added SDL::Video::display_format* functions. 50% of SDL::Video. --- diff --git a/src/Core/Video.xs b/src/Core/Video.xs index 6b3b8be..8612aae 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -292,3 +292,23 @@ video_convert_surface( src, fmt, flags) RETVAL = SDL_ConvertSurface(src, fmt, flags); OUTPUT: RETVAL + + +SDL_Surface * +video_display_format ( surface ) + SDL_Surface *surface + CODE: + char* CLASS = "SDL::Surface"; + RETVAL = SDL_DisplayFormat(surface); + OUTPUT: + RETVAL + +SDL_Surface * +video_display_format_alpha ( surface ) + SDL_Surface *surface + CODE: + char* CLASS = "SDL::Surface"; + RETVAL = SDL_DisplayFormatAlpha(surface); + OUTPUT: + RETVAL + diff --git a/t/core_video.t b/t/core_video.t index 4897dd8..0637ec1 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 => 24); +plan ( tests => 26); use_ok( 'SDL::Video' ); @@ -33,6 +33,8 @@ my @done = unlock_surface lock_surface convert_surface + display_format + display_format_alpha /; @@ -123,13 +125,13 @@ is( SDL::Video::map_RGBA($hwdisplay->format, 10, 10 ,10, 10) > 0, 1, '[map_RGBA] isa_ok(SDL::Video::convert_surface( $display , $hwdisplay->format, SDL_SRCALPHA), 'SDL::Surface', '[convert_surface] Checking if we get a surface ref back'); +isa_ok(SDL::Video::display_format( $display ), 'SDL::Surface', '[display_format] Returns a SDL::Surface'); +isa_ok(SDL::Video::display_format_alpha( $display ), 'SDL::Surface', '[display_format_alpha] Returns a SDL::Surface'); my @left = qw/ get_gamma_ramp get_RGB get_RGBA - display_format - display_format_alpha load_BMP save_BMP set_color_key