Permalink
Browse files

properly warn on missing webgl

  • Loading branch information...
kripken committed Aug 30, 2012
1 parent 1defd67 commit 6a3b3b4f5d9e33969263d06890c0369db18ffdb7
Showing with 6 additions and 2 deletions.
  1. +6 −2 cube2/js/game-setup.js
View
@@ -66,9 +66,13 @@ var Module = {
document.querySelector('.status-content.error').classList.remove('hide');
Module.failed = true;
}
- var canvas = document.createElement('canvas');
+ try {
+ var canvas = document.createElement('canvas');
+ } catch(e){}
if (!canvas) fail('canvas element');
- var context = canvas.getContext('experimental-webgl');
+ try {
+ var context = canvas.getContext('experimental-webgl');
+ } catch(e){}
if (!context) fail('WebGL');
var s3tc = context.getExtension('WEBGL_compressed_texture_s3tc') ||
context.getExtension('MOZ_WEBGL_compressed_texture_s3tc') ||

0 comments on commit 6a3b3b4

Please sign in to comment.