[SDL] Scaling Images

Stephane Marchesin stephane.marchesin at wanadoo.fr
Mon Nov 14 09:54:51 PST 2005


Guilherme De Sousa wrote:
> Hello,
> 
> I'm working on an SDL port of an old 8-bit game and
> I'd like to emulate the same style of 3D view that
> this game had. 
> 
> Basically what I'm looking for is a routine that will
> take a rectangular image, can scale it to a smaller or
> larger rectangle but can also scale it to appear as
> though it's in perspective. The screenshots here might
> make it clearer:
> 
> http://wateraxe.demon.nl/alternatereality/  
> 
> I'm currently using the SDL GFX library which works
> fine for the rectangular scaling but can't do the
> perspective scaling as far as I know. I've also heard
> SDL_SoftStretch mentioned but haven't found much
> written about it.
> 
> Can anybody point me to some code or examples that
> might be helpful?
> 

You may want to try OpenGL for that. Not only will it be faster than sw 
to rescale your surface to an arbitrary size, but you also get some nice 
filters for free.

Stephane






More information about the SDL mailing list