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 - Bug Alpha + ColorKey + 32 bpp
Summary: Bug Alpha + ColorKey + 32 bpp
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2013-08-04 16:20 UTC by Sylvain
Modified: 2013-08-08 05:35 UTC (History)
0 users

See Also:


Attachments
sample program (1.94 KB, text/x-csrc)
2013-08-04 16:20 UTC, Sylvain
Details

Note You need to log in before you can comment on or make changes to this bug.
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 !