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

David Olsen jolynsbass at gmail.com
Sun Dec 9 05:54:47 PST 2007


If you are changing the alpha over a short period of time, for 
fade-in/fade-out effects, I think you will get the best performance if you 
leave out the SDL_RLEACCEL, as I think that it will re-encode the RLE 
compression each time, making the blit slower... I always thought that, at 
any rate, and have left the rle accel off for fades in my programs.
If I'm wrong, someone please correct me!
-Dave

----- Original Message ----- 
From: "Ryan C. Gordon" <icculus at icculus.org>
To: "A list for developers using the SDL library. (includes SDL-announce)" 
<sdl at lists.libsdl.org>
Sent: Sunday, December 09, 2007 6:47 AM
Subject: Re: [SDL] How can I implement fade-in/fade-out


>
>> 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.
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org 



More information about the SDL mailing list