Reason interface to GL.


Install
npm install reglinterface@0.1.19

Documentation

ReGL

Simple bindings to opengl 2.0 and webgl.

100% shared code: you write Reason code, and the build system chooses the right backend for you, native or web. This library exposes bindings to both webgl and opengl to be used from Reason.

If you want to get started quickly, check out ReglExampleProject. It's a great starting point to any project using ReGl and a simple tutorial.

ReWitness is a big example project using those bindings.

All of the method names are taken directly from opengl, and their docs should apply.

Where is the code

The code for this is actually in packages, dividing into 3 sub projects: reglinterface, reglnative, reglweb.

  • reglinterface This exposes the common interface to both backends (see ReglExampleProject). This also contains the Constants module which contains a bunch of numbers that are needed for a lot of GL functions.
  • reglnative This is the native backend, which uses OpenGL 2.1.
  • reglweb This is the web backend, which uses WebGL.

We use lerna to manage this repo and publish to npm each package separately.

How to build

You'll need esy installed. Then run

esy install && esy build && npm run buildexample

To run simply do npm run start.