GLEX - Introducing yet another extension "library"

Hi,

although I’m aware of GLEW, GLee and several others, I could not resist writing my own extension “library”. In fact, it’s not a library, but a tool to generate extension initialization code from OpenGL extension specification text files.

For the impatient (like me), here’s the link to GLEX (as it is called) before going into the details:
http://gale.berlios.de/glex/

What makes it slightly different than the other approaches is that it parses one spec at a time, generating three files to include into your project to use that particular extension. This was one of my requirements, so I could easily include only those extensions I need to reduce code size. It also improves readability and the time to find code for a specific extension as there is no single monolithic source file.

Another feature is that it is written in PHP, and works as both a command line script or web interface (which is what the link above points to). So you could either include the script into the build process of your project (which is what I have done for the GALE project at http://gale.berlios.de/ , which GLEX is part of) to parse local copies of the spec files (which GLEX can download for you from various extension registries) or just use the web interface once to generate code to initialize e.g. the new G80 extensions because your favorite extension library that you usually use does not yet support them.

Although I regard GLEX to be somewhere between alpha and beta stage, I think one or the other might be interested to give it a try already to give me some early feedback. Moreover, there are a lot of extensions out there, and I expect GLEX not to handle them all flawlessly yet. Especially extensions that introduce new defines or datatypes will most likely not be parsed correctly (bummer), but that will change soon.

So, please let me know what you think. For specific bugs or patches, please use the BerliOS project page instead of posting to this forum:

http://developer.berlios.de/projects/gale/

Thanks!

Do you also support the different OpenGL versions (1.5, 2.0, 2.1)? Do you support multiple OpenGL contexts?

There is no check if all entry points that are required for a particular OpenGL version are available, if that’s what you mean. I prefer to look at the string glGetString(GL_VERSION) returns for simplicity.

Multiple contexts are also not supported (yet?). I’ve newer had a use for them, but if there’s enough demand and it does not add too much overhead (in terms of code size; keeping that small is my primary goal), I’ll probably add it.

And I totally forgot: Linux support is also missing right now, but that will definitely be something I’ll implement.

Very convenient!I haven’t tried it in code yet but it looks good…I have always thought of using the macro processor for extension initialization but the function prototypes are in capitals, so I couldn’t use something like #define init(extname) pfn#extname#proc extname = (pfn#extname#proc)wglGetProcAddress(extname);
An extension parser looks like the way to go!

I’ve decided to give it a try. First extension in the list and… doh!
http://oss.sgi.com/projects/ogl-sample/registry/ARB/multitexture.txt

Specs no longer available.
If GLEX wil be based only on extensions specs, then on Windows you’ll get only OpenGL 1.1 + Extensions but no core OpenGL 1.2 - 2.1 functions.

Still, I believe it’s a great tool if you want to play around with latest extensions. If someone bought GeForce 8800 then he doesn’t ned to wait for updated version of GLEE or GLEW. As soon as the specs are out you’re ready to go. So many thanks for this tool dude!

Shouldn’t the generated …procs.h file contain something more?
Here is the specs file I parsed:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/shader_objects.txt

Originally posted by k_szczech:
If GLEX wil be based only on extensions specs, then on Windows you’ll get only OpenGL 1.1 + Extensions but no core OpenGL 1.2 - 2.1 functions.
True. I admit I tend to forget that OpenGL 1.1 + extensions != OpenGL 2.0 (or 2.1), as some extension semantics change when they are promoted to the core. I have not yet decided if and how to handle OpenGL > 1.1 on Windows.

Originally posted by k_szczech:
Shouldn’t the generated …procs.h file contain something more?
Here is the specs file I parsed:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/shader_objects.txt

Sorry for the delay, the issue should be fixed now, see:

http://gale.berlios.de/glex/parse.php?sp…der_objects.txt

If you encounter any other bugs, please use the tracker at http://developer.berlios.de/bugs/?group_id=5400 as I won’t be monitoring this thread all the time.

Thanks!

Due to BerliOS’ continued outage, I’ve created a mirror at http://threekings.tk/gale/glex/

Seems like moving to SourceForge would be good idea …