Jump to content
  • Advertisement

Archived

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

Tealc

OpenGL OpenGL Enumeration

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

Hello, I turned from DirectX to OpenGL. With DirectX it was possible to do an enumeration of the available display modes. How can I do this with OpenGL ?? Best Regards, Tealc

Share this post


Link to post
Share on other sites
Advertisement
You can KIND of do it...check the msdn for a "glEnum" sample project. I found it a few weeks ago, and it basically cycles through all the available pixel formats and acceleration modes...

I can''t remember how the hell to find it through the search though, as "glEnum" didn''t seem to produce anything..

Good luck!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://download.microsoft.com/download/platformsdk/Other/1.0/WIN98Me/EN-US/Glen.exe

is what above poster is referring to i believe

Share this post


Link to post
Share on other sites
quote:
Original post by Iolo
You can KIND of do it...check the msdn for a "glEnum" sample project. I found it a few weeks ago, and it basically cycles through all the available pixel formats and acceleration modes...

Yes, but remember that OpenGL alone can''t do this. It''s the Win32 API extensions you''re thinking of. On Linux, for example, you''d have to use the related GLX functions to achieve pixel format enumeration. On Windows, you can use DescribePixelFormat for every available pixel format ID (the functions returns the maximum pixel format index if it succeeds) and extract pixel format information out of the PIXELFORMATDESCRIPTOR structure.

But I think that the original poster was more interested in enumerating display modes (like 800x600x16) and not pixel formats. To enumerate display modes, you''ll have to use the GDI function EnumDisplaySettings and extract the desired information out of the returned DEVMODE structure (dmPelsWidth, dmPelsHeight and dmBitsPerPel).

Share this post


Link to post
Share on other sites
Thanks for the link AP...that''s the one I meant.

Origin - Yeah I guess you''re right. It is a *tad* win32 dependent, and the glEnum sample isn''t quite what the original poster had wanted (I think)..

I guess maybe in a "perfect" system (win32 speaking) you might probably think of doing both: enumerating the available desktop modes, combined with enumerating the pixel formats which support hardware accelerated OpenGL?

Share this post


Link to post
Share on other sites
Firstly - there is no ''glEnum'' function listed in my help files

There seems to be some ideas of how to get the device information, but how would one go about forcing an OpenGL window to use that device specifically?

Any Ideas?

Share this post


Link to post
Share on other sites
do u have a early voodoo card?
ive never had one so cant help you.

but the information u ask for has nothing to do with opengl, did u check out libsdl? what specific case are u trying to do.

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
quote:
Original post by Bwuce_Wee
Firstly - there is no ''glEnum'' function listed in my help files

There seems to be some ideas of how to get the device information, but how would one go about forcing an OpenGL window to use that device specifically?

Any Ideas?

What do you mean? You can set the pixel format of a device by calling SetPixelFormat on your device context. OpenGL is forced to use that device context by specifying it when calling wglCreateContext.

If you''re talking about display modes, that''s even easier. Just call ChangeDisplaySettings with the appropriate device mode.

Share this post


Link to post
Share on other sites

  • 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!