glew icon indicating copy to clipboard operation
glew copied to clipboard

Source generation script rewrite

Open mariob92 opened this issue 3 years ago • 4 comments

Hello,

I'm writing a new source generation script from scratch.

If you are interested: https://github.com/MarBg92/glew/tree/source-gen-python It's in an early state yet, but it can already generate the wglew.h file.

Improvements:

  • It's far more faster: Don't need to download the whole OpenGL registry, it only needs the .xml files
  • It doesn't need to scan the extension specification text files and so it don't needs those ugly helper scripts (filter_gl_ext.sh) to hack in some missing function and enum definitions. (I haven't checked every single entry, but the few I have checked are all present in the .xml files)

At the moment there is no support for the GL_REGAL_* extensions (from the glfixes repo) yet, because it seems that this is no part of the official OpenGL Registry, but it should be no problem to write a small .xml file which then can be parsed in.

mariob92 avatar Aug 27 '21 06:08 mariob92

I applaud the effort to replace the Perl, Bash and Makefile code generation. If you can reach parity (generate the same code) it would be good for GLEW to switch over. Just so you know, there is some Python there already, but isn't a complete replacement, yet.

Things like Regal extensions probably don't matter in the real world, but it's hard to say for sure. I've been reluctant to curate, aiming for backwards compatibility for the most part.

nigels-com avatar Aug 28 '21 12:08 nigels-com

Anything further about this?

nigels-com avatar Apr 02 '22 02:04 nigels-com

I haven't done much on this in the last time, but there is already some progress. eglew.h, glxew.h and wglew.h can already be generated. I look forward to implement glew.h, glew.c and glewinfo.c soon.

But it would be hard to guarantee full backwards compatibility because GLEW has some legacy extensions (mostly REGAL and ANGLE) that are not part of the official OpenGL Registry. Maybe they can be hard coded into the source files.

mariob92 avatar Apr 02 '22 08:04 mariob92

Not hard to author a residual XML for REGAL, ANGLE etc. Don't let that be a blocker. But there will be a bunch of other nit-picky differences, I imagine.

nigels-com avatar Apr 02 '22 11:04 nigels-com