Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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

About

GLFW binding for Duktape

Topics

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.