@gjsify/webgl 0.0.2 → 0.0.3
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/lib/cjs/extensions/ext-blend-minmax.js +4 -23
- package/lib/cjs/extensions/ext-texture-filter-anisotropic.js +4 -23
- package/lib/cjs/extensions/oes-element-index-unit.js +4 -23
- package/lib/cjs/extensions/oes-standard-derivatives.js +4 -23
- package/lib/cjs/extensions/oes-texture-float-linear.js +4 -23
- package/lib/cjs/extensions/oes-texture-float.js +4 -23
- package/lib/cjs/extensions/stackgl-destroy-context.js +4 -23
- package/lib/cjs/extensions/stackgl-resize-drawing-buffer.js +4 -23
- package/lib/cjs/html-canvas-element.js +15 -34
- package/lib/cjs/index.js +18 -34
- package/lib/cjs/index.spec.js +51 -80
- package/lib/cjs/linkable.js +3 -22
- package/lib/cjs/test.js +3 -25
- package/lib/cjs/types/constructor.js +0 -15
- package/lib/cjs/types/extension.js +0 -15
- package/lib/cjs/types/index.js +5 -21
- package/lib/cjs/types/typed-array.js +0 -15
- package/lib/cjs/types/webgl-constants.js +0 -15
- package/lib/cjs/types/webgl-context-attribute-options.js +0 -15
- package/lib/cjs/utils.js +24 -53
- package/lib/cjs/webgl-active-info.js +3 -22
- package/lib/cjs/webgl-buffer.js +6 -25
- package/lib/cjs/webgl-context-attributes.js +4 -23
- package/lib/cjs/webgl-drawing-buffer-wrapper.js +3 -22
- package/lib/cjs/webgl-framebuffer.js +6 -25
- package/lib/cjs/webgl-program.js +6 -25
- package/lib/cjs/webgl-renderbuffer.js +6 -25
- package/lib/cjs/webgl-rendering-context.js +204 -216
- package/lib/cjs/webgl-shader-precision-format.js +4 -23
- package/lib/cjs/webgl-shader.js +6 -25
- package/lib/cjs/webgl-texture-unit.js +3 -22
- package/lib/cjs/webgl-texture.js +6 -25
- package/lib/cjs/webgl-uniform-location.js +4 -23
- package/lib/cjs/webgl-vertex-attribute.js +9 -28
- package/package.json +5 -5
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var webgl_shader_precision_format_exports = {};
|
|
19
|
-
__export(webgl_shader_precision_format_exports, {
|
|
20
|
-
GjsifyWebGLShaderPrecisionFormat: () => GjsifyWebGLShaderPrecisionFormat,
|
|
21
|
-
WebGLShaderPrecisionFormat: () => GjsifyWebGLShaderPrecisionFormat
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(webgl_shader_precision_format_exports);
|
|
24
1
|
class GjsifyWebGLShaderPrecisionFormat {
|
|
25
2
|
constructor(_) {
|
|
26
3
|
this.rangeMin = _.rangeMin;
|
|
@@ -28,3 +5,7 @@ class GjsifyWebGLShaderPrecisionFormat {
|
|
|
28
5
|
this.precision = _.precision;
|
|
29
6
|
}
|
|
30
7
|
}
|
|
8
|
+
export {
|
|
9
|
+
GjsifyWebGLShaderPrecisionFormat,
|
|
10
|
+
GjsifyWebGLShaderPrecisionFormat as WebGLShaderPrecisionFormat
|
|
11
|
+
};
|
package/lib/cjs/webgl-shader.js
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var webgl_shader_exports = {};
|
|
19
|
-
__export(webgl_shader_exports, {
|
|
20
|
-
GjsifyWebGLShader: () => GjsifyWebGLShader,
|
|
21
|
-
WebGLShader: () => GjsifyWebGLShader
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(webgl_shader_exports);
|
|
24
|
-
var import_linkable = require("./linkable.js");
|
|
25
|
-
class GjsifyWebGLShader extends import_linkable.Linkable {
|
|
1
|
+
import { Linkable } from "./linkable.js";
|
|
2
|
+
class GjsifyWebGLShader extends Linkable {
|
|
26
3
|
constructor(_, ctx, type) {
|
|
27
4
|
super(_);
|
|
28
5
|
this._source = "";
|
|
@@ -40,3 +17,7 @@ class GjsifyWebGLShader extends import_linkable.Linkable {
|
|
|
40
17
|
ctx._native.deleteShader(this._ | 0);
|
|
41
18
|
}
|
|
42
19
|
}
|
|
20
|
+
export {
|
|
21
|
+
GjsifyWebGLShader,
|
|
22
|
+
GjsifyWebGLShader as WebGLShader
|
|
23
|
+
};
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var webgl_texture_unit_exports = {};
|
|
19
|
-
__export(webgl_texture_unit_exports, {
|
|
20
|
-
WebGLTextureUnit: () => WebGLTextureUnit
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(webgl_texture_unit_exports);
|
|
23
1
|
class WebGLTextureUnit {
|
|
24
2
|
constructor(ctx, idx) {
|
|
25
3
|
this._mode = 0;
|
|
@@ -29,3 +7,6 @@ class WebGLTextureUnit {
|
|
|
29
7
|
this._idx = idx;
|
|
30
8
|
}
|
|
31
9
|
}
|
|
10
|
+
export {
|
|
11
|
+
WebGLTextureUnit
|
|
12
|
+
};
|
package/lib/cjs/webgl-texture.js
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var webgl_texture_exports = {};
|
|
19
|
-
__export(webgl_texture_exports, {
|
|
20
|
-
GjsifyWebGLTexture: () => GjsifyWebGLTexture,
|
|
21
|
-
WebGLTexture: () => GjsifyWebGLTexture
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(webgl_texture_exports);
|
|
24
|
-
var import_linkable = require("./linkable.js");
|
|
25
|
-
class GjsifyWebGLTexture extends import_linkable.Linkable {
|
|
1
|
+
import { Linkable } from "./linkable.js";
|
|
2
|
+
class GjsifyWebGLTexture extends Linkable {
|
|
26
3
|
constructor(_, ctx) {
|
|
27
4
|
super(_);
|
|
28
5
|
this._binding = 0;
|
|
@@ -39,3 +16,7 @@ class GjsifyWebGLTexture extends import_linkable.Linkable {
|
|
|
39
16
|
ctx._native.deleteTexture(this._ | 0);
|
|
40
17
|
}
|
|
41
18
|
}
|
|
19
|
+
export {
|
|
20
|
+
GjsifyWebGLTexture,
|
|
21
|
+
GjsifyWebGLTexture as WebGLTexture
|
|
22
|
+
};
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var webgl_uniform_location_exports = {};
|
|
19
|
-
__export(webgl_uniform_location_exports, {
|
|
20
|
-
GjsifyWebGLUniformLocation: () => GjsifyWebGLUniformLocation,
|
|
21
|
-
WebGLUniformLocation: () => GjsifyWebGLUniformLocation
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(webgl_uniform_location_exports);
|
|
24
1
|
class GjsifyWebGLUniformLocation {
|
|
25
2
|
constructor(_, program, info) {
|
|
26
3
|
this._linkCount = 0;
|
|
@@ -32,3 +9,7 @@ class GjsifyWebGLUniformLocation {
|
|
|
32
9
|
this._array = null;
|
|
33
10
|
}
|
|
34
11
|
}
|
|
12
|
+
export {
|
|
13
|
+
GjsifyWebGLUniformLocation,
|
|
14
|
+
GjsifyWebGLUniformLocation as WebGLUniformLocation
|
|
15
|
+
};
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var webgl_vertex_attribute_exports = {};
|
|
19
|
-
__export(webgl_vertex_attribute_exports, {
|
|
20
|
-
WebGLVertexArrayGlobalAttribute: () => WebGLVertexArrayGlobalAttribute,
|
|
21
|
-
WebGLVertexArrayGlobalState: () => WebGLVertexArrayGlobalState,
|
|
22
|
-
WebGLVertexArrayObjectAttribute: () => WebGLVertexArrayObjectAttribute,
|
|
23
|
-
WebGLVertexArrayObjectState: () => WebGLVertexArrayObjectState
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(webgl_vertex_attribute_exports);
|
|
26
|
-
var import_webgl_buffer = require("./webgl-buffer.js");
|
|
1
|
+
import { WebGLBuffer } from "./webgl-buffer.js";
|
|
27
2
|
class WebGLVertexArrayObjectAttribute {
|
|
28
3
|
constructor(ctx, idx) {
|
|
29
4
|
this._isPointer = false;
|
|
@@ -72,7 +47,7 @@ class WebGLVertexArrayObjectState {
|
|
|
72
47
|
this._elementArrayBufferBinding = null;
|
|
73
48
|
}
|
|
74
49
|
setElementArrayBuffer(buffer) {
|
|
75
|
-
if (buffer !== null && !(buffer instanceof
|
|
50
|
+
if (buffer !== null && !(buffer instanceof WebGLBuffer)) {
|
|
76
51
|
throw new TypeError("setElementArrayBuffer(WebGLBuffer?)");
|
|
77
52
|
}
|
|
78
53
|
const current = this._elementArrayBufferBinding;
|
|
@@ -148,7 +123,7 @@ class WebGLVertexArrayGlobalState {
|
|
|
148
123
|
this._arrayBufferBinding = null;
|
|
149
124
|
}
|
|
150
125
|
setArrayBuffer(buffer) {
|
|
151
|
-
if (buffer !== null && !(buffer instanceof
|
|
126
|
+
if (buffer !== null && !(buffer instanceof WebGLBuffer)) {
|
|
152
127
|
throw new TypeError("setArrayBuffer(WebGLBuffer?)");
|
|
153
128
|
}
|
|
154
129
|
const current = this._arrayBufferBinding;
|
|
@@ -164,3 +139,9 @@ class WebGLVertexArrayGlobalState {
|
|
|
164
139
|
}
|
|
165
140
|
}
|
|
166
141
|
}
|
|
142
|
+
export {
|
|
143
|
+
WebGLVertexArrayGlobalAttribute,
|
|
144
|
+
WebGLVertexArrayGlobalState,
|
|
145
|
+
WebGLVertexArrayObjectAttribute,
|
|
146
|
+
WebGLVertexArrayObjectState
|
|
147
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/webgl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "WebGL module for Gjs",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"WebGL"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@gjsify/cli": "^0.0.
|
|
40
|
-
"@gjsify/unit": "^0.0.
|
|
39
|
+
"@gjsify/cli": "^0.0.3",
|
|
40
|
+
"@gjsify/unit": "^0.0.3",
|
|
41
41
|
"@types/node": "^20.3.1",
|
|
42
42
|
"typescript": "^5.1.3"
|
|
43
43
|
},
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@girs/gjs": "^3.1.0",
|
|
47
47
|
"@girs/gtk-4.0": "4.10.4-3.1.0",
|
|
48
48
|
"@girs/gwebgl-0.1": "^0.1.0-3.1.0",
|
|
49
|
-
"@gjsify/html-image-element": "^0.0.
|
|
50
|
-
"@gjsify/utils": "^0.0.
|
|
49
|
+
"@gjsify/html-image-element": "^0.0.3",
|
|
50
|
+
"@gjsify/utils": "^0.0.3",
|
|
51
51
|
"@types/bit-twiddle": "^1.0.1",
|
|
52
52
|
"bit-twiddle": "^1.0.2",
|
|
53
53
|
"glsl-tokenizer": "^2.1.5"
|