I hate to disagree with Michael, but I have to stand up and count
myself among the supporters of context-independent function pointers.
For me, the compelling argument is that without context-independent
pointers it's very difficult to design libraries that are capable of
handling multiple contexts efficiently. (Problems analogous to this
exist even in the GLU today.)
The fact that wglGetProcAddress() doesn't work in this way is
unfortunate, but not a good reason for making other systems less
usable. People who want to write code that ports to Windows will just
have to deal with that problem as they do any other system dependency;
but other people needn't be burdened by it.
So among Michael's choices:
| a) context-dependent glGetProcAddress (can we handle remote GLX with this?)
|
| b) context-independent glXGetProcAddress
|
| c) context-dependent glXGetProcAddress
|
| d) context-independent glGetProcAddress
I would say experience argues that (d) is the best design. Not only
does it make application and library developers' lives easier, but it
minimizes duplication of function among the window-system bindings,
and it can be implemented with decent efficiency.
But I would accept (b) as a fallback, given that Microsoft is unable
to implement (d).
There seems to be a consensus forming around (b).
Allen