On Mon, Mar 3, 2008 at 11:09 PM, Edward Cullen <[email protected]> wrote:
> 1. Draw the background once.
> 2. Decide where you are going to draw your sprite (do collision
> detection etc.)
> 3. Save the portion of the background where you are going to put the
> sprite into memory associated with the sprite (so that you can restore
> it later).
> 4. Draw the sprite.
> 5. Remove the sprite by re-drawing the background from the backup.
> 6. Goto 2.
i don't think this will work very well. 1st, overlapping sprites
require even more constrains (order of storing backups and redrawing).
2nd, additional surfaces are required for the backups. 3rd, there is a
blit overhead for saving the background.
IMHO the best aproach is to just rebuild the screen within the changed
regions (use SetClipRect with one or more dirty rects) from the
surfaces you already have anyway (background and sprite surfaces).
hope this helps ...
SDL mailing list