[SDL] UpdateRects sketchy

Darrell Walisser walisser at mac.com
Sun Sep 15 09:52:01 PDT 2002


On Sunday, September 15, 2002, at 08:50 AM, Kylotan wrote:

> Nick Whitelegg wrote:
>
> I doubt there's going to be a speed bottleneck in the collecting up of
> the rectangles, and I expect most people change the list of dirty rects
> each frame anyway. Compared to the actual updating, changing the list
> around is trivial.

I agree that compared to blitting and updating video memory, managing 
dirty rects takes orders of magnitude less processor time and is worth 
the extra effort. You might even get that extra time for free if the 
CPU is idle waiting for DMA to VRAM to complete.

> I expect that on some platforms you might incur some
> sort of penalty for calling UpdateRects twice per frame rather than
> once, although I can't be sure of this.

I can't speak for other platforms, but on Mac OS X you'll likely incur 
a significant penalty for multiple UpdateRects per frame. On higher-end 
machines you might not notice it, but on slower machines it tends to 
make a big difference.





More information about the SDL mailing list