[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] [BUG] SRCALPHA - unexpected behaviour.
- To: pygame-users@xxxxxxxx
- Subject: [pygame] [BUG] SRCALPHA - unexpected behaviour.
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Sat, 18 Aug 2007 08:37:08 +1000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 17 Aug 2007 18:37:16 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Via9MshmgOYyhywLzsZH7CU634XBDOaAp0q0P1BZhApgJ3B3zrVgBeZqOYB0YQpNuZiwC53vZmYo0Cfvj/XxQmPXvcw1NOnwtgmZwskDQTjXUxwB5nIEru7wXoimnonuBTm1FnKOTZgZK3BkLkotTR3nyX9Smk5PwINkIV9Y4rM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=fYgXyRjTSVadCq80K5G3RC4pGadPTwJSnfT+oMiPgUgtfaheUxaVBpCyYizgTmcY3nWcQO43+8sf57u++O7Rz7a47HxT2VahBnyA/CvXZrxeR/NXen2P1PvwIAp8pBrt5d5v7aq1Qgrn9CqLjStLOOvebWGakknREkZcDpwt7l0=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
After a chat on irc today, this unexpected behaviour popped up again.
It's bit me a few times, as well as people in irc.
import pygame
surf = pygame.Surface((100, 100), pygame.SRCALPHA)
flags = surf.get_flags()
depth = surf.get_bitsize()
assert(depth == 32)
assert(flags & pygame.SRCALPHA == pygame.SRCALPHA)
You would expect that surface to have the SRCALPHA flag if the surface
was 32bit right?
It doesn't at the moment. But is there a good reason why it does not?
I can understand that if the surface returned was 16bit, or 8bit that
the SRCALPHA flag is not set. However if it's 32bit, then I think it
probably should be set.
What do you think? Is there something we're missing?
Can you see something breaking if I change this? So that if SRCALPHA
is specified, and the bitsize is 32, then use the SRCALPHA flag. If
someone specifies the SRCALPHA flag I think they expect it to be used
- especially if the surface is 32 bit anyway.