Jump to content
  • Advertisement
Sign in to follow this  
kiaran

SDL - Adjust fullscreen resolution

This topic is 2751 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

I want to provide the ability for users to scale the resolution down so my game can run faster on older systems.

I am currently using the desktop resolution and feeding that into the SDL function :




const SDL_VideoInfo* ptrVidInfo = SDL_GetVideoInfo();
desktopWidth = ptrVidInfo->current_w;
desktopHeight = ptrVidInfo->current_h;
sdlScreen = SDL_SetVideoMode( desktopWidth , desktopHeight , 0, SDL_OPENGL | SDL_FULLSCREEN);



My idea was to allow the user to scale the resolution down by some percentage. So just as a test I tried manually setting the resolution to 1280x720 on my 1920x1080p monitor. Instead of stretching to cover the screen as I expected, I got a squished image with a black bar across the top.

I've tried many resolutions using all kinds of aspect ratios. None of them fill the screen and most of them (even with same aspect ratio as monitor) have some amount of stretching.

How do people change the resolution of their fullscreen SDL applications?

Share this post


Link to post
Share on other sites
Advertisement
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!