aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-02-01 15:15:50 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-02-06 11:08:04 -0500
commit88c6cb7612c472f2efc3a94c44e05c6115232e67 (patch)
tree6d15fd4341ecaf1d90de95dc8c30c36c3dfc9c2f /src/library_sdl.js
parent78a230ab665daad0fe11d40bdaca1c995fbe9add (diff)
Disable WebGL if typed arrays are not being used.
This fixes issue #195
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 35c619b8..7b413c13 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -173,6 +173,12 @@ mergeInto(LibraryManager.library, {
},
createContext: function(useWebGL) {
+#if !USE_TYPED_ARRAYS
+ if (useWebGL) {
+ Module.print('(USE_TYPED_ARRAYS needs to be enabled for WebGL)');
+ return null;
+ }
+#endif
try {
var ctx = Module.canvas.getContext(useWebGL ? 'experimental-webgl' : '2d');
if (!ctx) throw 'Could not create canvas :(';