Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
{
'target_name': 'webgl',
'defines': [
'VERSION=1.0.0'
'VERSION=1.0.0',
'NAPI_VERSION=8'
],
'sources': [
'src/native/bindings.cc',
Expand All @@ -21,10 +22,11 @@
'src/native/angle-loader/gles_loader.cc'
],
'include_dirs': [
"<!(node -e \"require('nan')\")",
"<!@(node -p \"require('node-addon-api').include\")",
'<(module_root_dir)/deps/include',
"src/native/angle-includes"
],
'defines': ['NAPI_DISABLE_CPP_EXCEPTIONS'],
'library_dirs': [
'<(module_root_dir)/deps/<(platform)'
],
Expand Down Expand Up @@ -52,6 +54,9 @@
}
]
}],
['OS=="linux"', {
'ldflags': ['-Wl,-rpath,$$ORIGIN'],
}],
['OS=="linux" and target_arch=="arm64"', {
"copies": [
{
Expand Down
Binary file modified deps/darwin/dylib/libEGL.dylib
Binary file not shown.
Binary file modified deps/darwin/dylib/libGLESv2.dylib
Binary file not shown.
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ declare function createContext(
options?: WebGLContextAttributes & { createWebGL2Context?: boolean }
): (WebGLRenderingContext | WebGL2RenderingContext) & createContext.StackGLExtension;

export = createContext;
export default createContext;
export { createContext };
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ if (typeof WebGLRenderingContext !== 'undefined') {
} else {
module.exports = require('./src/javascript/node-index')
}
module.exports.WebGLRenderingContext = require('./src/javascript/webgl-rendering-context').WebGLRenderingContext
module.exports.WebGL2RenderingContext = require('./src/javascript/webgl-rendering-context').WebGL2RenderingContext
module.exports.WebGLRenderingContext =
require('./src/javascript/webgl-rendering-context').WebGLRenderingContext
module.exports.WebGL2RenderingContext =
require('./src/javascript/webgl-rendering-context').WebGL2RenderingContext
9 changes: 9 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createRequire } from 'module'
const _require = createRequire(import.meta.url)
const mod = _require('./index.js')

export const createHeadlessGL = mod
export const createContext = mod
export const WebGLRenderingContext = mod.WebGLRenderingContext
export const WebGL2RenderingContext = mod.WebGL2RenderingContext
export default mod
112 changes: 71 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
"version": "9.0.0-rc.9",
"description": "Creates a WebGL context without a window",
"main": "index.js",
"browser": "src/javascript/browser-index.js",
"browser": "src/browser-index.ts",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.js"
}
},
"directories": {
"test": "test"
},
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"build": "tsc",
"test": "standard | snazzy && tape test/*.js | faucet",
"rebuild": "node-gyp rebuild --verbose",
"prebuild": "prebuild --all --strip",
Expand All @@ -20,19 +28,21 @@
"bindings": "^1.5.0",
"bit-twiddle": "^1.0.2",
"glsl-tokenizer": "^2.1.5",
"nan": "^2.24.0",
"node-addon-api": "^8.3.1",
"node-gyp": "^12.1.0",
"prebuild-install": "^7.1.3"
},
"devDependencies": {
"@stackgl/gl-conformance": "2.1.3",
"@stackgl/gl-conformance": "^2.1.3",
"@types/node": "^20.19.39",
"angle-normals": "^1.0.0",
"bunny": "^1.0.1",
"faucet": "^0.0.4",
"prebuild": "^13.0.1",
"snazzy": "^9.0.0",
"standard": "^17.1.2",
"tape": "^5.9.0"
"tape": "^5.9.0",
"typescript": "^5.7.2"
},
"repository": {
"type": "git",
Expand Down
Loading