OpenGL extension bindings

I made a windows JScript to download the current glext.h and wglext.h and make GLextDefines.cpp and GLextDefines.h. These files simply expose the extension functions and update their pointers using updateGLProcs(). Just call updateGLProcs() after wglMakeCurrent to update the pointers.

It can be downloaded from

Hurray, you replicated GL3W in JavaScript :wink:

I know, but I like mine better. You might too.

I will never have to edit it, and it automatically covers all the extensions. It uses glext.h and wglext.h instead of gl3.h(used by GL3W) as a source. It looks like GLEW from their log needs to be updated periodically, mine doesn’t.

Well, the problem that yours and GL3W has is that glext.h and gl3.h are both built from the .spec files. And if there are any errors in those .spec files, they will be propagated directly into your headers.

A build system that has user intervention allows you to correct errors in the .spec files. For example, this entire array of errors will only be fixed if the header files are fixed.

The official files look like they have the core correct, just a few errors with extensions. I had no idea the OpenGL registry files were so bad. Do they get corrected quickly?

Also I suppose I could make the program use .spec files instead, and let the user pick the source.

Do they get corrected quickly?

You’re kidding, right?

Also I suppose I could make the program use .spec files instead, and let the user pick the source.

That wouldn’t help. The main difficulty is that you can’t trust either source to be 100% correct. I mean, they’re close, but if there are errors, then the only recourse you have is to wait until they get fixed.

What you need is the ability to use diffs or something to correct whatever you download, so that you can ensure that certain errors are always fixed.

I essentially do that through my Mercurial repo. I maintain a special branch consisting solely of my changes to the .spec files. So if the .spec files change, I download the new ones and apply any fixes where necessary. That way, I’m always able to build GL Load based on corrected .spec files. It’s just a simple Mercurial merge.

Yes, it’s a manual process; it doesn’t automagically update to new versions. But you’re more likely to come out the other side with working stuff.

I remember in the OpenGL 1.5 - 2.0 days the .spec file had lots of errors I felt the need to update by hand. I just figured with the specification getting so much more attention now days that they keep their files in better shape.

GL Load looks nice, I’ll investigate it more.

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