[wingl] Detecting supported extensions before creating a context

Started by
3 comments, last by Daaark 17 years, 4 months ago
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)
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.
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
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.
Just don't make a visible window. The user will see nothing.

This topic is closed to new replies.

Advertisement