class MASKING_DLL_DECLSPEC DRS

The Dirty Rectangle Syste (DRS) screen update driver.

Inheritance:

DRS - DoubleBuffer - ScreenUpdate


Public Methods

[more]void Redraw()
Paints the screen by going through the dirty rectangles list, blitting them to the screen and removing them from the list
[more]bool RequiresFullRedraw()
DRS obviously doesn't require the screen to be redrawn every frame so this functions returns false
[more]void InvalidateRect(const Rect& r)
Attempts to add a rectangle to the dirty rectangles list.

Protected Fields

[more]std::list<Rect> rectlist
The actual list of dirty rectangles

Protected Methods

[more]Rect* CanAdd(const Rect& r)
Checks whether a rectangle can safely be added to the dirty list without inducing overdraw.


Documentation

The Dirty Rectangle Syste (DRS) screen update driver. DRS is similar to normal double buffering except that it doesn't blit the entire buffer to the screen every frame but instead keeps a list of rectangles that have been chaged since the last update (dirty rectangles) and only blits them. This means that when only a small portion of the screen changes there is little or no overdaraw which in turn means that for applications where most of the screen is static most of the time (like most utility programs, editors, etc.) this is by far the fastest screen update method often producing thousands of "frames" per second. However when large portions of the screen or even the entire screen is updated all the time (like in most games) this driver is no faster than regular double buffering. In fact it might even be very slightly slower.
ostd::list<Rect> rectlist
The actual list of dirty rectangles

oRect* CanAdd(const Rect& r)
Checks whether a rectangle can safely be added to the dirty list without inducing overdraw. It returns a pointer to the rectangle that is in the way of the recatangle being added if it finds one, NULL otherwise.

ovoid Redraw()
Paints the screen by going through the dirty rectangles list, blitting them to the screen and removing them from the list

obool RequiresFullRedraw()
DRS obviously doesn't require the screen to be redrawn every frame so this functions returns false

ovoid InvalidateRect(const Rect& r)
Attempts to add a rectangle to the dirty rectangles list. If there is already another rectangle in the way it splits the rectangle being added into smaller rectangles and recursively invalidates them instead thus preventing parts of the screen to be drawn more than once.


Direct child classes:
GLDriverDRS

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++