node-glfw-bindings
GLFW 3.1.2 bindings for Node.js
Supported Platforms
The following platforms are officially supported:
- Windows
The following platforms are not officially supported at this time, but should work:
- Mac
The following platforms are on the track to be officially supported:
- Linux
Installing
Before you can install this package, you must have the necessary dependencies available on your system. These dependencies are:
- Node.js version 5.0.0 or later
- Earlier versions of Node.js may work, but are not supported officially
-
node-gyp
and its dependencies - GLFW 3.1.2 or compatible
- GLFW 3.1.2 for Windows x86/x64 and Visual Studio 2015 are provided with this package
Simply run npm install --save node-glfw-bindings
to install and build the
package.
API
Refer to the official GLFW 3.1.2 documentation at http://www.glfw.org/ for how to use the APIs available. This package is a straight binding for GLFW and provides no additional functionality.
All functions may be accessed using their GLFW signature.
Basic Example
The following is a basic example of using this package:
var nodeglfw = require('node-glfw-bindings');
var glfwWindow;
if (!nodeglfw.glfwInit()) {
console.error('Failed to initialize GLFW');
process.exit(1000);
}
glfwWindow = nodeglfw.glfwCreateWindow(640, 480, "GLFW Window");
if (glfwWindow == null) {
console.error('Failed to create window');
nodeglfw.glfwTerminate();
process.exit(1001);
}
while(!nodeglfw.glfwWindowShouldClose(glfwWindow)) {
// Do stuff here
nodeglfw.glfwPollEvents();
nodeglfw.glfwSwapBuffers(glfwWindow);
}
nodeglfw.glfwTerminate();
License
The MIT License (MIT)
Copyright (c) 2016 M. Damian Mulligan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.