Mail Archives: djgpp/1999/10/22/12:34:26
Tom Fjellstrom (tomcf AT connect DOT ab DOT ca) wrote:
[...]
> Because I want to call the same routine on any bitmap whether or not
> it's a regular bitmap, the screen, or a sub bitmap of the screen.
Excuse me repeating myself, but I think this point really needs some
stressing: you have a serious design problem, here, and there's no way
your choice of nearptr() vs. far*() methods will get you out of it.
Reading off screen memory, like you are planning to do, here, is
*extremely* inefficient. Shawn Hargreaves once gave more precise
numbers, IIRC, but in the essence, reading from screen memory is
usually about a factor of 10 or so slower than writing to it. Compared
to main memory access speed, the slowdown is even worse. So, if you
want it fast:
Avoid reading from screen memory --- it's awfully SLOW
The usual solution is to do all the drawing, copying and whatnot in
main memory, alone, and only after that's complete, blast the whole
image to the screen, in one blit().
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -