In the situation he described, it can not be known to his code. The
SDL expose event does not return a damaged rectangles list. X11 lets
you get the damaged list, but SDL does not.
SDL doesn’t provide that in its expose event?
Nope, nothing but the fact that you need to redraw the window.
That’s kind of
unfortunate, especially as it’s something that’s really easy to fake
if the underlying platform wouldn’t provide it (just cover the whole
window, getting the same effect).
Yes, and no. It is really easy to fake. To implement it you would have
to write code to convert the underlying platforms damaged rectangle
list to SDL’s rectangle list format. Which is not a lot of code…
But, how often would it get used? Even on old X11 code from the '80s
very few people bothered to do anything but redraw the whole window.
It is mainly useful on low performance computers.
You have to remember that things like the damaged rectangle list as
part of an expose event was invented back when people were first
putting GUIs on computers. X11 was designed for the 3 (or maybe 4) M
computer where M stands for 1,000,000 (one million). The Ms were for a
Megabyte of ram, a Million 1 bit pixels, a Million
instructions/second, and 1 Megabit/second Ethernet. The original Mac
was a bit shy of those specs as were the first PCs the ran Windows
1.0. But, were not far off. In those days the GUI value of updating
fragments of the screen was pretty high because updating the screen at
all was slow.
OTOH, we have recently entered the Giga (billion 1,000,000,000) Age
where we have Billions of instructions/second, billions of bytes of
ram, Billions of bits of graphic ram, and Billion bit per second
The rules change when the measure of every facet of our machines
increases by a factor of 1,000. So, while some machines would benefit
from SDL having a damaged rectangles list as part of the expose event,
most would not. And, over the next few years the machines that would
benefit will fade away.
IMHO, the damaged rectangle list was left out of SDL in the first
place because even when SDL was new that information was of little use
to game developers. (Sam, please correct me if I am wrong.) I see
little value in adding it in now.
Bob PendletonOn Sun, Jan 25, 2009 at 10:55 PM, Pierre Phaneuf wrote:
On Sun, Jan 25, 2009 at 7:18 PM, Bob Pendleton <@Bob_Pendleton> wrote:
Would be a nice addition to 1.3 (if it’s not there already?)…
If you just use double buffering, you can just use SDL_Flip()
Which does what? It redraws the entire window.
Maybe even twice, if the underlying platform does double buffering.
SDL mailing list
SDL at lists.libsdl.org