[SDL] Wanting to do hardware accelerated stretch blits on Windows - is SDL the right thing to use?

Doug biteme at bitbasher.net
Sat Oct 28 08:13:13 PDT 2006


Yes, SDL_gfx is what I use for "stretching".  I have a video preview 
window, and the source image (from the capture device) is 320x240.  But 
I make the SDL window sizable, and if the SDL window is not exactly 
320x240, then I use SDL_gfx's rotozoom support.

It works fine, but it is a software stretch, so depending on your window 
size, it will eat a good chunk of CPU.  At sizes close to 320x240, 
rotozoom can keep up with the capture device's 30fps.  But if the 
preview window is made quite large (1024x768ish or more) then I'll start 
to drop frames.  I can't recall exactly, but I think I maximized the 
window once to 1600x1200 and was getting about 5fps to 10fps.

If you can pre-process your stretches ahead of time, and just render 
them at the desired size on demand, you'll be golden.

Rotozoom has two classes of functions, so if your not rotating, use the 
function zoomSurface() which doesn't do any rotations - it should be 
faster.

Doug.






More information about the SDL mailing list