twgl.js 5.5.2 → 5.5.4

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.
@@ -1,4 +1,4 @@
1
- /* @license twgl.js 5.5.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
1
+ /* @license twgl.js 5.5.4 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
2
2
  Available via the MIT license.
3
3
  see: http://github.com/greggman/twgl.js for details */
4
4
  /*
@@ -7563,7 +7563,7 @@ function createProgramNoCheck(gl, shaders, programOptions) {
7563
7563
  * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
7564
7564
  * @param {WebGLShader[]|string[]} shaders The shaders to attach, or element ids for their source, or strings that contain their source
7565
7565
  * @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
7566
- * @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7566
+ * @param {number[]|module:twgl.ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7567
7567
  * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
7568
7568
  * on error. If you want something else pass an callback. It's passed an error message.
7569
7569
  * @return {WebGLProgram?} the created program or null if error of a callback was provided.
@@ -7631,7 +7631,7 @@ function wrapCallbackFnToAsyncFn(fn) {
7631
7631
  * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
7632
7632
  * @param {WebGLShader[]|string[]} shaders The shaders to attach, or element ids for their source, or strings that contain their source
7633
7633
  * @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
7634
- * @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7634
+ * @param {number[]|module:twgl.ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7635
7635
  * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
7636
7636
  * on error. If you want something else pass an callback. It's passed an error message.
7637
7637
  * @return {Promise<WebGLProgram>} The created program
@@ -7648,7 +7648,7 @@ const createProgramAsync = wrapCallbackFnToAsyncFn(createProgram);
7648
7648
  * shaders or ids. The first is assumed to be the vertex shader,
7649
7649
  * the second the fragment shader.
7650
7650
  * @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
7651
- * @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7651
+ * @param {number[]|module:twgl.ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7652
7652
  * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
7653
7653
  * on error. If you want something else pass an callback. It's passed an error message.
7654
7654
  * @return {Promise<module:twgl.ProgramInfo>} The created ProgramInfo
@@ -7715,7 +7715,7 @@ function getProgramErrors(gl, program, errFn) {
7715
7715
  * tags for the shaders. The first is assumed to be the
7716
7716
  * vertex shader, the second the fragment shader.
7717
7717
  * @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
7718
- * @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7718
+ * @param {number[]|module:twgl.ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7719
7719
  * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
7720
7720
  * on error. If you want something else pass an callback. It's passed an error message.
7721
7721
  * @return {WebGLProgram?} the created program or null if error or a callback was provided.
@@ -7751,7 +7751,7 @@ function createProgramFromScripts(
7751
7751
  * shaders. The first is assumed to be the vertex shader,
7752
7752
  * the second the fragment shader.
7753
7753
  * @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
7754
- * @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7754
+ * @param {number[]|module:twgl.ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
7755
7755
  * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
7756
7756
  * on error. If you want something else pass an callback. It's passed an error message.
7757
7757
  * @return {WebGLProgram?} the created program or null if error or a callback was provided.
@@ -8794,7 +8794,7 @@ const notIdRE = /\s|{|}|;/;
8794
8794
  * shaders or ids. The first is assumed to be the vertex shader,
8795
8795
  * the second the fragment shader.
8796
8796
  * @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
8797
- * @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
8797
+ * @param {number[]|module:twgl.ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
8798
8798
  * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
8799
8799
  * on error. If you want something else pass an callback. It's passed an error message.
8800
8800
  * @return {module:twgl.ProgramInfo?} The created ProgramInfo or null if it failed to link or compile
@@ -1191,13 +1191,13 @@ export function bindFramebufferInfo(gl: WebGLRenderingContext, framebufferInfo?:
1191
1191
  * shaders or ids. The first is assumed to be the vertex shader,
1192
1192
  * the second the fragment shader.
1193
1193
  * @param {ProgramOptions|string[]|ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
1194
- * @param {number[]} [opt_locations|ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
1194
+ * @param {number[]|ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
1195
1195
  * @param {ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
1196
1196
  * on error. If you want something else pass an callback. It's passed an error message.
1197
1197
  * @return {ProgramInfo?} The created ProgramInfo or null if it failed to link or compile
1198
1198
  * @memberOf module:twgl/programs
1199
1199
  */
1200
- export function createProgramInfo(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): ProgramInfo;
1200
+ export function createProgramInfo(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_locations?: number[] | ErrorCallback, opt_errorCallback?: ErrorCallback): ProgramInfo;
1201
1201
  /**
1202
1202
  * Creates a `UniformBlockInfo` for the specified block
1203
1203
  *
@@ -2106,13 +2106,13 @@ export type ProgramCallback = (err?: string, result?: WebGLProgram | ProgramInfo
2106
2106
  * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
2107
2107
  * @param {WebGLShader[]|string[]} shaders The shaders to attach, or element ids for their source, or strings that contain their source
2108
2108
  * @param {ProgramOptions|string[]|ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
2109
- * @param {number[]} [opt_locations|ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2109
+ * @param {number[]|ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2110
2110
  * @param {ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
2111
2111
  * on error. If you want something else pass an callback. It's passed an error message.
2112
2112
  * @return {WebGLProgram?} the created program or null if error of a callback was provided.
2113
2113
  * @memberOf module:twgl/programs
2114
2114
  */
