GLFW binding for Duktape
C JavaScript CMake
Latest commit f867149 Feb 27, 2016 @lzubiaur Add travis status badge
Permalink
Failed to load latest commit information.
tests Fix typo Feb 27, 2016
.gitignore Add gitignore file Feb 27, 2016
.travis.yml Install a decent CMake version Feb 27, 2016
CMakeLists.txt Disable GLFW options Feb 27, 2016
README.md Add travis status badge Feb 27, 2016
duk_glfw.c Initial commit Feb 27, 2016
duk_glfw.h Initial commit Feb 27, 2016

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