WebGL-compatibility-check.html 931 B

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