Solved

Efficient Dirty-Rect Sprite Updating System

Posted on 1998-06-02
2
299 Views
Last Modified: 2013-12-03
I'm looking for a relatively straightforward method for updating multiple sprites to the screen, using a fullscreen mix buffer. It should take a list of dirty rects, combine them into a minimal region made up of a few rects, draw the sprites with clipping to the mix buffer (that part is easy) then copy it all to the screen. I'm interested in any algorithms to calculate the minimal bounding region as a small number of rects which can be blitted individually. C/C++ code preferred. Any thoughts about keeping the animation flicker free would be useful, too. Thank you!
0
Comment
Question by:ratty
2 Comments
 

Author Comment

by:ratty
ID: 1406372
Edited text of question
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1406373
You need to build a graph, where each vertex of the graph is a dirty rectangle. There is a connection between two vertices if the two rectangles intersect.

Once you have this ground work, it is easy to massage this to your needs.

For example, if you want to minimize on the number of blits, then you want to find clusters of vertices in the graph (i.e. minimize the distance between the verticies).
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now