On Wednesday 04 February 2004 23:31, Lionel Ulmer wrote:
Well, you need to store the rectangle at Lock time but
only draw it at
Unlock time. And I have no idea if any game ever does concurrent locks (so
I have no idea how concurrent lock work).
OK, so that is another thing to find out
So setting the rectangle dirty on Lock is not going to
give us that much
more garbage on screen than the usual stuff
There is a big difference between setting it Lock and on UnLock. Setting on
UnLock is like saying: yeah, I know I may draw unfinished rectangles which
you keep locked while I'm drawing, but I will fix them as soon as you finish
and unlock them. But setting on Lock is like saying: I will draw this
unfinished rectangle and I don't care to fix it later when it is finished.
The first method will in most cases cause no more than some tearing, the
second will cause trails and other artifacts.
(and, moreover, this only is a
problem on Windowed applications or on non-double buffered games (which
COMI is the only example I know)).
Warlords Battlecry does not use double-buffering. It draws to an offscreen
surface, then blits pieces of this surface to the front buffer. AFAIK the
sequel does the same. Demos are here:
http://www.gamesdomain.co.uk/demos/demo/1130.html
http://www.gamesdomain.co.uk/demos/demo/1587.html
--
Piotr Pawłow
mailto:
[email protected]