Jump to content
  • Advertisement
Sign in to follow this  
siliconsurfer

SDL Resizing Windows and Images

This topic is 4906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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]

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!