Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions tdl/webgl.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,18 +98,16 @@ tdl.webgl.OTHER_PROBLEM = '' +
*/
tdl.webgl.setupWebGL = function(canvas, opt_attribs, opt_onError, opt_preferredContextType) {
function handleCreationError(msg) {
var container = canvas.parentNode;
if (container) {
var str = window.WebGLRenderingContext ?
tdl.webgl.OTHER_PROBLEM :
tdl.webgl.GET_A_WEBGL_BROWSER;
if (msg) {
str += "<br/><br/>Status: " + msg;
}
container.innerHTML = tdl.webgl.makeFailHTML(str);
str = window.WebGLRenderingContext ?
tdl.webgl.OTHER_PROBLEM :
tdl.webgl.GET_A_WEBGL_BROWSER;
if (msg) {
str += "<br/><br/>Status: " + msg;
}
};

var str = "";

opt_onError = opt_onError || handleCreationError;

if (canvas.addEventListener) {
Expand All@@ -131,6 +129,10 @@ tdl.webgl.setupWebGL = function(canvas, opt_attribs, opt_onError, opt_preferredC
}, false);
}
} else {
var container = canvas.parentNode;
if (container) {
container.innerHTML = tdl.webgl.makeFailHTML(str);
}
if (!window.WebGLRenderingContext) {
opt_onError("");
}
Expand Down