@thi.ng/webgl 6.9.87 → 6.9.89

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.
Files changed (3) hide show
  1. package/buffer.d.ts +5 -4
  2. package/buffer.js +5 -1
  3. package/package.json +18 -18
package/buffer.d.ts CHANGED
@@ -26,15 +26,16 @@ export declare class WebGLArrayBuffer<T extends TypedArray> implements IWebGLBuf
26
26
  }
27
27
  export declare const defBuffer: (gl: WebGLRenderingContext, data?: TypedArray, target?: GLenum, mode?: GLenum, retain?: boolean) => WebGLArrayBuffer<Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>>;
28
28
  /**
29
- * Takes a model spec and compiles all buffers (attributes, indices) and shader
30
- * (if not already compiled), then returns compiled spec, ready for use with
31
- * {@link draw}.
29
+ * Takes a model spec (or array of specs) and compiles all buffers (attributes,
30
+ * indices) and shaders (if not already compiled), then returns compiled spec(s),
31
+ * ready for use with {@link draw}.
32
32
  *
33
33
  * @param gl
34
34
  * @param spec
35
35
  * @param mode
36
36
  */
37
- export declare const compileModel: (gl: WebGLRenderingContext, spec: ModelSpec | UncompiledModelSpec, mode?: 35044) => ModelSpec;
37
+ export declare function compileModel(gl: WebGLRenderingContext, spec: ModelSpec | UncompiledModelSpec, mode?: GLenum): ModelSpec;
38
+ export declare function compileModel(gl: WebGLRenderingContext, spec: (ModelSpec | UncompiledModelSpec)[], mode?: GLenum): ModelSpec[];
38
39
  export declare const compileIndices: (gl: WebGLRenderingContext, index?: IndexBufferSpec, mode?: GLenum) => IndexBufferSpec | undefined;
39
40
  export declare const compileVAO: (gl: WebGLRenderingContext, spec: ModelSpec) => WebGLVertexArrayObject | undefined;
40
41
  export declare const compileAttribPool: (gl: WebGLRenderingContext, pool: AttribPool, ids?: string[], target?: GLenum, mode?: GLenum) => ModelAttributeSpecs;
package/buffer.js CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  asGLType,
4
4
  typedArrayType
5
5
  } from "@thi.ng/api/typedarray";
6
+ import { isArray } from "@thi.ng/checks/is-array";
6
7
  import { isPlainObject } from "@thi.ng/checks/is-plain-object";
7
8
  import {
8
9
  DrawMode
@@ -69,7 +70,10 @@ class WebGLArrayBuffer {
69
70
  }
70
71
  }
71
72
  const defBuffer = (gl, data, target = gl.ARRAY_BUFFER, mode = gl.STATIC_DRAW, retain = false) => new WebGLArrayBuffer(gl, data, target, mode, retain);
72
- const compileModel = (gl, spec, mode = gl.STATIC_DRAW) => {
73
+ function compileModel(gl, spec, mode) {
74
+ return isArray(spec) ? spec.map((x) => __compileModel(gl, x, mode)) : __compileModel(gl, spec, mode);
75
+ }
76
+ const __compileModel = (gl, spec, mode = gl.STATIC_DRAW) => {
73
77
  if (spec.attribPool) {
74
78
  spec.attribs = compileAttribPool(
75
79
  gl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/webgl",
3
- "version": "6.9.87",
3
+ "version": "6.9.89",
4
4
  "description": "WebGL & GLSL abstraction layer",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -43,22 +43,22 @@
43
43
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
44
44
  },
45
45
  "dependencies": {
46
- "@thi.ng/api": "^8.12.8",
47
- "@thi.ng/canvas": "^1.1.1",
48
- "@thi.ng/checks": "^3.7.24",
49
- "@thi.ng/equiv": "^2.1.98",
50
- "@thi.ng/errors": "^2.5.48",
51
- "@thi.ng/logger": "^3.2.7",
52
- "@thi.ng/matrices": "^3.0.28",
53
- "@thi.ng/memoize": "^4.0.32",
54
- "@thi.ng/object-utils": "^1.3.0",
55
- "@thi.ng/pixel": "^7.5.17",
56
- "@thi.ng/shader-ast": "^1.1.30",
57
- "@thi.ng/shader-ast-glsl": "^1.0.49",
58
- "@thi.ng/shader-ast-stdlib": "^1.0.49",
59
- "@thi.ng/transducers": "^9.6.17",
60
- "@thi.ng/vector-pools": "^3.2.78",
61
- "@thi.ng/vectors": "^8.6.13"
46
+ "@thi.ng/api": "^8.12.9",
47
+ "@thi.ng/canvas": "^1.1.2",
48
+ "@thi.ng/checks": "^3.7.25",
49
+ "@thi.ng/equiv": "^2.1.99",
50
+ "@thi.ng/errors": "^2.5.49",
51
+ "@thi.ng/logger": "^3.2.8",
52
+ "@thi.ng/matrices": "^3.0.29",
53
+ "@thi.ng/memoize": "^4.0.33",
54
+ "@thi.ng/object-utils": "^1.3.1",
55
+ "@thi.ng/pixel": "^7.5.18",
56
+ "@thi.ng/shader-ast": "^1.1.31",
57
+ "@thi.ng/shader-ast-glsl": "^1.0.50",
58
+ "@thi.ng/shader-ast-stdlib": "^1.0.50",
59
+ "@thi.ng/transducers": "^9.6.18",
60
+ "@thi.ng/vector-pools": "^3.2.79",
61
+ "@thi.ng/vectors": "^8.6.14"
62
62
  },
63
63
  "devDependencies": {
64
64
  "esbuild": "^0.27.0",
@@ -227,5 +227,5 @@
227
227
  ],
228
228
  "year": 2014
229
229
  },
230
- "gitHead": "be6e7657b1e5c54d7d648d1b52888a7297e95a17\n"
230
+ "gitHead": "fdca77cabf47dd23a9ab17a5ca13e3060075c12c\n"
231
231
  }