{"id":13451125,"url":"https://github.com/stackgl/headless-gl","last_synced_at":"2025-10-06T22:31:48.825Z","repository":{"id":6660274,"uuid":"7904864","full_name":"stackgl/headless-gl","owner":"stackgl","description":"🎃 Windowless WebGL for node.js","archived":false,"fork":true,"pushed_at":"2025-08-19T15:30:24.000Z","size":28197,"stargazers_count":1846,"open_issues_count":74,"forks_count":174,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-09-23T13:31:43.285Z","etag":null,"topics":["headless","webgl"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mikeseven/node-webgl","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-30T00:50:25.000Z","updated_at":"2025-09-17T06:52:05.000Z","dependencies_parsed_at":"2023-01-16T19:15:46.903Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/headless-gl","commit_stats":null,"previous_names":["mikolalysenko/headless-gl"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/stackgl/headless-gl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fheadless-gl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fheadless-gl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fheadless-gl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fheadless-gl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/headless-gl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fheadless-gl/sbom","scorecard":{"id":845392,"data":{"date":"2025-08-11","repo":{"name":"github.com/stackgl/headless-gl","commit":"cde2d0e8e919bffb2d7872cb1e62116729b30d38"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":9,"reason":"10 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'packages' permission set to 'read': .github/workflows/ci.yml:12","Info: jobLevel 'contents' permission set to 'read': .github/workflows/release.yml:54","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:18","Info: jobLevel 'packages' permission set to 'read': .github/workflows/release.yml:20","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":1,"reason":"Found 3/29 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":1,"reason":"binaries present in source code","details":["Warn: binary detected: deps/darwin/dylib/libEGL.dylib:1","Warn: binary detected: deps/darwin/dylib/libGLESv2.dylib:1","Warn: binary detected: deps/linux-arm64/so/libEGL.so:1","Warn: binary detected: deps/linux-arm64/so/libGLESv2.so:1","Warn: binary detected: deps/linux/so/libEGL.so:1","Warn: binary detected: deps/linux/so/libGLESv2.so:1","Warn: binary detected: deps/windows/dll/d3dcompiler_47.dll:1","Warn: binary detected: deps/windows/dll/libEGL.dll:1","Warn: binary detected: deps/windows/dll/libGLESv2.dll:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSES:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:48"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v9.0.0-rc.6 not signed: https://api.github.com/repos/stackgl/headless-gl/releases/220239098","Warn: release artifact v9.0.0-rc.4 not signed: https://api.github.com/repos/stackgl/headless-gl/releases/210845788","Warn: release artifact v9.0.0-rc.3 not signed: https://api.github.com/repos/stackgl/headless-gl/releases/210660404","Warn: release artifact v8.1.6 not signed: https://api.github.com/repos/stackgl/headless-gl/releases/182381889","Warn: release artifact v8.1.5 not signed: https://api.github.com/repos/stackgl/headless-gl/releases/182171805","Warn: release artifact v9.0.0-rc.6 does not have provenance: https://api.github.com/repos/stackgl/headless-gl/releases/220239098","Warn: release artifact v9.0.0-rc.4 does not have provenance: https://api.github.com/repos/stackgl/headless-gl/releases/210845788","Warn: release artifact v9.0.0-rc.3 does not have provenance: https://api.github.com/repos/stackgl/headless-gl/releases/210660404","Warn: release artifact v8.1.6 does not have provenance: https://api.github.com/repos/stackgl/headless-gl/releases/182381889","Warn: release artifact v8.1.5 does not have provenance: https://api.github.com/repos/stackgl/headless-gl/releases/182171805"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/stackgl/headless-gl/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/stackgl/headless-gl/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/stackgl/headless-gl/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/stackgl/headless-gl/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/stackgl/headless-gl/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/stackgl/headless-gl/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/stackgl/headless-gl/release.yml/master?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T21:18:52.677Z","repository_id":6660274,"created_at":"2025-08-23T21:18:52.677Z","updated_at":"2025-08-23T21:18:52.677Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278690974,"owners_count":26029171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["headless","webgl"],"created_at":"2024-07-31T07:00:48.556Z","updated_at":"2025-10-06T22:31:48.820Z","avatar_url":"https://github.com/stackgl.png","language":"C","readme":"# gl\n\n[![ci](https://github.com/stackgl/headless-gl/actions/workflows/ci.yml/badge.svg)](https://github.com/stackgl/headless-gl/actions/workflows/ci.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\n`gl` lets you create a WebGL context in [Node.js](https://nodejs.org/en/) without making a window or loading a full browser environment.\n\nIt aspires to fully conform to the [WebGL 1.0.3 specification](https://www.khronos.org/registry/webgl/specs/1.0.3/).\n\n## Example\n\n```javascript\n// Create context\nconst createGL = require('gl')\n\nconst width = 64\nconst height = 64\n\nconst gl = createGL(width, height, { preserveDrawingBuffer: true })\n\n//Clear screen to red\ngl.clearColor(1, 0, 0, 1)\ngl.clear(gl.COLOR_BUFFER_BIT)\n\n//Write output as a PPM formatted image\nconst pixels = new Uint8Array(width * height * 4)\ngl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels)\nprocess.stdout.write(['P3\\n# gl.ppm\\n', width, \" \", height, '\\n255\\n'].join(''))\n\nfor(let i = 0; i \u003c pixels.length; i += 4) {\n  for(let j = 0; j \u003c 3; ++j) {\n    process.stdout.write(pixels[i + j] + ' ')\n  }\n}\n```\n\n## Install\nInstalling `headless-gl` on a supported platform is a snap using one of the prebuilt binaries. Using [npm](https://www.npmjs.com/), run the command\n\n```\nnpm install gl\n```\n\nAnd you are good to go!\n\nPrebuilt binaries are generally available for LTS node versions (e.g. 20, 22, 24) until they reach EOL. If your system is not supported, then please see the [development](#system-dependencies) section on how to configure your build environment. Patches to improve support are always welcome!\n\n## Supported platforms and Node.js versions\n\ngl runs on Linux, macOS, and Windows.\n\nNode.js versions 20 and up are tested and supported. Earlier versions may still function, however.\n\n## API\n\n`headless-gl` exports exactly one function which you can use to create a WebGL context with the given context attributes:\n\n```javascript\nconst createGL = require('gl')\n\nconst gl = createGL(width, height)\n```\n\n* `width` is the width of the drawing buffer\n* `height` is the height of the drawing buffer\n* `contextAttributes` is an optional object whose properties are the [context attributes for the WebGLRendering context](https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2)\n\n**Returns** A new `WebGLRenderingContext` object\n\n### Extensions\n\nIn addition to all the usual WebGL methods, `headless-gl` exposes some custom extensions to make it easier to manage WebGL context resources in a server side environment:\n\n#### `STACKGL_resize_drawingbuffer`\n\nThis extension provides a mechanism to resize the drawing buffer of a WebGL context once it is created.\n\nIn a pure DOM implementation, this method would implemented by resizing the WebGLContext's canvas element by modifying its `width/height` properties. This canvas manipulation is not possible in headless-gl, since a headless context doesn't have a DOM or a canvas element associated to it.\n\n#### Example\n\n```javascript\nconst assert = require('assert')\nconst gl = require('gl')(10, 10)\nassert(gl.drawingBufferHeight === 10 \u0026\u0026 gl.drawingBufferWidth === 10)\n\nconst ext = gl.getExtension('STACKGL_resize_drawingbuffer')\next.resize(20, 5)\nassert(gl.drawingBufferHeight === 20 \u0026\u0026 gl.drawingBufferWidth === 5)\n```\n\n#### IDL\n```\n[NoInterfaceObject]\ninterface STACKGL_resize_drawingbuffer {\n    void resize(GLint width, GLint height);\n};\n```\n\n#### `ext.resize(width, height)`\nResizes the drawing buffer of a WebGL rendering context\n\n* `width` is the new width of the drawing buffer for the context\n* `height` is the new height of the drawing buffer for the context\n\n### `STACKGL_destroy_context`\n\nDestroys the WebGL context immediately, reclaiming all resources associated with it.\n\nFor long running jobs, garbage collection of contexts is often not fast enough. To prevent the system from becoming overloaded with unused contexts, you can force the system to reclaim a WebGL context immediately by calling `.destroy()`.\n\n#### Example\n\n```javascript\nconst gl = require('gl')(10, 10)\n\nconst ext = gl.getExtension('STACKGL_destroy_context')\next.destroy()\n```\n\n#### IDL\n\n```\n[NoInterfaceObject]\ninterface STACKGL_destroy_context {\n    void destroy();\n};\n```\n\n#### `gl.getExtension('STACKGL_destroy_context').destroy()`\nImmediately destroys the context and all associated resources.\n\n### Expiremental WebGL2 support\n\nTo create a WebGL 2 context, set the `createWebGL2Context` property to `true` in the `contextAttributes` argument.\n\n## System dependencies\n\nIn most cases installing `headless-gl` from npm should just work. However, if you run into problems you might need to adjust your system configuration and make sure all your dependencies are up to date. For general information on building native modules, see the [`node-gyp`](https://github.com/nodejs/node-gyp) documentation.\n\n#### Mac OS X\n\n* [Python 3](https://www.python.org/)\n* [XCode](https://developer.apple.com/xcode/)\n\n#### Ubuntu/Debian\n\n* [Python 3](https://www.python.org/)\n* A GNU C++ environment (available via the `build-essential` package on `apt`)\n* [libxi-dev](http://www.x.org/wiki/)\n* Working and up to date OpenGL drivers\n* [GLEW](http://glew.sourceforge.net/)\n* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)\n\n```\n$ sudo apt-get install -y build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config\n```\n\n#### Windows\n\n* [Python 3](https://www.python.org/)\n* [Microsoft Visual Studio](https://www.microsoft.com/en-us/download/details.aspx?id=5555)\n* d3dcompiler_47.dll should be in c:\\windows\\system32, but if isn't then you can find another copy in the deps/ folder\n\n## FAQ\n\n### How can I use headless-gl with a continuous integration service?\n\n`headless-gl` should work out of the box on most CI systems. Some notes on specific CI systems:\n\n* GitHub Actions: refer to the workflow files, specifially the `ci` workflow for an example.\n* [CircleCI](https://circleci.com/): `headless-gl` should just work in the default node environment.\n* [AppVeyor](http://www.appveyor.com/): Again it should just work\n* [TravisCI](https://travis-ci.org/): Works out of the box on the OS X image. For Linux VMs, you need to install mesa and xvfb. To do this, create a file in the root of your repo called `.travis.yml` and paste the following into it:\n\n```\nlanguage: node_js\nos: linux\nsudo: required\ndist: trusty\naddons:\n  apt:\n    packages:\n    - mesa-utils\n    - xvfb\n    - libgl1-mesa-dri\n    - libglapi-mesa\n    - libosmesa6\nnode_js:\n  - '20'\nbefore_script:\n  - export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start\n```\n\n### How can `headless-gl` be used on a headless Linux machine?\n\nIf you are running your own minimal Linux server, such as the one one would want to use on Amazon AWS or equivalent, it will likely not provide an X11 nor an OpenGL environment. To setup such an environment you can use those two packages:\n\n1. [Xvfb](https://en.wikipedia.org/wiki/Xvfb) is a lightweight X11 server which provides a back buffer for displaying X11 application offscreen and reading back the pixels which were drawn offscreen. It is typically used in Continuous Integration systems. It can be installed on CentOS with `yum install -y Xvfb`, and comes preinstalled on Ubuntu.\n2. [Mesa](https://docs.mesa3d.org) is the reference open source software implementation of OpenGL. It can be installed on CentOS with `yum install -y mesa-dri-drivers`, or `apt-get install libgl1-mesa-dev`. Since a cloud Linux instance will typically run on a machine that does not have a GPU, a software implementation of OpenGL will be required.\n\nInteracting with `Xvfb` requires you to start it on the background and to execute your `node` program with the DISPLAY environment variable set to whatever was configured when running Xvfb (the default being :99). If you want to do that reliably you'll have to start Xvfb from an init.d script at boot time, which is extra configuration burden. Fortunately there is a wrapper script shipped with Xvfb known as `xvfb-run` which can start Xvfb on the fly, execute your Node.js program and finally shut Xvfb down. Here's how to run it:\n\n    xvfb-run -s \"-ac -screen 0 1280x1024x24\" \u003cnode program\u003e\n\n### Does headless-gl work in a browser?\n\nYes, with [browserify](http://browserify.org/). The `STACKGL_destroy_context` and `STACKGL_resize_drawingbuffer` extensions are emulated as well.\n\n### How are `\u003cimage\u003e` and `\u003cvideo\u003e` elements implemented?\n\nThey aren't for now. If you want to upload data to a texture, you will need to unpack the pixels into a `Uint8Array` and feed it into `texImage2D`. To help reading and saving images, you should check out the following modules:\n\n* [`get-pixels`](https://www.npmjs.com/package/get-pixels)\n* [`save-pixels`](https://www.npmjs.com/package/save-pixels)\n\n### What extensions are supported?\n\nOnly the following for now:\n\n* [`STACKGL_resize_drawingbuffer`](https://github.com/stackgl/headless-gl#stackgl_resize_drawingbuffer)\n* [`STACKGL_destroy_context`](https://github.com/stackgl/headless-gl#stackgl_destroy_context)\n* [`ANGLE_instanced_arrays`](https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/)\n* [`OES_element_index_uint`](https://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/)\n* [`OES_texture_float`](https://www.khronos.org/registry/webgl/extensions/OES_texture_float/)\n* [`OES_texture_float_linear`](https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/)\n* [`OES_vertex_array_object`](https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/)\n* [`OES_standard_derivatives`](https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/)\n* [`WEBGL_draw_buffers`](https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/)\n* [`EXT_blend_minmax`](https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/)\n* [`EXT_texture_filter_anisotropic`](https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/)\n* [`EXT_shader_texture_lod`](https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/)\n\n### Why use this thing instead of `node-webgl`?\n\nDespite the name, [node-webgl](https://github.com/mikeseven/node-webgl) doesn't actually implement WebGL - rather it gives you \"WebGL\"-flavored bindings to whatever OpenGL driver is configured on your system. If you are starting from an existing WebGL application or library, this means you'll have to do a bunch of work rewriting your WebGL code and shaders to deal with all the idiosyncrasies and bugs present on whatever platforms you try to run on. The upside though is that `node-webgl` exposes a lot of non-WebGL stuff that might be useful for games like window creation, mouse and keyboard input, requestAnimationFrame emulation, and some native OpenGL features.\n\n`headless-gl` on the other hand just implements WebGL. It is built on top of [ANGLE](https://bugs.chromium.org/p/angleproject/issues/list) and passes the full Khronos ARB conformance suite, which means it works exactly the same on all supported systems. This makes it a great choice for running on a server or in a command line tool. You can use it to run tests, generate images or perform GPGPU computations using shaders.\n\n### Why use this thing instead of [electron](http://electron.atom.io/)?\n\nElectron is fantastic if you are writing a desktop application or if you need a full DOM implementation. On the other hand, because it is a larger dependency electron is more difficult to set up and configure in a server-side/CI environment. `headless-gl` is more modular in the sense that it just implements WebGL and nothing else. As a result creating a `headless-gl` context takes just a few milliseconds on most systems, while spawning a full electron instance can take upwards of 15-30 seconds. If you are using WebGL in a command line interface or need to execute WebGL in a service, `headless-gl` might be a more efficient and simpler choice.\n\n### How should I set up a development environment for headless-gl?\n\nAfter you have your [system dependencies installed](#system-dependencies), do the following:\n\n1. Clone this repo: `git clone git@github.com:stackgl/headless-gl.git`\n1. Switch to the headless gl directory: `cd headless-gl`\n1. Install npm dependencies: `npm install`\n1. Run node-gyp to generate build scripts: `npm run rebuild`\n\nOnce this is done, you should be good to go! A few more things\n\n* To run the test cases, use the command `npm test`, or execute specific tests by just running them using `node`.\n* On a Unix-like platform, you can do incremental rebuilds by going into the `build/` directory and running `make`. This is **way faster** running `npm build` each time you make a change.\n\nNote: the `gl-conformance` package is currently hosted on GitHub Package Registry. To install from there, you may need to add `//npm.pkg.github.com` to your user directory's `.npmrc` file\n\n## License\n\nSee LICENSES\n","funding_links":[],"categories":["Tools","C","HarmonyOS","JavaScript"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fheadless-gl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fheadless-gl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fheadless-gl/lists"}