[HOpenGL] OpenGL-Raw generator

L Corbijn aspergesoepje at gmail.com
Wed Dec 7 22:10:15 CET 2011


Hello,
0123456789012345678901234567890123456789012345678901234567890123456789012

OpenGL Raw is still 'stuck' at version 3.2 of the OpenGL
Specification. Updating it to a more recent version (including adding
more extensions) is quite a task, and quite boring one too.
Fortunately there are specifications [1] which specifies all the
functions and enumeration values.

As a possible solution I've created a generator to generate the most
of the OpenGLRaw, including the most boring parts. The code has
(finally) been uploaded to Github and can be found at [2]. The current
situation is that it's almost undocumented and there are no options
yet (every path, etc. is hard-coded).

The current implementation (the develop branch) generates the following,
 *  Enum values and functions in line with the Spec files of OpenGL,
where for each category in the spec there is a corresponding module.
 *  Several grouping modules which group the previously modules in to
logical groups. The current implementation groups it into vendor
modules (with all extension from that vendor), and ones for the core
profiles.
 *  A list of all the modules generated, in a format that can be used
to make the cabal file.
Most of the base things (loading proc addresses, the bare cabal file,
the types) are reused for building the generated files. The biggest
change from OpenGLRaw is the layout of modules which define the core
of OpenGL. Raw has two modules (which get bundled) for defining all
enums and functions up to GL3.1. While the generator groups them into
modules by the spec version they were introduced, and makes an export
for each module. Furthermore, the use of the CPP to make the foreign
imports has abandoned as this wasn't really practical with
haskell-src-exts.

For those who are interested in building it, the major non-hackage
dependencies are:
 *  opengl-api, [3], A package by Vo Minh Thu to parse the OpenGL spec
files, you need the head of develop to parse the current specs.
 *  CodeGenerating, A package I made with all sorts of more generic
functions used to generate haskell code, based on haskell-src-exts.
Again take the head of develop for all the functions needed.
If you would just like the output of it all without the hassle of
building it, send email me for an archive.

I hope this tool could be made of use in updating the OpenGLRaw
package, as I currently see nobody doing it by hand. So if you have
any question or comment about the tool please email me.

Greetings,

Lars

[1] http://www.opengl.org/registry/#specfiles
[2] https://github.com/Laar/OpenGLRawgen
[3] https://github.com/Laar/opengl-api/tree/develop
[4] https://github.com/Laar/CodeGenerating/tree/develop



More information about the HOpenGL mailing list