@thi.ng/webgl 6.8.13 → 6.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +1 -1
- package/buffer.js +3 -6
- package/package.json +22 -22
- package/texture.js +3 -6
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/buffer.js
CHANGED
|
@@ -21,8 +21,7 @@ class WebGLArrayBuffer {
|
|
|
21
21
|
this.mode = mode;
|
|
22
22
|
if (data) {
|
|
23
23
|
this.set(data);
|
|
24
|
-
if (retain)
|
|
25
|
-
this.data = data;
|
|
24
|
+
if (retain) this.data = data;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
bind() {
|
|
@@ -49,14 +48,12 @@ class WebGLArrayBuffer {
|
|
|
49
48
|
* If no data is retained, this method is a no-op.
|
|
50
49
|
*/
|
|
51
50
|
update() {
|
|
52
|
-
if (this.data)
|
|
53
|
-
this.set(this.data);
|
|
51
|
+
if (this.data) this.set(this.data);
|
|
54
52
|
}
|
|
55
53
|
set(data, mode = this.mode) {
|
|
56
54
|
this.bind();
|
|
57
55
|
this.gl.bufferData(this.target, data, mode);
|
|
58
|
-
if (this.data)
|
|
59
|
-
this.data = data;
|
|
56
|
+
if (this.data) this.data = data;
|
|
60
57
|
}
|
|
61
58
|
setChunk(data, byteOffset = 0) {
|
|
62
59
|
this.bind();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/webgl",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.15",
|
|
4
4
|
"description": "WebGL & GLSL abstraction layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,28 +40,28 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.11.
|
|
44
|
-
"@thi.ng/associative": "^6.3.
|
|
45
|
-
"@thi.ng/canvas": "^0.2.
|
|
46
|
-
"@thi.ng/checks": "^3.6.
|
|
47
|
-
"@thi.ng/equiv": "^2.1.
|
|
48
|
-
"@thi.ng/errors": "^2.5.
|
|
49
|
-
"@thi.ng/logger": "^3.0.
|
|
50
|
-
"@thi.ng/matrices": "^2.3.
|
|
51
|
-
"@thi.ng/memoize": "^3.3.
|
|
52
|
-
"@thi.ng/pixel": "^6.1.
|
|
53
|
-
"@thi.ng/shader-ast": "^0.15.
|
|
54
|
-
"@thi.ng/shader-ast-glsl": "^0.4.
|
|
55
|
-
"@thi.ng/shader-ast-stdlib": "^0.18.
|
|
56
|
-
"@thi.ng/transducers": "^9.0.
|
|
57
|
-
"@thi.ng/vector-pools": "^3.1.
|
|
58
|
-
"@thi.ng/vectors": "^7.10.
|
|
43
|
+
"@thi.ng/api": "^8.11.2",
|
|
44
|
+
"@thi.ng/associative": "^6.3.60",
|
|
45
|
+
"@thi.ng/canvas": "^0.2.19",
|
|
46
|
+
"@thi.ng/checks": "^3.6.4",
|
|
47
|
+
"@thi.ng/equiv": "^2.1.58",
|
|
48
|
+
"@thi.ng/errors": "^2.5.7",
|
|
49
|
+
"@thi.ng/logger": "^3.0.12",
|
|
50
|
+
"@thi.ng/matrices": "^2.3.37",
|
|
51
|
+
"@thi.ng/memoize": "^3.3.4",
|
|
52
|
+
"@thi.ng/pixel": "^6.1.32",
|
|
53
|
+
"@thi.ng/shader-ast": "^0.15.15",
|
|
54
|
+
"@thi.ng/shader-ast-glsl": "^0.4.123",
|
|
55
|
+
"@thi.ng/shader-ast-stdlib": "^0.18.15",
|
|
56
|
+
"@thi.ng/transducers": "^9.0.5",
|
|
57
|
+
"@thi.ng/vector-pools": "^3.1.129",
|
|
58
|
+
"@thi.ng/vectors": "^7.10.31"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@microsoft/api-extractor": "^7.43.
|
|
62
|
-
"esbuild": "^0.
|
|
63
|
-
"typedoc": "^0.25.
|
|
64
|
-
"typescript": "^5.4.
|
|
61
|
+
"@microsoft/api-extractor": "^7.43.2",
|
|
62
|
+
"esbuild": "^0.21.1",
|
|
63
|
+
"typedoc": "^0.25.13",
|
|
64
|
+
"typescript": "^5.4.5"
|
|
65
65
|
},
|
|
66
66
|
"keywords": [
|
|
67
67
|
"2d",
|
|
@@ -220,5 +220,5 @@
|
|
|
220
220
|
],
|
|
221
221
|
"year": 2014
|
|
222
222
|
},
|
|
223
|
-
"gitHead": "
|
|
223
|
+
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
|
|
224
224
|
}
|
package/texture.js
CHANGED
|
@@ -11,8 +11,7 @@ import {
|
|
|
11
11
|
import { isGL2Context } from "./checks.js";
|
|
12
12
|
import { error } from "./error.js";
|
|
13
13
|
const $bind = (op) => (textures) => {
|
|
14
|
-
if (!textures)
|
|
15
|
-
return;
|
|
14
|
+
if (!textures) return;
|
|
16
15
|
for (let i = textures.length, tex; i-- > 0; ) {
|
|
17
16
|
(tex = textures[i]) && tex[op](i);
|
|
18
17
|
}
|
|
@@ -62,8 +61,7 @@ class Texture {
|
|
|
62
61
|
return true;
|
|
63
62
|
}
|
|
64
63
|
configureImage(target, opts) {
|
|
65
|
-
if (opts.image === void 0)
|
|
66
|
-
return;
|
|
64
|
+
if (opts.image === void 0) return;
|
|
67
65
|
target === TextureTarget.TEXTURE_3D ? this.configureImage3d(target, opts) : this.configureImage2d(target, opts);
|
|
68
66
|
}
|
|
69
67
|
configureImage2d(target, opts) {
|
|
@@ -130,8 +128,7 @@ class Texture {
|
|
|
130
128
|
}
|
|
131
129
|
configureImage3d(target, opts) {
|
|
132
130
|
const { image, width, height, depth } = opts;
|
|
133
|
-
if (!(width && height && depth))
|
|
134
|
-
return;
|
|
131
|
+
if (!(width && height && depth)) return;
|
|
135
132
|
const level = opts.level || 0;
|
|
136
133
|
const pos = opts.pos || [0, 0, 0];
|
|
137
134
|
const decl = TEX_FORMATS[this.format];
|