Advertisement

Dirty Rectangles

Started by September 22, 1999 01:50 AM
1 comment, last by GameDev.net 25 years, 4 months ago
You can use minimal requared area, i.e. use one rectangle that will cover the area that was modifyed. (good if you modify something only in one part of the screen)

Try to merge rectangles that are close to each other.

------------------
FlyFire/CodeX
http://codexorg.webjump.com

Does anyone have any good algorithms for managing dirty rectangles?

Let me say what I've already got. I already have code to manage the EXACT list of dirty rectangles. The potential problem is that the list can get too long, and it's not worth the time managing this for the time saved in reducing the pixels bltted.

What I'd really like to see is an algorithm that might blt some unnecessary pixels, but the number of rectangles bltted is much smaller, and the management is not computationally intensive.

Also, something that pays attention to 32-bit boundaries is important, because bltting from an odd pixel is a performance hit.

So, are there any suggestions or pointers?

Advertisement
Thats why on a dirty rectangle system you generaly just have a maxium amount of rectangles if it gets to high just redraw th entire screen,and clear your list.

This topic is closed to new replies.

Advertisement