Skip to content

Commit ca41738

Browse files
committed
Checking the correct return values from getAttribLocation.
1 parent edbdd1c commit ca41738

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mesh.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ function Mesh() {
9090
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
9191
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPosBuffer);
9292
gl.vertexAttribPointer(program.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);
93-
if (program.vertexNormalAttribute !== null) {
93+
if (program.vertexNormalAttribute !== -1) {
9494
gl.enableVertexAttribArray(program.vertexNormalAttribute);
9595
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexNormalBuffer);
9696
gl.vertexAttribPointer(program.vertexNormalAttribute, 3, gl.FLOAT, false, 0, 0);
9797
}
98-
if (program.vertexTextureCoordAttribute !== null) {
98+
if (program.vertexTextureCoordAttribute !== -1) {
9999
gl.enableVertexAttribArray(program.vertexTextureCoordAttribute);
100100
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexTextureCoordBuffer);
101101
gl.vertexAttribPointer(program.vertexTextureCoordAttribute, 2, gl.FLOAT, false, 0, 0);

0 commit comments

Comments
 (0)