[SDL] sprite drawing
Robert Sadedin
serenity at nosubstancesoftware.com
Wed Jul 23 19:10:01 PDT 2003
Right.
Okay, do your sprite drawing as a two phase action.
First, whenever you need to draw a sprite clear the area where they
currently are, and add the sprite id, x,y coordinates to a list.
Then, when all sprites that are to be drawn had their area clear and their
request queued, loop through the list and actually draw the sprite.
Simple, although I'm sure there are far more sophisticated and 'nice'
solutions.
----- Original Message -----
From: "Jacob Persson" <straver at apollo.nu>
To: <sdl at libsdl.org>
Sent: Thursday, July 24, 2003 11:53 AM
Subject: [SDL] sprite drawing
> I clear my sprites from the screen by keeping a copy of the background the
size of the sprite which I blit over the sprite. This works just great until
you have two sprites moving above each other. Then the copy of the
background will become outdated when the sprites move and as result leave
trails of trash on the screen.
>
> How do you fix this?
>
>
> --
> // Jacob Persson
> // straver at apollo.nu
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
More information about the SDL
mailing list