2115
- export function createProgram(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
2115
+ export function createProgram(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_locations?: number[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
2116
2116
  /**
2117
2117
  * Same as createProgram but returns a promise
2118
2118
  *
@@ -2127,13 +2127,13 @@ export function createProgram(gl: WebGLRenderingContext, shaders: WebGLShader[]
2127
2127
  * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
2128
2128
  * @param {WebGLShader[]|string[]} shaders The shaders to attach, or element ids for their source, or strings that contain their source
2129
2129
  * @param {ProgramOptions|string[]|ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
2130
- * @param {number[]} [opt_locations|ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2130
+ * @param {number[]|ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2131
2131
  * @param {ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
2132
2132
  * on error. If you want something else pass an callback. It's passed an error message.
2133
2133
  * @return {Promise<WebGLProgram>} The created program
2134
2134
  * @memberOf module:twgl/programs
2135
2135
  */
2136
- export function createProgramAsync(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<WebGLProgram>;
2136
+ export function createProgramAsync(gl: WebGLRenderingContext, shaders: WebGLShader[] | string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_locations?: number[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<WebGLProgram>;
2137
2137
  /**
2138
2138
  * Same as createProgramInfo but returns a promise
2139
2139
  * @function
@@ -2143,13 +2143,13 @@ export function createProgramAsync(gl: WebGLRenderingContext, shaders: WebGLShad
2143
2143
  * shaders or ids. The first is assumed to be the vertex shader,
2144
2144
  * the second the fragment shader.
2145
2145
  * @param {ProgramOptions|string[]|ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
2146
- * @param {number[]} [opt_locations|ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2146
+ * @param {number[]|ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2147
2147
  * @param {ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
2148
2148
  * on error. If you want something else pass an callback. It's passed an error message.
2149
2149
  * @return {Promise<ProgramInfo>} The created ProgramInfo
2150
2150
  * @memberOf module:twgl/programs
2151
2151
  */
2152
- export function createProgramInfoAsync(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<ProgramInfo>;
2152
+ export function createProgramInfoAsync(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_locations?: number[] | ErrorCallback, opt_errorCallback?: ErrorCallback): Promise<ProgramInfo>;
2153
2153
  /**
2154
2154
  * Creates a program from 2 script tags.
2155
2155
  *
@@ -2166,13 +2166,13 @@ export function createProgramInfoAsync(gl: WebGLRenderingContext, shaderSources:
2166
2166
  * tags for the shaders. The first is assumed to be the
2167
2167
  * vertex shader, the second the fragment shader.
2168
2168
  * @param {ProgramOptions|string[]|ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
2169
- * @param {number[]} [opt_locations|ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2169
+ * @param {number[]|ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2170
2170
  * @param {ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
2171
2171
  * on error. If you want something else pass an callback. It's passed an error message.
2172
2172
  * @return {WebGLProgram?} the created program or null if error or a callback was provided.
2173
2173
  * @memberOf module:twgl/programs
2174
2174
  */
2175
- export function createProgramFromScripts(gl: WebGLRenderingContext, shaderScriptIds: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
2175
+ export function createProgramFromScripts(gl: WebGLRenderingContext, shaderScriptIds: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_locations?: number[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
2176
2176
  /**
2177
2177
  * Creates a program from 2 sources.
2178
2178
  *
@@ -2189,13 +2189,13 @@ export function createProgramFromScripts(gl: WebGLRenderingContext, shaderScript
2189
2189
  * shaders. The first is assumed to be the vertex shader,
2190
2190
  * the second the fragment shader.
2191
2191
  * @param {ProgramOptions|string[]|ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
2192
- * @param {number[]} [opt_locations|ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2192
+ * @param {number[]|ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2193
2193
  * @param {ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
2194
2194
  * on error. If you want something else pass an callback. It's passed an error message.
2195
2195
  * @return {WebGLProgram?} the created program or null if error or a callback was provided.
2196
2196
  * @memberOf module:twgl/programs
2197
2197
  */
2198
- export function createProgramFromSources(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
2198
+ export function createProgramFromSources(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_locations?: number[] | ErrorCallback, opt_errorCallback?: ErrorCallback): WebGLProgram;
2199
2199
  /**
2200
2200
  * Creates setter functions for all uniforms of a shader
2201
2201
  * program.
@@ -2651,13 +2651,13 @@ export function createProgramInfoFromProgram(gl: WebGLRenderingContext, program:
2651
2651
  * shaders or ids. The first is assumed to be the vertex shader,
2652
2652
  * the second the fragment shader.
2653
2653
  * @param {ProgramOptions|string[]|ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in
2654
- * @param {number[]} [opt_locations|ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2654
+ * @param {number[]|ErrorCallback} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback.
2655
2655
  * @param {ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console
2656
2656
  * on error. If you want something else pass an callback. It's passed an error message.
2657
2657
  * @return {ProgramInfo?} The created ProgramInfo or null if it failed to link or compile
2658
2658
  * @memberOf module:twgl/programs
2659
2659
  */
2660
- export function createProgramInfo(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): ProgramInfo;
2660
+ export function createProgramInfo(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_locations?: number[] | ErrorCallback, opt_errorCallback?: ErrorCallback): ProgramInfo;
2661
2661
  /**
2662
2662
  * Creates multiple programs
2663
2663
  *