I'm a bit confused about the nature of OpenGL 1.0 and 1.1 function pointers on Windows. I think I have it down, but I'm not 100% sure, so I'm hoping that someone will be able to confirm or comment on my current understanding:
My understanding at the moment is that you're supposed to load 1.2+ functions with wglGetProcAddress()
, but that 1.0 and 1.1 function have to be loaded with GetProcAddress()
through opengl32.dll
. What catches my attention, however, is that wglGetProcAddress()
supposedly returns different function pointers depending on which HGLRC
context is current. Yet presumably the 1.0 and 1.1 pointers from GetProcAddress()
are always the same. This disparity in behavior feels unusual.
So, let's say that I have a situation where I have multiple HGLRC
objects, we'll call them A
and B
. I call wglGetProcAddress()
and I keep the results in separate pointer pools, one for A
and another for B
. Yet I also have to load 1.0 and 1.1 functions into these pointer pools, and in this case it seems that the pointers for A
and B
will always be the same.
What surprises me is that the 1.0 and 1.1 functions must therefore be thin wrappers which redirect OpenGL calls to whichever driver is associated with the current HGLRC
. Yet if such a redirect mechanism is already in place on Windows then I wonder why wglGetProcAddress()
can't also use it, because doing so would alleviate the danger of it returning context-dependent pointers. I don't necessarily even need to know the answer to this question, but the very presence of the question is what makes me wonder whether or not I understand things correctly at all to begin with.