Jump to content
  • Advertisement
Sign in to follow this  
Trillian

OpenGL [wingl] Detecting supported extensions before creating a context

This topic is 4240 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'm currently working on my engine and I want the user to be able to choose which renderer he prefers (ogl or d3d). So I'd like to be able to get information on the supported extensions before creating the opengl context. For example, the app starts, sees that ogl supports some version of shaders and dirctx another so chooses to create an opengl renderer because of this, all this could be done before even creating the window. The problem is, all calls to opengl functions seem to fail before the context creation. So is there another way to do it? ... While I'm here, I've got another small question. my openGL renderer (OpenGL::Renderer) is derived from the abstract Render::Renderer. is it a bad idea to give them both the same classname even though they are in separate namespaces? [EDIT] Oh and I've just tought about querying wglGetProcAdress , thats the way to get supported extensions, but how could I do for knowing the ogl version (I'd need to call glGetString(GL_VERSION) but it fails because theres no context)

Share this post


Link to post
Share on other sites
Advertisement
Can't be done, as you say you have to have an OGL window in order to execute OGL functions. Just create one, read back everything you need and then destroy it right away.

Share this post


Link to post
Share on other sites
mmmh... if that's the only way to...

Okay, thanks a lot!
I'd still like to know about the namespace thing though

I like your avatar :D

Share this post


Link to post
Share on other sites
the namespace thing, well it might cause some confusion but it's unlikely to prove a huge problem I'd have said.

I'm pretty sure wglGetProcAddress also requires an active context to work btw.

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.

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!