oglfw: Ocaml bindings for glfw 2.4.2
=====================================

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 (http://caml.inria.fr/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 (http://camlgl.sourceforge.net)
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:
* makefile  
* readme.txt
* lib/glfw.h - camlidl-generated header file
* lib/oglfw.c - c stub code (partly generated from camlidl, partly handwritten)
* lib/glfw.ml - ml functions and constants
* lib/glfw.mli - ml function interface
* examples/keytest.ml - example file based on the glfw keytest.c example, adapted from the camlgl distribution
* examples/listmodes.ml - example file based on the glfw listmodes.c example
* examples/mthello.ml - example file based on the glfw mthello.c example
* examples/triangle.ml - example file based on the glfw triangle.c example. Utilises lablGL
* examples/mipmaps.ml - example file based on the glfw mipmaps.c example. Utilises lablGL

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:
	ocaml 3.08 (mingw version) (http://www.ocaml.org)
	msys (optional, for building on windows http://www.mingw.org/msys.shtml)
	gcc 3.2 (may work with versions from 2.95.2 and up but this is untested)
	glfw 2.4.0 or later (http://glfw.sourceforge.net/)
	camlidl 1.01 or later (http://caml.inria.fr/camlidl/)
	lablGL 1.0 or later (for the examples mipmaps and triangles http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html)
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 


License
========

oglfw is licensed under the zlib/png license:

Copyright (c) 2005 Elliott Oti (excluding portions taken from camlgl)

This software is provided 'as-is', without any express or implied warranty. 
In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, 
including commercial applications, and to alter it and redistribute it freely, 
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you 
wrote the original software. If you use this software in a product, 
an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be 
misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.


-- Elliott Oti
