[SDL] resize surface

Gabriele Greco gabrielegreco at tin.it
Thu Jul 25 08:46:00 PDT 2002


On Thu, 2002-07-25 at 16:57, Alexis wrote:
> Hi,
> 
> A very simple issue most of you may have an answer..
> My program loads an image from a file (let's say 'whatever.tga') on a
> surface using sdl_image. This program is supposed to blit this surface
> somewhere on another surface (the screen for instance).
> My problem is i've gotta scale the image's surface so that it keeps a
> certain ratio. I guess there must be a way to resize this surface but can't
> find any SDL call to perform this task, do i have to implement something
> like this myself?

There is an internal call that does this but if it's not documented
maybe it should NOT be used :)

...I found it while doing the SDL Amiga porting :)

BTW: I've found at least a program that use that function: SDLroids.

You can easily implement bitmap resizing faster than SDL for instance
with a static table if you have to resize tons of pictures always with
the same ratio. Just look on the web for nice ways to do this.

Bye,
 Gabry

PS: I don't write the name of the function in this post since I don't
want to be guilt of finding it in tons of SDL programs :)







More information about the SDL mailing list