[SDL] Fwd: How to retain RGBA when copying an SDL Surface

Joel Chen jchen at interval.com
Mon Jul 22 15:01:02 PDT 2002


Double check your code that creates the new surface and 
make sure you turn off SRCALPHA on the original. 
ie. SDL_SetAlpha( surf, 0, 0 )



> -----Original Message-----
> From: Dominique Louis [mailto:Dominique at SavageSoftware.com.au] 
> Sent: Monday, July 22, 2002 2:31 PM
> To: sdl at libsdl.org
> Subject: [SDL] Fwd: How to retain RGBA when copying an SDL Surface
> 
> 
> One of the JEDI-SDL members has the following question...
> 
> Any C code would be helpfull.
> 
> -------- Original Message --------
> Hi,
>    I have an RGBA Surface created using IMG_Load (works great) NOW I 
> create a NEW RGBA Surface using SDL_CreateRGBSurface (with all the 
> parameters from the first Surface).
> The problem is HOW do I copy the image WITH the A to the new created 
> Surface ?
> If I'll use SDL_BlitSurface I won't get the RGBA I'll get only RGB.
> 
>  >From the SDL:
> "
> 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.
>     if SDL_SRCCOLORKEY set, only copy the pixels matching the
>     RGB values of the source colour key, ignoring alpha in the
>     comparison.
> "
> (so for the Note, its correct :/ )
> 
> Please let me know,
> Ariel.
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> ---------------------~-->
> Will You Find True Love?
> Will You Meet the One?
> Free Love Reading by phone!
> http://us.click.yahoo.com/O3jeVD/R_ZEAA/Ey.GAA/hWFolB/TM
> --------------------------------------------------------------
> -------~->
> 
> To unsubscribe from this group, send an email to:
> JEDI-SDL-unsubscribe at yahoogroups.com
> 
> 
> 
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
> 
> 
> 
> 
> -- 
> 
http://www.DelphiGamer.com := for all your Object Pascal game 
development needs;
http://www.delphi-jedi.org/Jedi:TEAM_SDL_HOME := Home of JEDI-SDL; 
Cross-platform game development with Pascal, has never been easier.


_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl




More information about the SDL mailing list