Sign in to follow this  

SDL Resize Pixels/Window?

This topic is 3848 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, does anyone know a good way to resize the SDL_Surface that is the window in a way that expands the size of the pixels already there instead of adding more area? The reason I'm trying to do this is beacuse I want the pixels to be larger in my game but setting the game to fullscreen with a low resolution doesn't look good on widescreen monitors because of the distortion. So is there a good way to expand the contents of the window or is there another way I can achieve my goal?

Share this post


Link to post
Share on other sites
I am not quite clear on what you want to do...
Quote:
Hi, does anyone know a good way to resize the SDL_Surface that is the window in a way that expands the size of the pixels already there instead of adding more area?

^^^ kind of conflicts with this...
Quote:
The reason I'm trying to do this is beacuse I want the pixels to be larger in my game but setting the game to fullscreen with a low resolution doesn't look good on widescreen monitors because of the distortion.


In either case I would give the user a choice of multiple resolutions in both 4:3 and 16:9 aspect ratios (or whatever widescreen is) and render differently depending on the aspect ratio and let them pick what looks best for them.

By "render differently depending on the aspect ratio" you could do multiple things like render a 4:3 view centered in the screen, add some additional menus for the 16:9 widescreen view or draw more viewable area of the map for widescreen.

The difference is that initially you will choose a different screen resolution (4:3-1024x768 or 16:9-1088x612 etc.) to pass to SDL_SetVideoMode and then draw accordingly.

Share this post


Link to post
Share on other sites
Thanks evillive, that sounds like a good workaround and shouldn't be very hard. What I meant by distortion was that a resolution that would be fine on a normal monitor would have the pixels be wider than they are tall on a widescreen. The original thing i wanted to do to fix this was not to change the user's resolution at all, but to instead just have the window magnify the pixels (otherwise the sprites are too small and difficult to see when someone is using a high resolution).

Share this post


Link to post
Share on other sites

This topic is 3848 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.

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