Enumerating screen res. in OpenGL without using D3D or Win32?

Started by
5 comments, last by rip-off 16 years, 11 months ago
I am collaborating on an cross platform, open source development game (www.aaronbishopgames.com). It is currently running on Win32 using SDL/OpenGL and we are wanting to extend it to Linux and Mac platforms. After hours of searching I have found that there are methods for enumerating the valid fullscreen display modes using the command Windows GDI command EnumDisplaySettings. I was wondering if there was an OpenGL extension or a platform independent library that allows for some similar functionality. Can someone point me in the right direction?
Advertisement
You should just be able to use compile time statements to check what operating system the program is being compiled for. Then use the appropriate calls to the operating systems librarys or functions that will be able to get this information. I'm not sure about macs but I think there might be something in the X windows headers and librarys about this. (I'm not sure though, haven't done any programming on linux for a long time)
Thanks win_crook,

That is a decent proposal and that is how the os-dependent file management calls were done in the "original version" of the software (Egoboo).

We could definitely write a separate run-time module for each supported os.

What I am still hoping for is some OpenGL / GLU / GLExt / GLUT solution. This SHOULD work, since the GL library used on a given computer should be provided by the video card manufacturer for best performance. Therefore, there should be some kind of hook to figure out the supported mode(s). ARGHHH!
I'm quite sure you might have a problem with getting information like that from OpenGL since it offers hardly any access to the hardware. I'm no expert on OpenGL though, so you'd have to look around.
SDL has functions for this. Look into SDL_ListModes() and SDL_VideoModeOK().
hizoly crazap, rip-off!

ARGH, the SDL naming convention!!!

Ok, I will go die a silent death of embarrassment, now....
Quote:Original post by bbirdsey
hizoly crazap, rip-off!

ARGH, the SDL naming convention!!!

Ok, I will go die a silent death of embarrassment, now....


If you read the SDL doc wiki, you get a good feel for the kind of functions SDL provides. Then when you are trying to remember what it is called consult this handy reference [smile].

This topic is closed to new replies.

Advertisement