Jump to content
  • Advertisement
Sign in to follow this  
nagromo

SDL with OpenGL, fullscreen?

This topic is 4930 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
Advertisement
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) {
printf("%ix%i\n",modes->w,modes->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
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!