diff options
Diffstat (limited to 'src/library_browser.js')
-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; |