skaslev / gl3w

Simple OpenGL core profile loading
http://github.com/skaslev/gl3w
The Unlicense
709 stars 160 forks source link

Generate gl3w.h directly from XML #27

Open tombsar opened 8 years ago

tombsar commented 8 years ago

Khronos generates their GL headers (including glcorearb.h) from XML files using a Python script (https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/genheaders.py).

Would it make sense for gl3w to parse the structured XML directly, rather than interpreting the generated headers? Less scope for error imho.

laranzu commented 7 years ago

OK this is old but I'll add a comment anyway: possible but a LOT of work. The official header generator that takes XML and creates .h files can be downloaded from opengl.org. It is about 1800 lines of Python, although it is a bit more complicated because it has to handle older versions of OpenGL plus EGL and GLES as well. I started writing my own loader generator for just OpenGL 3/4 from XML and it's over 900 lines of code without being complete yet. gl3w is amazingly small and simple by comparison.