OpenGL bindings for OCaml

This package provides OpenGL bindings for OCaml. There is a module for GL, Glu and Glut, and also some small image loader modules for different image file formats.
The names of the functions are the same than in the C API.
This package provides test files and demonstration samples from the Red-Book converted to OCaml.
less details


glMLite can be compiled with any of these OpenGL versions: 1.2, 1.3, 1.4, 2.0 or 2.1.
Also glMLite is ready to develop forward compatible OpenGL 3.X programs!

glMLite also provides bindings for the GLE, and FTGL libraries.
The GLE library provides functions to draw extruded surfaces, including surfaces of revolution, sweeps, tubes, polycones, polycylinders and helicoids.
FTGL is a library for rendering TrueType fonts in OpenGL.

The jpeg texture loader is optimised for use with OpenGL, there are no unneeded buffer allocations and copy, the loader first allocs an ocaml big-array which is provided to the libjpeg so that the datas are directly loaded into this bigarray. The bigarray can then be provided to OpenGL, after what it can be garbage-collected by OCaml.

There are also texture loaders for PNG and SVG which respectively use the libraries libpng and librsvg. There is also a generic texture loader for any image file format which uses the libMagick (the library of ImageMagick).
If the image to load is known to be a jpeg, a png or a svg, one should use the specialised modules Jpeg_loader, Png_loader and Svg_loader instead which will be far more efficient, because the libMagick uses 16 bits color depth instead of 8 bits color depth, which means that every pixel components will be multiplied by 256 when loading and divided back by 256 before to provide the data to OpenGL. (Which means 196608 unnedded multiplications and 196608 unnedded divisions for a 256x256 texture.)


This package is known to work under Linux and Mac OS X.
For MS Windows, well, OpenGL is a portable API and OCaml is a portable programming language, so compiling for Windows shouldn't be that hard.


glMLite's sources are managed under github:

git clone