You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
928 B
35 lines
928 B
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<base href="../../../" />
|
|
<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/capabilities/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 {
|
|
|
|
const warning = WebGL.getWebGLErrorMessage();
|
|
document.getElementById( 'container' ).appendChild( warning );
|
|
|
|
}
|
|
</code>
|
|
</body>
|
|
</html>
|
|
|