WebGL 一

WebGL绘制窗口

<html>
<head><title>OpenGL Test</title>
</head>
<body>
<canvas id="myCanvas"></canvas>
<p>test</p>
<script type="text/javascript">

onload = function(){
  var c = document.getElementById("myCanvas");
  c.width = 500;
  c.height = 300;
  var gl = c.getContext("webgl") || c.getContext('experimental-webgl');
  gl.clearColor(0.0, 0.0, 0.0, 1.0);
  gl.clear(gl.COLOR_BUFFER_BIT);
}

</script>

</body>
</html>

posted @ 2017-10-26 11:11  decode126  阅读(132)  评论(0编辑  收藏  举报