SDL default resolution

Started by
6 comments, last by clum 20 years, 6 months ago
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).
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
Advertisement
Does no-one know?
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
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
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
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.
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
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.
Use GetSystemMetrics(SM_CXFULLSCREENx) and GetSystemMetrics(SM_CXFULLSCREENY) to get current resolution in Windows operating system.
Sometimes movement is a result of a kick in the ass!
*looks 2 posts above idinkin''s post where the OP says he isnt using windows*
:|
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.
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)

This topic is closed to new replies.

Advertisement