Home

Awesome

Build Status Build Status npm version

reason-glfw

Cross-platform Reason / OCaml bindings for GLFW - supports Native (OpenGL) and Javascript (WebGL))

Building

esy is used for building, so if you don't have esy, install it:

npm install -g esy@0.4.9

NOTE: If you've never built with esy before, the first compile could take some time - it builds the ocaml compiler as well as cmake. Incremental builds, though, are extremely fast!

Running

A very simple example project is provided - you can test it out here:

NATIVE:

WEB:

License

This project is licensed under the MIT License - see LICENSE for more details.

Design

For the most part, we strive to have API compatibility for GLFW and OpenGL. This library supports compilation to both native and JSOO targets. In the JSOO case, we emulate the GLFW APIs.

We do have some exceptions:

glfwGetNativeWindow

We wrap the native window access functions in a function glfwGetNativeWindow. This returns a NativeWindow.t, where the underlying value is platform specific:

Acknowledgements