![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
webgl-raub
Advanced tools
This is a part of Node3D project.
npm i -s webgl-raub
WebGL/OpenGL bindings. The addon does not provide a window control system, and it can not set up an OpenGL context on its own. This API simply maps the native OpenGL function calls to their JS counterparts.
TL;DR: For a quick start, use 3d-core-raub or try the Examples (and note package.json).
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.
const webgl = require('webgl-raub');
Here webgl
contains the WebGL API, like a WebGLRenderingContext
instance would. See
WebGLRenderingContext docs
for reference, and TypeScript definitions for the full list of exports.
There are also numerous non-WebGL methods exported in case you want to use advanced OpenGL functions.
To use browser WebGL libs, like three.js, several additional interfaces must also be provided to mimic the browser.
Those two are bundled into the 3d-core-raub in a following manner:
const image = require('image-raub');
const webgl = require('webgl-raub');
const { Document } = require('glfw-raub');
Document.setImage(image); // plug this Image impl into the Document
Document.setWebgl(webgl); // plug this WebGL impl into the Document
const doc = new Document();
global.document = global.window = doc;
const canvas = document.createElement('canvas'); // === doc
const gl = canvas.getContext('webgl'); // === webgl
You can optionally call webgl.init()
after the GL context becomes available - this translates
into a glewInit()
call. See GLEW docs for what
it does and if you need it (probably "yes"?).
OSX Note: some features may depend on OpenGL profile being used. Core profile is necessary for VAO and other OpenGL 3.2+ features. Depending on your windowing backend, set the OpenGL profile of your preference. In case glfw-raub is used, the profile can be set through the
Window
/Document
constructor or withglfw.windowHint
calls.
Using node-3d-core, you can skip setting up most environment features for those libs.
FAQs
WebGL for Node.js
We found that webgl-raub demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.