0.0.52 • Published 6 years ago

glfwjs v0.0.52

Weekly downloads
16
License
MIT
Repository
-
Last release
6 years ago

This is currently a very barebones addon/toy project that introduces simple, lightweight bindings to GLFW in JavaScript.

The module is organized as a namespace, with each function matching its C equivalent sans the 'glfw'.

The code below will create a 800x600 application titled 'Hello, World!' that consists of a black screen, and exits upon hitting Escape.

const glfw = require('glfwjs');

if (glfw.Init()) {
    
    let window = glfw.CreateWindow(800, 600, 'Hello, World!'); 
    // The monitor and share parameters still exist, 
    // but hold values of 0 (aka NULL) by default.

    while (glfw.WindowShouldClose(window) && glfw.GetKey(window, glfw.Keys.ESCAPE) != glfw.KeyActions.PRESS) {

        glfw.SwapBuffers(window);
        glfw.PollEvents();

    }

    glfw.DestroyWindow(window);

    glfw.Terminate();

}
0.0.52

6 years ago

0.0.51

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago