[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Per Pixel Alpha
For whoever is curious, the bug in 1.7 that is avoided by specifying the bit-depth doesn't necessarily have anything to do with what the bit depth is - Ian's posted sample was using a 32-bit surface on my machine. The problem was that the flags you passed were simply ignored when bit depth wasn't specified. I think there was another seperate problem that if you specifically requested 24-bit and SRCALPHA you wouldn't get alpha-blending either.
I think 1.8 changes things so that the flags are no longer ignored when using a default bit-depth solving the first issue - also I think it throws an exception if SRCALPHA is requested for a 24-bit (whether explicitly asked for or not) thereby addressing the second issue.
On Feb 8, 2008 10:45 AM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
It is a commonly held misconception that any surface created with a
SRCALPHA automatically has 32 bit pixels. This is wrong. The pixels size
defaults to that of the display. To ensure per-pixel alpha always
provide the pixel size argument. I have had to patch several packages
because of this oversight.
--
Lenard Lindstrom
<len-l@xxxxxxxxx>