SDL 1.2 scaling options


eyecreate

Member
Joined
Feb 3, 2009
Messages
253
Website
git.eyecreate.org
I'm working on porting a SDL 1.2 game that was coded to render at 320x240. I saw some online discussion about using rotozoom to scale and blit onto another larger video surface, but wasn't sure a) if this is the best way for performance or B) there is another solution that doesn't require poking around too deep into the bliting/rendering code.
 
Another alternative is to use the Scale 2x algorithm. It's faster than SDL_gfx's rotozoom functions and smooths out the jaggies. I used it for CromoZome.


HW scaler is probably easiest and with next to no performance overhead.
 
Scale2x or just nearest neighbor are good for pixel art, especially the old pixel art with a palette of only [some low power of two] colors.

For high-color picture-like images, smooth/blurry scaling (i.e. bilinear or bicubic interpolation or something like that) is best.

The hardware scaler, which is used in notaz' SDL, can be configured to do nearest neighbor or smooth scaling. Scale2x or any other pixel art scaling algorithm can be a good alternative in some cases, but the downside is that it cannot be done in hardware (so there's some overhead), and it tends to have artifacts: e.g. fonts tend to look quite different/weird with such scaling.
 
Back
Top