• 12
• 15
• 19
• 27
• 9

SDL with OpenGL, fullscreen?

This topic is 4809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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 on other sites
For every window resize, call gluPerspective with the new parameters: width, height, aspect, fovy, etc

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.

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?

SDL_Rect **modes;modes=SDL_ListModes(NULL, SDL_HWSURFACE|SDL_FULLSCREEN);for(i=0; modes; ++i) {	printf("%ix%i\n",modes->w,modes->h);}