[SDL] How can I implement fade-in/fade-out

Ryan C. Gordon icculus at icculus.org
Sun Dec 9 04:47:34 PST 2007


> SDL_SetAlpha(surface,SDL_RLEACCEL,(Uint8)i);
> This code does'nt work!

Try this:

   SDL_SetAlpha(surface,SDL_RLEACCEL | SDL_SRCALPHA,(Uint8)i);

Without SDL_SRCALPHA, blitting will ignore the alpha value you specified 
and just copy the pixels instead of blending them.

--ryan.



More information about the SDL mailing list