| Summary: | problems with SDL_BlitSurface from PNG to transparent surface | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Davide Coppola <dmc> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.2.9 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
|
Description
Davide Coppola
2006-01-23 04:32:53 UTC
Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL. --ryan. This is not technically a bug. According to the documentation: * RGBA->RGBA: * SDL_SRCALPHA set: * alpha-blend (using the source alpha channel) the RGB values; * leave destination alpha untouched. [Note: is this correct?] * SDL_SRCCOLORKEY ignored. * SDL_SRCALPHA not set: * copy all of RGBA to the destination. SDL_DisplayFormatAlpha() turns on SDL_SRCALPHA by default (to enable blending) What I did to fix this in your test program was just add SDL_SetAlpha(img, 0, 0) before the blit onto window. Of course a manual memcpy works just as well. :) Thanks for the great test case! (In reply to comment #2) I confirm that your solution works well, and I'm glad of this ;) Just a note for someone interested: if you want to blit img on screen after you have set SDL_SetAlpha(img, 0, 0), you have to set SDL_SetAlpha(img, SDL_SRCALPHA, 0). Best regards. |