SDL_Surface *
video_display_format ( surface )
SDL_Surface *surface
- CODE:
+ PREINIT:
char* CLASS = "SDL::Surface";
+ CODE:
RETVAL = SDL_DisplayFormat(surface);
OUTPUT:
RETVAL
SDL_Surface *
video_display_format_alpha ( surface )
SDL_Surface *surface
- CODE:
+ PREINIT:
char* CLASS = "SDL::Surface";
+ CODE:
RETVAL = SDL_DisplayFormatAlpha(surface);
OUTPUT:
RETVAL
+
+int
+video_set_color_key ( surface, flag, key )
+ SDL_Surface *surface
+ Uint32 flag
+ SDL_Color *key
+ CODE:
+ Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
+ RETVAL = SDL_SetColorKey(surface,flag,pixel);
+ OUTPUT:
+ RETVAL
+
+int
+video_set_alpha ( surface, flag, alpha )
+ SDL_Surface *surface
+ Uint32 flag
+ Uint8 alpha
+ CODE:
+ RETVAL = SDL_SetAlpha(surface,flag,alpha);
+ OUTPUT:
+ RETVAL
+
+
use Test::More;
use SDL::Rect;
-plan ( tests => 26);
+plan ( tests => 28);
use_ok( 'SDL::Video' );
convert_surface
display_format
display_format_alpha
-
+ set_color_key
+ set_alpha
/;
can_ok ('SDL::Video', @done);
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');
+is( SDL::Video::set_color_key($display, SDL_SRCCOLORKEY, SDL::Color->new( 0, 10, 0 ) ),
+ 0, '[set_color_key] Returns 0 on success'
+ ) ;
+
+is( SDL::Video::set_alpha($display, SDL_SRCALPHA, 100 ),
+ 0, '[set_alpha] Returns 0 on success'
+ ) ;
+
+
+
my @left = qw/
get_gamma_ramp
get_RGB
get_RGBA
load_BMP
save_BMP
- set_color_key
- set_alpha
set_clip_rect
get_clip_rect
blit_surface