SDL library question

Can you only update specific portions of the display with SDL? Or is it
all or nothing, IE the lock/unlock will copy the entire offscreen buffer to
the display. I see the updaterectangles…But since lock/unlock might be
necessary, does that mean you can’t always count on updaterectangles?

Is it that you check first to see if lock/unlock are required, and if they
aren’t you can get better performance by using updaterectangles (if you
don’t need to copy over the whole display)?

The reason I’m asking is because games like scavenger and bomberman can get
by only copying small areas. My X windows version of scavenger uses < 1% of
the cpu to maintain the display. But the SDL equivalent, copying the entire
screen buffer every frame, couldn’t promise 50 frames/second on just about
any hardware. And it’d eat up cpu time.

If I’m right about the lock/unlock, wouldn’t it be possible to have an
unlock but not copy/update the entire screen? As in lock, modify offscreen
buffer, do updaterectangles, then unlocknocopy?

Sorry if this is all old news and explained somewhere…
-Dave

Whoops, my mistake. I had been thinking the unlocksurface was updating the
screen, but it was a call to updaterect with all zeros, ie copying the
entire screen. That had been a longstanding misunderstanding on my part and
the main reason why I didn’t port scavenger and bomber to SDL. I’ll get right
on those though :^). I’m infatuated with this develop under linux and get
win32 version for free. I can email programs to people to try out on their
windows only systems.