Extension paranoia

While digging around for information on extension loaders, I eventually found a reference to the following from the wglGetProcAddress() documentation:

Remarks
The OpenGL library supports multiple implementations of its functions. Extension functions supported in one rendering context are not necessarily available in a separate rendering context. Thus, for a given rendering context in an application, use the function addresses returned by the wglGetProcAddress function only.

The spelling and the case of the extension function pointed to by lpszProc must be identical to that of a function supported and implemented by OpenGL. Because extension functions are not exported by OpenGL, you must use wglGetProcAddress to get the addresses of vendor-specific extension functions.

The extension function addresses are unique for each pixel format. All rendering contexts of a given pixel format share the same extension function addresses.

Is this really a concern, or is it pretty much safe to build a set of function pointers once and just keep using them.

It looks to me from the above that there is no truly kosher way of using the WGL_ARB_pixel_format functions.

Originally posted by gdewan:
It looks to me from the above that there is no truly kosher way of using the WGL_ARB_pixel_format functions.

I also noticed that some time ago and went to my teammates asking them if I could end up with useless pointers. After some days spent on researching the subject, the conclusions were that:
1- Officially, sharing pointers between different contextes is a call for trouble.
2- De facto, vendors are making our life easier by not changing their function pointers so, just select the pixel format with some care and everything should work fine.
3- Everyone is doing it possibly without realizing what’s going on and still works. So, why should I really care? If it crashes, I’ll fix but until then I’ll live with this.

Yes, it’s officially a big trouble.

You can be in big trouble if:

  • You change display settings / video mode. You may end up with the MS software driver, or with a pixel format that does not support extension XYZ.

  • You have a multi-display system, with different cards for each monitor (not sure how this would work).

I have not encountered these problems myself, but I figured they are the most likely causes of problems.

[This message has been edited by marcus256 (edited 02-20-2004).]

Vendors say that if the pixelformat for the other contexts are the same, then pointers are identical.

Even if pixel format are not the same, I have noticed that pointers are.

You could have a OO GL where each context is an object with it’s own pointers.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.