[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] [BUG] SRCALPHA - unexpected behaviour.



Thanks Brian.

I think there is one issue with raising an error though.  The flags
are just 'hints' and not all installations support each flag.
SRCALPHA is only supported on 32 bit surfaces (I think).  So if the
underlying video subsystem decides that it should return 16 bit
surfaces (for example), then the SRCALPHA flag should correctly have
no effect.


On 8/20/07, Brian Fisher <brian@xxxxxxxxxxxxxxxxxxx> wrote:
> Being able to have this succeed without error:
>    surf = pygame.Surface((100, 100), pygame.SRCALPHA)
> and get a surface that doesn't have SRCALPHA set seems like a clear
> and obvious bug to me. I'd say the best fix would be to always use
> SRCALPHA if requested, and raise an error if the request couldn't be
> satisfied. attached is a patch to svn pyame that seems to do that (it
> passes the test in svn for this, anyways)
>
> ------
>
> ... However I'm also seeing that this:
>    surf = pygame.Surface((100, 100), flags=pygame.SRCALPHA, depth=32)
> is returning a surface without alpha set. So it seems like the Surface
> constructor doesn't support keyword arguments at all.
>
> I've tested python 2.3 on windows, pygame 1.7 and svn pygame. I've
> also tried python 2.5 on macOSX, pygame 1.7
>
> I have no idea how to fix this, but I've attached a patch to the surface test
>
>