aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-14 16:17:02 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-14 16:17:02 -0700
commitfaf13f78df6aba1f4eddcca1f0778eaa878e1495 (patch)
treededc9ea66f305f88d27a839eeeb34f90e60c0d8d /src
parent2ad92403e512be071ea928c75fda2cefd1848edf (diff)
warn on loss of webgl context
Diffstat (limited to 'src')
-rw-r--r--src/library_browser.js5
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;