twgl.js 5.3.0 → 5.4.0
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/dist/5.x/twgl-full.d.ts +3927 -0
- package/dist/5.x/twgl-full.js +5 -4
- package/dist/5.x/twgl-full.module.js +5 -4
- package/dist/5.x/twgl.d.ts +2773 -0
- package/dist/5.x/twgl.js +5 -4
- package/package.json +2 -2
package/dist/5.x/twgl-full.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @license twgl.js 5.
|
|
2
|
+
* @license twgl.js 5.4.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
|
|
3
3
|
* Available via the MIT license.
|
|
4
4
|
* see: http://github.com/greggman/twgl.js for details
|
|
5
5
|
*/
|
|
@@ -391,6 +391,7 @@ function attribBufferFromArrayLike(gl, array, arrayName) {
|
|
|
391
391
|
* position: bufferInfo1.attribs.position, // use the same buffer from bufferInfo1
|
|
392
392
|
* });
|
|
393
393
|
*
|
|
394
|
+
* @property {number} [drawType] the draw type passed to gl.bufferData. Default = gl.STATIC_DRAW
|
|
394
395
|
* @memberOf module:twgl
|
|
395
396
|
*/
|
|
396
397
|
|
|
@@ -4845,7 +4846,7 @@ function samplerArraySetter(gl, type, unit, location, size) {
|
|
|
4845
4846
|
gl.activeTexture(TEXTURE0 + units[index]);
|
|
4846
4847
|
var texture;
|
|
4847
4848
|
var sampler;
|
|
4848
|
-
if (helper.isTexture(gl, textureOrPair)) {
|
|
4849
|
+
if (!textureOrPair || helper.isTexture(gl, textureOrPair)) {
|
|
4849
4850
|
texture = textureOrPair;
|
|
4850
4851
|
sampler = null;
|
|
4851
4852
|
} else {
|
|
@@ -6487,7 +6488,7 @@ function setUniformTree(tree, values) {
|
|
|
6487
6488
|
* ],
|
|
6488
6489
|
* };
|
|
6489
6490
|
*
|
|
6490
|
-
* gl.useProgram(program);
|
|
6491
|
+
* gl.useProgram(programInfo.program);
|
|
6491
6492
|
*
|
|
6492
6493
|
* This will automatically bind the textures AND set the
|
|
6493
6494
|
* uniforms.
|
|
@@ -6496,7 +6497,7 @@ function setUniformTree(tree, values) {
|
|
|
6496
6497
|
*
|
|
6497
6498
|
* For the example above it is equivalent to
|
|
6498
6499
|
*
|
|
6499
|
-
*
|
|
6500
|
+
* let texUnit = 0;
|
|
6500
6501
|
* gl.activeTexture(gl.TEXTURE0 + texUnit);
|
|
6501
6502
|
* gl.bindTexture(gl.TEXTURE_2D, tex1);
|
|
6502
6503
|
* gl.uniform1i(u_someSamplerLocation, texUnit++);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @license twgl.js 5.
|
|
1
|
+
/* @license twgl.js 5.4.0 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
|
/*
|
|
@@ -2248,6 +2248,7 @@ function attribBufferFromArrayLike(gl, array, arrayName) {
|
|
|
2248
2248
|
* position: bufferInfo1.attribs.position, // use the same buffer from bufferInfo1
|
|
2249
2249
|
* });
|
|
2250
2250
|
*
|
|
2251
|
+
* @property {number} [drawType] the draw type passed to gl.bufferData. Default = gl.STATIC_DRAW
|
|
2251
2252
|
* @memberOf module:twgl
|
|
2252
2253
|
*/
|
|
2253
2254
|
|
|
@@ -7102,7 +7103,7 @@ function samplerArraySetter(gl, type, unit, location, size) {
|
|
|
7102
7103
|
gl.activeTexture(TEXTURE0 + units[index]);
|
|
7103
7104
|
let texture;
|
|
7104
7105
|
let sampler;
|
|
7105
|
-
if (isTexture(gl, textureOrPair)) {
|
|
7106
|
+
if (!textureOrPair || isTexture(gl, textureOrPair)) {
|
|
7106
7107
|
texture = textureOrPair;
|
|
7107
7108
|
sampler = null;
|
|
7108
7109
|
} else {
|
|
@@ -8409,7 +8410,7 @@ function setUniformTree(tree, values) {
|
|
|
8409
8410
|
* ],
|
|
8410
8411
|
* };
|
|
8411
8412
|
*
|
|
8412
|
-
* gl.useProgram(program);
|
|
8413
|
+
* gl.useProgram(programInfo.program);
|
|
8413
8414
|
*
|
|
8414
8415
|
* This will automatically bind the textures AND set the
|
|
8415
8416
|
* uniforms.
|
|
@@ -8418,7 +8419,7 @@ function setUniformTree(tree, values) {
|
|
|
8418
8419
|
*
|
|
8419
8420
|
* For the example above it is equivalent to
|
|
8420
8421
|
*
|
|
8421
|
-
*
|
|
8422
|
+
* let texUnit = 0;
|
|
8422
8423
|
* gl.activeTexture(gl.TEXTURE0 + texUnit);
|
|
8423
8424
|
* gl.bindTexture(gl.TEXTURE_2D, tex1);
|
|
8424
8425
|
* gl.uniform1i(u_someSamplerLocation, texUnit++);
|