[HOpenGL] How's it done?

Chris Campbell cyberdanx at gmail.com
Tue Sep 20 17:56:57 EDT 2005


Hi,

Hope you forgive the intrusion of an OCaml user. :)  I'm interested in
how HOpenGL is built.  Ocaml has two bindings to OpenGL and while
usuable, they are not kept up to date (mostly 1.0 with a few 1.1
functions thrown in), so I'm exploring two options; extending one of
the current bindings manually or building a new one, hopefully
automating part of the process (or possibly a hybrid approach).

The web pages look a little out of date, but from what I can gather
this is what I think happens.  First, the spec files are parsed and
the types and functions are noted.  Next a flat C and Haskell file are
generated from the info from the previous stage.  The C file
interfaces with haskell runtime.  Conversion from Haskell types to the
numerical values of enumerations is done in the Haskell layer.  The
functions in the haskell file are then called by a set of hierachical
modules which have been manually created and turn the flat GL
namespace into a hierachical one.  Is that about right or am I missing
something/way off on a tangent?

Obviously there are differences between OCaml and Haskell and the
FFIs, but I'd appreciate any advice.  The most difficult part looks
like mapping between C types and Ocaml types due to the stronger
typing.


Thanks for your time and sorry for the intrusion,
Chris


More information about the HOpenGL mailing list