Skip to content

node-3d/glfw-raub

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

GLFW for Node.js

This is a part of Node3D project.

NPM CodeFactor

npm i glfw-raub

Node.js addon with GLFW3 bindings.

Note: this addon uses N-API, and therefore is ABI-compatible across different Node.js versions. Addon binaries are precompiled and there is no compilation step during the npm i command.

Example

  • GLFW version 3.3.4 backend.
  • Exposes low-level GLFW interface.
  • Multiple windows for a single Node.js process.
  • Able to switch to fullscreen and back.
  • Has Window class, simplifying low-level interactions.
  • Has Document class, capable of tricking other libs, as if we are in a browser.

GLFW

This is a low-level interface, where most of the stuff is directly reflecting GLFW API. It does NOT EXPOSE OpenGL commands. See GLFW Docs for useful info on what it does and doesn't.

const glfw = require('glfw-raub');

Here glfw is an API container, where all glfw* functions are accessible as glfw.*. E.g. glfwSetWindowTitle -> glfw.setWindowTitle.

See TypeSctipt defenitions for more details.


class Window

const { Window } = glfw;

This class helps managing window objects and their events. It can also switch between fullscreen, borderless and windowed modes.

See TypeSctipt defenitions for more details.


class Document

const { Document } = glfw;

It can be used to facilitate the environment for other JS libraries, such as three.js.

See TypeSctipt defenitions for more details.