[SDL] SDL_DisplayFormatAlpha() and 16-bit surfaces
Tim Allen
screwtape at froup.com
Mon Aug 5 22:54:01 PDT 2002
On Tuesday, August 6, 2002, at 02:20 , Kylotan wrote:
> Chris Thielen wrote:
>> and this then becomes the format of the surface that is returned by
>> SDL_DisplayFormatAlpha(). Is there any way to get
>> SDL_DisplayFormatAlpha() to return a 16bpp image, or are all images
>> with alpha 32-bit images?
>
> I've never heard of any format with less than 32 bits have more than 1
> bit for alpha, and even that 1 bit was an obscure thing on some 16-bit
> modes. After all, if you want alpha as well as the colour, there has to
> be somewhere to store it. So I expect the 32 bit restriction is the only
> practical option if you want 8 bits of alpha, and for there to be any
> chance of acceleration on most targets.
It would be nice if there were some way of taking a surface with
colour-key alpha, and transforming it to a surface in the display format
with colour-key alpha, rather than a surface in the display format with
8-bits of alpha which are either 0 or 255 for any given pixel - I'm sure
colour-key alpha, especially with RLE encoding, would be faster than
doing proper alpha-blending. If you're blitting to a 16-bit surface, I'm
sure doing the 32->16 bit conversion is wasteful, too.
Screwtape.
More information about the SDL
mailing list