From: Leon Brocard Date: Sat, 10 Oct 2009 10:36:14 +0000 (+0100) Subject: Add display_format_alpha X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c0a5147b5c991adf442789ca94e6ee0119b7eb18;p=sdlgit%2FSDL_perl.git Add display_format_alpha --- diff --git a/lib/SDL/Surface.pm b/lib/SDL/Surface.pm index 897234c..4485824 100644 --- a/lib/SDL/Surface.pm +++ b/lib/SDL/Surface.pm @@ -239,6 +239,14 @@ sub display_format { $self; } +sub display_format_alpha { + my $self = shift; + my $tmp = SDL::DisplayFormatAlpha($$self); + SDL::FreeSurface ($$self); + $$self = $tmp; + $self; +} + sub rgb { my $self = shift; my $tmp = SDL::ConvertRGB($$self); @@ -525,6 +533,11 @@ C takes a value from 0x00 to 0xff. C converts the surface to the same format as the current screen. +=head2 display_format_alpha () + +C converts the surface to the same format as the +current screen, plus an alpha channel. + =head2 rgb () C converts the surface to a 24 bit rgb format regardless of the initial format.