Copying one SDL_Surface to another SDL_Surface, how i do it properly?

Hi,

I have the following:

SDL_Surface *screenTEMP;
SDL_Surface *Screen;

How would I copy what is in “Screen” into “screenTEMP” ???

Sorry for such an easy question.
Tying to make a screen fader now…

Jesse “JeZ+Lee” Palser
SLNTHERO at aol.com
Silent Hero Productions®
Video Game Design Studio
http://www.SilentHeroProductions.com

Just blit it as normal!

SDL_BlitSurface(screen,NULL,screenTemp,NULL);

Done.> ----- Original Message -----

From: slnthero@aol.com (Jesse Palser)
To: A list for developers using the SDL library. (includes SDL-announce)
Sent: Saturday, 5 July, 2008 11:24:42 AM
Subject: [SDL] Copying one SDL_Surface to another SDL_Surface, how i do it properly?

Hi,

I have the following:

SDL_Surface *screenTEMP;
SDL_Surface *Screen;

How would I copy what is in “Screen” into “screenTEMP” ???

Sorry for such an easy question.
Tying to make a screen fader now…

Jesse “JeZ+Lee” Palser
SLNTHERO at aol.com
Silent Hero Productions®
Video Game Design Studio
http://www.SilentHeroProductions.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  __________________________________________________________

Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html

Hi,

Just a note:

First make sure you have allocated some space for the screenTemp
surface, using SDL_CreateRGBSurface() or similar :)On Sat, Jul 5, 2008 at 11:30 AM, Edward Byard <e_byard at yahoo.co.uk> wrote:

Just blit it as normal!

SDL_BlitSurface(screen,NULL,screenTemp,NULL);

Done.

I think the best way is:

SDL_Surface* screenTEMP = SDL_ConvertSurface(Screen, Screen->format, SDL_SWSURFACE);

And you can wrap this in a function easily (from Sprig):

static inline SDL_Surface* SPG_CopySurface(SDL_Surface* src)
{
return SDL_ConvertSurface(src, src->format, SDL_SWSURFACE);
}

Jonny D> Date: Sat, 5 Jul 2008 06:24:42 -0400

From: slnthero at aol.com
To: sdl at lists.libsdl.org
Subject: [SDL] Copying one SDL_Surface to another SDL_Surface, how i do it properly?

Hi,

I have the following:

SDL_Surface *screenTEMP;
SDL_Surface *Screen;

How would I copy what is in “Screen” into “screenTEMP” ???

Sorry for such an easy question.
Tying to make a screen fader now…

Jesse “JeZ+Lee” Palser
SLNTHERO at aol.com
Silent Hero Productions®
Video Game Design Studio
http://www.SilentHeroProductions.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi,

Thanks everyone…

I got the fade in and fade out working now, moving forward…

Jesse “JeZ+Lee” Palser
SLNTHERO at aol.com
Silent Hero Productions®
Video Game Design Studio
http://www.SilentHeroProductions.com

Jonathan Dearborn wrote:> I think the best way is:

SDL_Surface* screenTEMP = SDL_ConvertSurface(Screen, Screen->format,
SDL_SWSURFACE);

And you can wrap this in a function easily (from Sprig):

static inline SDL_Surface* SPG_CopySurface(SDL_Surface* src)
{
return SDL_ConvertSurface(src, src->format, SDL_SWSURFACE);
}

Jonny D


Date: Sat, 5 Jul 2008 06:24:42 -0400
From: slnthero at aol.com
To: sdl at lists.libsdl.org
Subject: [SDL] Copying one SDL_Surface to another SDL_Surface, how i
do it properly?

Hi,

I have the following:

SDL_Surface *screenTEMP;
SDL_Surface *Screen;

How would I copy what is in “Screen” into “screenTEMP” ???

Sorry for such an easy question.
Tying to make a screen fader now…

Jesse “JeZ+Lee” Palser
SLNTHERO at aol.com
Silent Hero Productions®
Video Game Design Studio
http://www.SilentHeroProductions.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
=



SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org