diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-14 16:17:02 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-14 16:17:02 -0700 |
commit | faf13f78df6aba1f4eddcca1f0778eaa878e1495 (patch) | |
tree | dedc9ea66f305f88d27a839eeeb34f90e60c0d8d /src | |
parent | 2ad92403e512be071ea928c75fda2cefd1848edf (diff) |
warn on loss of webgl context
Diffstat (limited to 'src')
-rw-r--r-- | src/library_browser.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index 6b2dfeff..c42cef14 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -69,6 +69,11 @@ mergeInto(LibraryManager.library, { #endif // Set the background of the WebGL canvas to black canvas.style.backgroundColor = "black"; + + // Warn on context loss + canvas.addEventListener('webglcontextlost', function(event) { + alert('WebGL context lost. You will need to reload the page.'); + }, false); } if (setInModule) { Module.ctx = ctx; |