diff options
author | eska <eska@eska.me> | 2017-01-31 03:46:30 +0100 |
---|---|---|
committer | eska <eska@eska.me> | 2017-02-01 10:21:04 +0100 |
commit | e06edc67c049c65c3952a8447e22717a0f492020 (patch) | |
tree | ca08d23b54fbb40fb609b44a58395eb72b3203fb /platform/javascript/godot_shell.html | |
parent | 7b059965e8df745c5b45b4ec6bfbdfe1a7397642 (diff) |
Enable WebGL2 in web export, start fixing build
Will not yet compile
Diffstat (limited to 'platform/javascript/godot_shell.html')
-rw-r--r-- | platform/javascript/godot_shell.html | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/platform/javascript/godot_shell.html b/platform/javascript/godot_shell.html index a8b9594935..65f3b4a340 100644 --- a/platform/javascript/godot_shell.html +++ b/platform/javascript/godot_shell.html @@ -277,10 +277,10 @@ $GODOT_STYLE_INCLUDE statusElement.appendChild(closeNote); Presentation.setStatusVisible(true); }, - isWebGLAvailable: function isWebGLAvailable() { + isWebGL2Available: function isWebGL2Available() { var context; try { - context = canvasElement.getContext("webgl") || canvasElement.getContext("experimental-webgl"); + context = canvasElement.getContext("webgl2") || canvasElement.getContext("experimental-webgl2"); } catch (e) {} return !!context; }, @@ -319,12 +319,12 @@ $GODOT_STYLE_INCLUDE outputElement.firstChild.remove(); } var msg = document.createElement("div"); - if (text.trim().startsWith("**ERROR**") - || text.startsWith("**EXCEPTION**")) { + if (String.prototype.trim.call(text).startsWith("**ERROR**") + || String.prototype.trim.call(text).startsWith("**EXCEPTION**")) { msg.style.color = "#d44"; - } else if (text.trim().startsWith("**WARNING**")) { + } else if (String.prototype.trim.call(text).startsWith("**WARNING**")) { msg.style.color = "#ccc000"; - } else if (text.trim().startsWith("**SCRIPT ERROR**")) { + } else if (String.prototype.trim.call(text).startsWith("**SCRIPT ERROR**")) { msg.style.color = "#c6d"; } msg.textContent = text; @@ -395,8 +395,8 @@ $GODOT_STYLE_INCLUDE } }; - if (!Presentation.isWebGLAvailable()) { - Presentation.setStatus("WebGL appears to be unsupported in the current browser.\nPlease try updating or use a different browser."); + if (!Presentation.isWebGL2Available()) { + Presentation.setStatus("WebGL2 appears to be unsupported in the current browser.\nPlease try updating or use a different browser."); Presentation.preventLoading = true; } else { Presentation.setStatus("Downloading..."); |