SDL Resizing Windows and Images

Started by
2 comments, last by siliconsurfer 19 years, 2 months ago
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.
Advertisement
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]
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.
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

This topic is closed to new replies.

Advertisement