Forum

custom WebGL window

04 February 2015 07:46
I wanted to make my own custom "Could not initialize WebGL" window. I can't find any documentation on this, what is the proper method?

Thanks!
04 February 2015 11:21
Hi,

Generally this is being done with a background image placed inside a canvas html-element. Something like this:
<canvas id="canvas-elem" background-image="fallback_image.jpg">
</canvas>

If you use our app.js addon, then your canvas is created dynamically inside canvas_container, and you can just put an image-element under canvas container and remove canvas element in initialization callback:
function init_cb(canvas_elem, success) {
    if (!success) {
        var container = document.getElementById("your_canvas_container ");
        container.removeChild(canvas_elem);
        return null;
    }

If you use Web Player then you can follow the recommendations from our documentation.
29 April 2015 00:24
I redirected users to a new page via the following code:

function initCb(canvas_elem, success) {
		if (!success) {																// If the load was not a success
			//console.log("b4w init failure");										
			document.location = "YOUR_HTML_PAGE.html"; // Display WebGL error page
			return;
		}
}
 
Please register or log in to leave a reply.