diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-03-15 08:55:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-15 08:55:14 +0100 |
commit | 506c4926577910230eceecd07df3cc42e423d25f (patch) | |
tree | 5b5d883fe1e3997c494b5da21fe7352b343d501a /misc/dist | |
parent | 955397dfd5845c0bd1510581a77d20989f13ab19 (diff) | |
parent | 61026e62bf8659a4ffe4fc1b5cbd404d3e25adeb (diff) |
Merge pull request #17520 from eska014/wasm-webgl1
Check only for WebGL 1.0 before starting downloads, move test to HTML file
Diffstat (limited to 'misc/dist')
-rw-r--r-- | misc/dist/html/default.html | 28 |
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> |