We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2009

Summary: Bug Alpha + ColorKey + 32 bpp
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-2.0.0
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: sample program

Description Sylvain 2013-08-04 16:20:56 UTC
Created attachment 1270 [details]
sample program

Hi,

A texture is creating from a 32BPP surface having both Alpha-per-surface + ColorKey. Colorkey seems not to work because the pink color key actually appears when the texture is rendered.

Using 16BPP would solve the issue.

see attached sample program.

thanks,

Sylvain
Comment 1 Sam Lantinga 2013-08-04 23:38:41 UTC
SDL doesn't support simultaneous blending and colorkey operations.  Typically what people do is turn off alpha blending or set the alpha channel to 0 for pixels that match the colorkey in their source art.

Let me know if you need help with either of these, or if you have a reason why you need both operations simultaneously.
Comment 2 Sam Lantinga 2013-08-05 02:45:43 UTC
hello Sam,

thanks for the answer but a precision ! I dont know if I am clear.

I am talking about alpha per surface, not the Alpha channel.

Alpha + Colorkey does work correctly when using 16 bits per pixel : 
- colorkey colors are fully transparent.
- surface other colors are transparent (more or less, depending the alpha global value).

but this doesn't work when changing to 32 bits !