aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-24 17:07:14 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-24 17:07:14 -0500
commitca8db2849799350d1943e9e64544b0cf0d4b81a6 (patch)
tree17b353d0f219b27c85ee9a21da512f6bf45add3e
parentd495fd27c2f492c891b82e367100fac0be213d67 (diff)
Make the background of the canvas black
-rw-r--r--src/library_gl.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 17b9bcd6..fd07d2f0 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -511,6 +511,9 @@ var LibraryGLUT = {
var ctx = Module.canvas.getContext('experimental-webgl');
if (!ctx) throw 'Could not create canvas :(';
Module.ctx = ctx;
+ // Set the background of the canvas to black, because glut gives us a
+ // window which has a black background by default.
+ Module.canvas.style.backgroundColor = "black";
} catch (e) {
Module.print('(canvas not available)');
}