[SDL] SDL stretching surfaces

DrEvil drevil at warpcore.org
Wed Sep 25 11:28:00 PDT 2002


On Wed, 2002-09-25 at 10:42, Vasileiou Nikolaos wrote:
> 
> Hi,
> Is there any way to stretch (resize) an SDL Surface?
> It is quite usefull for making a surface combatible for usage as an 
> openGL texture which is not power of two.

Some texture resampling code for resampling -- BSD license:

http://zerowing.idsoftware.com/viewcvs/viewcvs.cgi/*checkout*/GtkRadiant/radiant/texmanip.cpp?rev=1.1&content-type=text/plain



Example of how to use it (don't copy and paste this code, just read it
to see how to use the resampling code -- iD Software License):

Look for this function:
QERApp_LoadTextureRGBA

In this link:
http://zerowing.idsoftware.com/viewcvs/viewcvs.cgi/*checkout*/GtkRadiant/radiant/texwindow.cpp?rev=1.41.2.16&only_with_tag=Stable-1_2&content-type=text/plain


That's the way I do it for GtkRadiant, to resample textures to a power
of 2 size. I'm sure it could be done better. But that works quite well.






More information about the SDL mailing list