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.
@@ -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
  *