From e06edc67c049c65c3952a8447e22717a0f492020 Mon Sep 17 00:00:00 2001 From: eska Date: Tue, 31 Jan 2017 03:46:30 +0100 Subject: Enable WebGL2 in web export, start fixing build Will not yet compile --- platform/javascript/godot_shell.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'platform/javascript/godot_shell.html') diff --git a/platform/javascript/godot_shell.html b/platform/javascript/godot_shell.html index a8b959493..65f3b4a34 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..."); -- cgit v1.2.3-70-g09d2