[SDL] optimized drawing methodsI

Daniel Phillips phillips at arcor.de
Thu Jan 16 14:36:01 PST 2003


On Thursday 16 January 2003 20:07, Corona688 wrote:
> With hardware acceleration, no blitting at *all* happens during SDL_Flip();
> the video card just changes which memory address it starts scanning from,
> and SDL swaps two pointers.  That's pretty well it.  Under software,
> however, the video card can't change contexts like that.  You have to blit
> the entire darn surface over into video memory before it's displayed. 
> Under 640*480*32, that means one meg per frame.  :)  A couple I/O
> operations and a pointer swap beats a 1MB block transfer in my book.

This isn't quite accurate either.  If rendering is done to main memory but a 
hardware-accelerated blit to the graphics memory is available that uses DMA 
over AGP and runs in the background, then the CPU will scarcely notice the 
massive blits taking place at all.  However, getting all those things to come 
true at once has proved to be something of a nightmare, as there are many 
ways for subsystems to drop the ball due to configuration mistakes, 
unimplemented features, or even design errors.

For example, AGP 8X provides 2.1 GB/sec bandwidth, while blitting 70 FPS, 
1600x1200, 32 bit color requires only a little over half a GB/sec.  So if 
software blitting isn't fast as heck on modern hardware, do blame the system 
or the configuration, don't blame the hardware.

Daniel




More information about the SDL mailing list