For SRCALPHA Pygame 1.8 uses the video depth if present and raises an> <mailto:len-l@xxxxxxxxx>> wrote:
>
> What I have noticed is that omitting depth for a SRCAPLHA surface is
> common practice. It must work on most machines. But it is problematic
> with 1.8 when one's video depth is 24.
>
> I think you're right. svn pygame now gives you a 32-bit surface if the
> video depth is 24, you asked for SRCALPHA and didn't specify a
> bitdepth. It still throws an exception if people explicitly ask for a
> 24-bit surface with SRCALPHA though.
error if the depth is not 16 or 32. So, for 1.8, always provide a depth
when creating a SRCALPHA surface. The following was done on Windows,
where video information is available before display.set_mode() is called.
>>> from pygame import *
>>> init()
(6, 0)
>>> version.ver
'1.8.0rc3'
>>> Surface((10,10), SRCALPHA)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: no standard masks exist for given bitdepth with alpha
>>> display.Info().bitsize
24
>>> screen = display.set_mode((100, 50))
>>> display.Info().bitsize
24
>>> Surface((10,10),SRCALPHA)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: no standard masks exist for given bitdepth with alpha
>>> Surface((10,10),SRCALPHA,32)
<Surface(10x10x32 SW)>
--