Jump to content
  • Advertisement
Sign in to follow this  
leonidasbo

OpenGL Gathering Device capabilities in OpenGL with a trial and error approach

This topic is 2145 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,

In my application's start up I gather all supported OpenGL capabilities and store them in a struct.
Then the rest of the code can refer to this struct in order to learn if something is supported by the Graphics Device.

I am following a "trial and error" approach in order to collect all the capabilities. I create an OpenGL device
and I try to create graphics resources with all possible combinations in order to understand which of them are supported.
For example, I try to create a 2D texture for every possible format, and if the creation is successful for a particular format,
I mark it as supported in the capabilities struct. In the same way I gather the supported depth formats, stencil formats etc.

The situation got more complicated when I realized that the capabilities of graphics device varies between different
display modes/pixel formats. So if something is supported for a specific display mode, it is not guaranteed to be supported
for all the other display modes.

As a result, my application ended up to create a graphics device for every supported display mode/pixel format,
and then gather the capabilities by running the "trial and error" phase for each device.

My problem is that the start up time of the application is very long now, which is not acceptable. I also have the
feeling that I have totally misunderstood something, because I don't believe that commercial OpenGL applications follow
similar approach for gathering device capabilities.

So is this "trial and error" approach something really unusual?
If it not, is it meaningful to execute this phase for every display mode/pixel format?
And if it is unusual, what is the right approach to collect the device capabilties?

Thanks,
Leonidas

Share this post


Link to post
Share on other sites
Advertisement

I agree with mhagain. OpenGL extension mechanism was somewhat created you use case. There is no need to guess( attempt to exercise the functionality, with are resulting failure meaning its not available ), when you can simple check for the required extension.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!