Sign in to follow this  
siliconsurfer

SDL Resizing Windows and Images

Recommended Posts

Hi just a curiousity question here. It's easy to create a resizeable window at say 640x480 resolution. Now heres the thing. Say a background image is loaded (also 640x480). If you resize the window (stretch it out with the cursor, or shrink it in) the image and any sprites images obviously don't resize. So the questions are: Is there any functions within SDL which can resize the images when an resize window event is detected?? Or do you need to load new images that corrospond to the windows new size.

Share this post


Link to post
Share on other sites
There is a secret one, but it is secret. So you have to use SDL_IMG (another library) to stretch surfaces. edit: OOPS! I meant SDL_gfx.

[Edited by - C-Junkie on February 10, 2005 12:46:04 PM]

Share this post


Link to post
Share on other sites
SDL itself doesn't provide stretching methods so if you adjust your screen resolution then you'll either need to draw a different image which matches the resolution or you could use SDL_gfx to zoom the surface to the correct size.

Share this post


Link to post
Share on other sites
I looked up SDL_Image, I see it has one fucntion IMG_Load.

I call it on the background image when I genereate a resize event, but nothing happens. Am I being very niave here? How do you use it to restrect an image?

Cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this