2
0

WebGL-compatibility-check.html 988 B

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE html>
  2. <html lang="ko">
  3. <head>
  4. <meta charset="utf-8">
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>WebGL 호환성 검사([name])</h1>
  11. <p>
  12. 아마 거의 문제가 되지 않을테지만, 몇몇 디바이스나 브라우저는 아직 WebGL을 지원하지 않습니다.
  13. 아래 메서드는 지원 여부를 체크해 가능한지 아닌지 메세지를 띄워줄 것입니다.
  14. </p>
  15. <p>
  16. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]를 스크립트에 추가하고 무언가를 렌더링하기 전에 아래 코드를 실행해보세요.
  17. </p>
  18. <code>
  19. if ( WebGL.isWebGLAvailable() ) {
  20. // Initiate function or other initializations here
  21. animate();
  22. } else {
  23. const warning = WebGL.getWebGLErrorMessage();
  24. document.getElementById( 'container' ).appendChild( warning );
  25. }
  26. </code>
  27. </body>
  28. </html>