Skip to main content
gamedev.net
🔒 Locked

Avoiding 2D overdraw

Started by robinei Oct 17, 2003 at 4:26 PM 3 replies 900+ views
Original Post
robinei
robinei
I''m thinking of assigning a bounding box to each screen object in my 2D engine. So when one object is needs to be redrawn I would just redraw it, and those objects it overlaps. ..But of course it isn''t very efficient to check all bounding boxes for every change, so what I need is a fast way to determine which boxes overlap which. Any ideas on how to achieve this?
robinei
robinei
Are there more in-depth guides to be found?
MaggotX
MaggotX
I went through this when programming with DirectX 3. (DirectDraw).

With the newer versions there is no longer a need to optimize your drawing like this. Just re-draw every object for every frame. The computers are now plenty fast to handle thousands of objects being drawn this way. And you don''t have to worry about cleaning up where your object was before it moved.

Use Direct3D quads for your sprites. You can set the Z order easily. This way you will be using the power of your 3D Card even for your 2D engine.

robinei
robinei
Yeah, I think you may be right =) I think I''m just stubborn staying away from 3D APIs(or afraid..).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.