Skip to content

Commit fabf31d

Browse files
committed
Update webgl-demo.js
Calling gl.clear(...) explicitly. Fixed running sample1 locally.
1 parent 539a957 commit fabf31d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tutorial/sample1/webgl-demo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function start() {
1919
gl.clearDepth(1.0); // Clear everything
2020
gl.enable(gl.DEPTH_TEST); // Enable depth testing
2121
gl.depthFunc(gl.LEQUAL); // Near things obscure far things
22+
gl.clear(gl.COLOR_BUFFER_BIT); // Clear the color buffer with specified clear color
2223
}
2324
}
2425

@@ -42,4 +43,4 @@ function initWebGL() {
4243
if (!gl) {
4344
alert("Unable to initialize WebGL. Your browser may not support it.");
4445
}
45-
}
46+
}

0 commit comments

Comments
 (0)