Added SDL::Video::display_format* functions. 50% of SDL::Video.
Kartik Thakore [Mon, 2 Nov 2009 01:25:05 +0000 (20:25 -0500)]
src/Core/Video.xs
t/core_video.t

index 6b3b8be..8612aae 100644 (file)
@@ -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
+
index 4897dd8..0637ec1 100644 (file)
@@ -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