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.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 :(';