1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<p>
Even though this is becoming less and less of a problem, some devices or browsers may still not support WebGL.
The following method allows you to check if it is supported and display a message to the user if it is not.
</p>
<p>
Add [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]
to your javascript and run the following before attempting to render anything.
</p>
<code>
if ( WEBGL.isWebGLAvailable() ) {
// Initiate function or other initializations here
animate();
} else {
var warning = WEBGL.getWebGLErrorMessage();
document.getElementById( 'container' ).appendChild( warning );
}
</code>
</body>
</html>
|