Okay, I’m a bit fed up as this time of writing, so please excuse me if I come out as a bit obtuse.
I’ve been using OpenGL on Windows XP/Windows Vista/Debian/Ubuntu since about 2003.
Using OpenGL on Xorg is a breeze, but there are some issues on Windows which just never seem to go away. First of all, prior Windows Vista, the Windows’ OpenGL reference driver shipped with OpenGL v1.1. Vista seem to ship with v1.4. For the sake of discussion, let’s stick with only Vista and its WDDM.
1.) Why can’t IHVs ship their own OpenGL runtime?
2.) Why doesn’t wglGetProcAddress give me valid function pointers to the OpenGL API calls which are exposed in the OpenGL runtime that ships with Windows? (1.4 API calls and prior for Vista)
3.) Why are function pointers from wglGetProcAddress context dependent on different pixelformats?
4.) Why does the WGL documentation on MSDN still suck after 12 years?
For my first question, see this overview of Vista’s Display Driver Model. IHVs have to implement a usermode display driver, a display miniport driver, and optionally an OpenGL ICD. They are all marked as gray. But the OpenGL runtime is not (opengl32.dll). In my opinion, if IHVs could ship their own runtime, OpenGL would be just as easy to use on Windows as on Xorg.
For my third question, I kind of understand that the extra indirection requires that wglGetProcAddress has to query the ICD driver for the function. But this MSDN page on wglGetProcAddress says:
The extension function addresses are unique for each pixel format. All rendering contexts of a given pixel format share the same extension function addresses.
So if you change your pixelformat, you might have to fetch the function pointers again, even if you use the same opengl context API call.
AMD’s and NVidia’s binary Xorg drivers expose all the OpenGL API calls in the OpenGL runtime. Where you have to jump through a dozen hops on Windows, you can just define the OpenGL prototypes in Xorg and you’re set. The worst thing that could happen is that the dynamic linker complains over missing symbols and bails. No dummy contexts or GetProcAddress() hell needed. [/end rant]