quck WGL question

Do I need a valid RC to call wglGetProcAddress(“wglGetExtensionsStringEXT”)?


Im pretty sure the answer is: Yes, you do!

I setup a temp window with a temp GLRC and init my whole WGL extensions and after that I setup the final GLRC with the WGL_ARB_pixel_format extension (needed for Multisampling and I assume for P-Buffers and Render to Texture, too)!


From the wglGetProcAddress docs:

When no current rendering context exists or the function fails, the return value is NULL.

So the answer is definitely less (until MS decides to put it into OpenGL32.dll, which may be never…)


The solution is to make a dummy window. I did this for the pbuffer extension. When you get all the info you need, you destroy it.

You can even make the dummy window invisible so that the user doesnt see that ugliness.