SDL_UpdateRects Question

I’m doing dirty tiling (only blitting the 2D stuff that changes from frame
to frame) by using SDL_Blit() on just the tiles that change. The big
question is - when I do an SDL_Blit() should I do an SDL_UpdateRects() on
EACH of the tiles I blit, or just an SDL_UpdateRect() on the entire
screen area once the tile blits are complete?

–>Neil-------------------------------------------------------------------------------
Neil Bradley What are burger lovers saying
Synthcom Systems, Inc. about the new BK Back Porch Griller?
ICQ #29402898 “It tastes like it came off the back porch.” - Me

I’m doing dirty tiling (only blitting the 2D stuff that changes from
frame
to frame) by using SDL_Blit() on just the tiles that change. The big
question is - when I do an SDL_Blit() should I do an SDL_UpdateRects()
on
EACH of the tiles I blit, or just an SDL_UpdateRect() on the entire
screen area once the tile blits are complete?

SDL doesn’t keep track of what areas you blit with SDL_BlitSurface().
If you only want those areas to be updated, call SDL_UpdateRects().It’s
best to do all your SDL_BlitSurface’s first, keeping track of all the
dirty rects, then call SDL_UpdateRects() once.

If you are redrawing most of the screen, use SDL_UpdateRect() to update
the entire screen.

Better still, try both and use which one is faster, since that will
vary from app to app. Oh, and check the list archives, this one has
been discussed a lot.On Monday, September 23, 2002, at 05:06 PM, Neil Bradley wrote: