Sign in to follow this  

Screen Resolution

This topic is 4593 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 work with SDL and I'm wondering something. When I create a window with resolution of 1024*768 for example, and I want to change to 800*600, how am I going to do this? I mean just screen = SDL_SetVideoMode(800,600,32,SDL_SWSURFACE); won't be enough I guess. I mean the images shouldnt have the same weight and height as in 1024*768 since the screen is smaller. Do I need different images for each resolution or do I need to blit them as smaller images to the screen surface or is there another way to do it easier? Greetings, Rob

Share this post


Link to post
Share on other sites
Do you mean if the user resizes the screen while the game is running?

If so, there's a function to handle that.

Click here, and look at the event handler system.

There's a function called SDL_VIDEORESIZE, I think that's what you're after even though I haven't tried that particular one myself yet.


You could try just leaving your objects at the same size and see what happens. In commercial games, when you change the resolution, everything just appears a bit bigger. Is there any real reason why you want the objects to resize, or will it hurt just to make them seem slightly bigger?


Hope that helps,

ukdeveloper.

Share this post


Link to post
Share on other sites
No, I dont want others to resize my screen, I just want an options menu where people can choose between 800*600 and 1024*768 :) (and if they want fullscreen mode yes or no).

And yes, I do want to have the images a bit larger. I mean if you change the screen resolution from 800*600 to 1024*768 and most of the screen isn't being used that sucks.

and SDL_VIDEORESIZE isn't a function. You can use it to check IF the user has resized the screen and in case he did you do something like giving him a warning "Dont resize the screen again or you'll die" :).

Share this post


Link to post
Share on other sites

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