aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 511882dd..d438fc23 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -176,6 +176,11 @@ mergeInto(LibraryManager.library, {
try {
var ctx = Module.canvas.getContext(useWebGL ? 'experimental-webgl' : '2d');
if (!ctx) throw 'Could not create canvas :(';
+ if (useWebGL) {
+ // Set the background of the WebGL canvas to black, because SDL gives us a
+ // window which has a black background by default.
+ Module.canvas.style.backgroundColor = "black";
+ }
return Module.ctx = ctx;
} catch (e) {
Module.print('(canvas not available)');