Archived

This topic is now archived and is closed to further replies.

SDL default resolution

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

When I used to use GLUT to set up my OpenGL fullscreen game, I was able to just to use glutEnterGameMode() to enter full screen at the current resolution of the user''s desktop. However, now that I use SDL, the SDL_SetVideoMode has resolution and bit depth as required parameters. Is there a way in SDL to go full screen but leave the current resolution as it is? I want to do this because a) it comes up with a reasonable resolution at start up, without the user having to choose a resolution and b) if I recall correctly, in GLUT it went considerably faster then when I manually specified the video mode for some reason, even when I gave the same resolution as my current desktop settings (don''t ask me why).

Share this post


Link to post
Share on other sites
i dont know much about sdl, so if i give you advice that goes against it, just ignore it...

but i would suggest checking out the DEVMODE structure and the ChangeDisplaySettings() over at msdn

its really easy to change the display, just fill out a dm structure and pass it in the function, it tells you if the change was successfull, and when your done, you can call ChangeDisplaySettings(NULL,0); to go back to what the user had before you changed it (ie: loads it from registry)...

Otherwise, if this doesnt help you, sorry... I cant even find glut.h on my computer (visual studio .net, and the file isnt even in the gl folder... )

good day

Share this post


Link to post
Share on other sites
I''m not using Windows, so I wouldn''t have access to any Microsoft functions. Also, I don''t believe that glut comes with Windows (or MSVC) unlike OpenGL, though you can download it for free.

Share this post


Link to post
Share on other sites
Have you tried SDL_GetVideoInfo, the page states:

"This function returns a read-only pointer to information about the video hardware. If this is called before SDL_SetVideoMode, the vfmt member of the returned structure will contain the pixel format of the "best" video mode."

perhaps this best video mode is the current?

Proud aedGUI developer.

Share this post


Link to post
Share on other sites
I tried Kwizatz''s GetVideoMode, but the structure returned doesn''t say anything about resolution! It did give me bit depth, though. Thank you. I browsed a bit around their web site a bit more and it turns out that SDL_ListModes returns a list of available resolutions so I just took the first one. For some reason, I tried every resolution in the array between 0 and 5 (I didn''t go further) and they all were just 1024X768 (my current resolution)! I''m not sure what the point is of having 6 copies of the same resolution.

So, thank you everyone for there replies. All of your attempts to help are much appreciated.

Share this post


Link to post
Share on other sites