Dirty Rectangles
Dirty Rectangles, is when you copy whatever is behind the sprite you are drawing into safe memory, so you can draw back it back later on. This way you don''t have to render the background over and over again, and speeds things up a little (not always).
here is pseudo code:
drawDirtyRectanglesOnTheScreen()
move sprite and stuff
copyDirtyRectanglesFromScreenToSafeMemory()
drawSpriteOnScreen()
Dirty Rectangles -
A method of updating only the changed parts of the screen. The screen is divided up into rectangles and only rectangles that have changes are makred "dirty" and then are redrawn to clean them up. Increases drawing speed as less is drawn.
btw, here''s an article that explains it pretty well: dirty rectangles
here is pseudo code:
drawDirtyRectanglesOnTheScreen()
move sprite and stuff
copyDirtyRectanglesFromScreenToSafeMemory()
drawSpriteOnScreen()
Dirty Rectangles -
A method of updating only the changed parts of the screen. The screen is divided up into rectangles and only rectangles that have changes are makred "dirty" and then are redrawn to clean them up. Increases drawing speed as less is drawn.
btw, here''s an article that explains it pretty well: dirty rectangles
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement