ElliottOti.com
 

OGLFW 0.4, Ocaml bindings for GLFW 2.4.2

Quite some time ago (2003, I think) I wrote an Ocaml wrapper for the GLFW library. I came across it recently and decided to release it to the public, for what it’s worth.

Download oglfw 0.4 here

Screenshots

From the readme.txt:

This release is version 0.4.
At this point there are no guarantees whatsoever with regards
to usability, compilability, correctness, or stability.

About

glfw (http://glfw.sourceforge.net) is an open-source framework for OpenGL
application development.

ocaml (http://www.ocaml.org) is a functional programming language.

oglfw is a collection of C and ML source code that can be used to call glfw
functions directly from ocaml. The tool camlidl
was used to generate most of the function wrappers. The source code for
glfw callbacks was taken from camlgl source code (see below).

A binding for glfw 2.3.0 already exists: camlgl
This consists, as far as I can tell, of handwritten wrapper code. The difference
between camlgl and oglfw is negligible.
* oglfw wraps version 2.4.2; camlgl wraps version 2.3.0.

Contents

The file oglfw-0.4.tar.gz contains the following files:

Building

This has only been tested under mingw and mandrake linux 10.0, with ocaml 3.08 (mingw version) and gcc 3.2
It will probably work as well with ocaml > 3.05 and gcc >= 2.95.2 under both mingw and linux
It may work with ocaml 3.06 (msvc version) and Microsoft Visual C++ 6.0.
It does not work with ocaml 3.06 (msvc version) and the free version of Visual C++ Net that comes
with the Dot Net SDK, either version 1.0, or 1.1; there are linker problems.

Required:

Unzip all files into a directory and run make.

Usage

The file keytest.ml is an example of how it may be used. Assumes both glfw and camlidl are installed and available.
On windows/MinGW build with:

ocamlopt -o keytest.exe oglfw.c glfw.mli glfw.ml keytest.ml -cclib -lglfw -cclib -lopengl32 -cclib -lglu32 -cclib -lcamlidl -cclib -lole32

On Linux build with:

ocamlopt -o keytest.exe oglfw.c glfw.mli glfw.ml keytest.ml -cclib -L/usr/X11R6/lib -cclib -lglfw -cclib -lGLU -cclib -lGL -cclib -lX11 -cclib -lXxf86vm -cclib -lXext -cclib -lpthread -cclib -lm -cclib -lcamlidl



Comments

No comments yet.

RSS feed for comments on this post.



Leave a comment

Sorry, the comment form is closed at this time.