summaryrefslogtreecommitdiff
path: root/misc/dist/html/default.html
diff options
context:
space:
mode:
Diffstat (limited to 'misc/dist/html/default.html')
-rw-r--r--misc/dist/html/default.html28
1 files changed, 17 insertions, 11 deletions
diff --git a/misc/dist/html/default.html b/misc/dist/html/default.html
index a1a4e89d02..4e3515a7b6 100644
--- a/misc/dist/html/default.html
+++ b/misc/dist/html/default.html
@@ -244,9 +244,6 @@ $GODOT_HEAD_INCLUDE
var statusMode = 'hidden';
var indeterminiateStatusAnimationId = 0;
- setStatusMode('indeterminate');
- engine.setCanvas(canvas);
-
function setStatusMode(mode) {
if (statusMode === mode || !initializing)
@@ -367,18 +364,27 @@ $GODOT_HEAD_INCLUDE
});
}
- engine.startGame(BASENAME + '.pck').then(() => {
- setStatusMode('hidden');
- initializing = false;
- }, err => {
+ function displayFailureNotice(err) {
+ var msg = err.message || err;
if (DEBUG_ENABLED) {
- printError(err.message);
- console.warn(err);
+ printError(msg);
}
- setStatusNotice(err.message);
+ console.error(msg);
+ setStatusNotice(msg);
setStatusMode('notice');
initializing = false;
- });
+ };
+
+ if (!Engine.isWebGLAvailable()) {
+ displayFailureNotice("WebGL not available");
+ } else {
+ setStatusMode('indeterminate');
+ engine.setCanvas(canvas);
+ engine.startGame(BASENAME + '.pck').then(() => {
+ setStatusMode('hidden');
+ initializing = false;
+ }, displayFailureNotice);
+ }
})();
//]]></script>
</body>