diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-01-20 16:04:51 -0500 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-01-20 16:04:51 -0500 |
commit | 0208f854ad57be31fba3d999c2d77c8fe70d0747 (patch) | |
tree | a5214ca6dc14002743548a2129f5b827cc75b3b5 /src/shell.html | |
parent | 426ab9f67ac01bdf008168d22d3f8a64ed1d098e (diff) |
Unify the 2D and WebGL contexts
Diffstat (limited to 'src/shell.html')
-rw-r--r-- | src/shell.html | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/shell.html b/src/shell.html index 95ab5a6a..6b6bbdad 100644 --- a/src/shell.html +++ b/src/shell.html @@ -19,38 +19,6 @@ })(), canvas: document.getElementById('canvas') }; - // Define the 2D and WebGL contexts lazily, because a canvas can only - // have one context type. - Module.__defineGetter__("ctx2D", function() { - try { - var ctx = Module.canvas.getContext('2d'); - if (!ctx) throw 'Could not create canvas :('; - delete Module["ctxGL"]; - Module.__defineGetter__("ctxGL", function() { - throw 'Could not create a WebGL context for a 2D canvas :('; - }); - delete Module["ctx2D"]; - return Module["ctx2D"] = ctx; - } catch (e) { - Module.print('(canvas not available)'); - return null; - } - }); - Module.__defineGetter__("ctxGL", function() { - try { - var ctx = Module.canvas.getContext('experimental-webgl'); - if (!ctx) throw 'Could not create canvas :('; - delete Module["ctx2D"]; - Module.__defineGetter__("ctx2D", function() { - throw 'Could not create a 2D context for a WebGL canvas :('; - }); - delete Module["ctxGL"]; - return Module["ctxGL"] = ctx; - } catch (e) { - Module.print('(canvas not available)'); - return null; - } - }); // The compiled code {{{ SCRIPT_CODE }}} |