Solved

Efficient Dirty-Rect Sprite Updating System

Posted on 1998-06-02
2
296 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

15 Experts available now in Live!

Get 1:1 Help Now