Sign in to follow this  

SDL with OpenGL, fullscreen?

This topic is 4715 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'm using SDL with OpenGL, and I'm having trouble in fullscreen. It normally works fine, but if I change the window to a wierd size before setting it to fullscreen the OpenGL projection looks wierd (different depending on size of window). I'm pretty sure it's because I'm trying to set it to an unsupported size in fullscreen, but how can I find what resolutions are supported by the hardware?

Share this post


Link to post
Share on other sites
I set up my transform, but the problem is that I am setting it to fullscreen with a size that isn't valid, so the values I am using for setting my viewport and transformation aren't the actual screen dimensions. That's why it looks wierd; it works fine if I switch a 800x600 or 1024x768 window to fullscreen, or change between supported resolutions.

I just realized that I can use SDL_GetVideoInfo after I set the screenmode and change my width and height to the values returned by that. Hopefully that will work.

[edit]

Oops... except that SDL_VideoInfo contains no info about the actual resolution. Is there some way to get it to tell me what mode it's in or what modes are supported?

Share this post


Link to post
Share on other sites
SDL_Rect **modes;
modes=SDL_ListModes(NULL, SDL_HWSURFACE|SDL_FULLSCREEN);
for(i=0; modes[i]; ++i) {
printf("%ix%i\n",modes[i]->w,modes[i]->h);
}


That should print out a list of modes supported in full screen and as hardware surfaces. Look up the function in the SDL documentation for more info!

Share this post


Link to post
Share on other sites

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