Ann: Bindings for SDL and OpenGL 2.0 plus extensions

Skip to first unread message

Elliott Oti

Jun 30, 2006, 6:53:51 PM6/30/06
In the interests of reinventing the wheel where possible, I wrote OCaml
bindings for the SDL libraries and OpenGL libraries over a couple of

The (automatically generated) OpenGL bindings cover OpenGL 1.1, 1.2,
1.3, 1.4, 1.5, 2.0 and most current non-platform-specific extensions.
There are no dependencies whatsoever: the system opengl shared library
is loaded dynamically, and the functions are called dynamically, so
there is no need to link against import libraries.

The SDL bindings are fairly but not wholly complete; they are
hand-written and functions are bound on an as-needed-by me basis. They
are only dependent on the SDL main library and not on the mixer, ttf or
image libraries. Because I wanted to have basic sound capabilities, the
SDL_Audio modules are implemented, along with extra functions for
panning and pitch shifting audio buffers.

In addition there are functions written in OCaml to load uncompressed
and RLE-encoded TGA files, scale bitmaps with different filters
(currently, only box, tent and lanczos3 filters are implemented),
generate mip-maps suitable for usage in OpenGL, and a complete port
from C to OCaml of the SFont bitmapped text library.

This is very much a work-in-progress, and is currently at version 0.1.
It has been tested on Windows 2000, Windows XP, and Ubuntu Linux on
AMD64. It compiles as-is with the mingw port of OCaml 3.09 and on
Linux. It has not been tested on any other platform. There are around
20 example files. SDLCaml and GLCaml are being written primarily for my
personal needs but are being released in the hope that someone finds
them useful. Feedback is welcome.

SDLCaml and GLCaml are released under the LGPL, version 2.

Main site:

Gzipped source tarball:


Reply all
Reply to author
0 new messages