Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/node-3d/glfw-raub
GLFW for Node.js
https://github.com/node-3d/glfw-raub
addon bindings cpp gl glfw graphics javascript native node-3d opengl window
Last synced: 4 days ago
JSON representation
GLFW for Node.js
- Host: GitHub
- URL: https://github.com/node-3d/glfw-raub
- Owner: node-3d
- License: mit
- Created: 2017-01-22T16:50:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-01-09T07:37:42.000Z (about 1 month ago)
- Last Synced: 2025-02-03T15:51:48.257Z (11 days ago)
- Topics: addon, bindings, cpp, gl, glfw, graphics, javascript, native, node-3d, opengl, window
- Language: C++
- Homepage: https://github.com/node-3d/node-3d
- Size: 20.7 MB
- Stars: 59
- Watchers: 2
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# GLFW for Node.js
This is a part of [Node3D](https://github.com/node-3d) project.
[![NPM](https://badge.fury.io/js/glfw-raub.svg)](https://badge.fury.io/js/glfw-raub)
[![ESLint](https://github.com/node-3d/glfw-raub/actions/workflows/eslint.yml/badge.svg)](https://github.com/node-3d/glfw-raub/actions/workflows/eslint.yml)
[![Test](https://github.com/node-3d/glfw-raub/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/glfw-raub/actions/workflows/test.yml)
[![Cpplint](https://github.com/node-3d/glfw-raub/actions/workflows/cpplint.yml/badge.svg)](https://github.com/node-3d/glfw-raub/actions/workflows/cpplint.yml)```console
npm i -s glfw-raub
```**Node.js** addon with **GLFW3** bindings.
![Example](examples/screenshot.jpg)
* **GLFW** version **3.4.0** 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.> 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.## 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](http://www.glfw.org/docs/latest/group__window.html)
for useful info on what it does and doesn't.```js
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 [TypeScript definitions](/index.d.ts) for more details.
----------
### class Window
```js
const { Window } = require('glfw-raub');
```This class helps managing window objects and their events. It can also switch between
fullscreen, borderless and windowed modes.See [TypeScript definitions](/index.d.ts) for more details.
----------
### class Document
```js
const { Document } = require('glfw-raub');
```It can be used to facilitate the environment for other
JS libraries, such as [three.js](https://threejs.org/).See [TypeScript definitions](/index.d.ts) for more details.