I use offscreens to draw my own lines (anli-aliased), so I have to read
from the offscreen first, then add my pixels and write them back to the
I use it like this:
gOffscreen = PdCreateOffscreenContext(0, 800, 600, Pg_OSC_MEM_PAGE_ALIGN);
main_ptr.ptr8 = (unsigned char *)PdGetOffscreenContextPtr(gOffscreen);
After that, I access main_ptr.ptr8 to read and write to the offscreen.
At the end, I use PgContextBlit/PgFlush to copy the offscreen to the main
It always seemed to take a lot of time, so I ran a few tests:
To copy the whole offscreen memory (8006002, 16-bit color) it takes:
reading from offscreen : 147ms (6.3 MByte/s)
writing to offscreen : 11ms (85 MByte/s)
So reading from the videocard’s memory is slower than reading from
I’ve tested it on a machine with the tnt driver and one with the c&t driver.
Same result on both machines.
I guess there is some cache/shared memory in between me and the card. How
can I remove that bottleneck? Has anyone experienced this before??