GLFW binding for Duktape
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
.travis.yml
CMakeLists.txt
README.md
duk_glfw.c
duk_glfw.h

README.md

GLFW binding for Duktape

Build Status

Binding of the OpenGL GLFW API for the Duktape JavaScript engine.

To use the binding just include duk_glfw.c and duk_glfw.h into your project and call dukopen_glfw to load the module.

#include "duk_glfw.h"

int main() {

  // Create Duktape heap...

  // Load the module
  duk_push_c_function(ctx, dukopen_glfw, 0);
  duk_call(ctx, 0);
  duk_put_global_string(ctx, "glfw");

}

Now you can call GLFW functions from JavaScript using the glfw global object.

  glfw.setErrorCallBack(myErrorHandler);
  glfw.init();
  var window = glfw.createWindow(480, 320, 'my(window');

See tests/glfw.js for more examples.

Build the tests

The CMake script will download both GLFW and Duktape before building the tests.

mkdir build && cd build
cmake ..
make
./duk_glfw

License

MIT License