var canvas = <HTMLCanvasElement>document.getElementById('canvas1');
var gl = canvas.getContext('webgl');
canvas.width = 400;
canvas.height = 400;
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
“HTMLCanvasElement”似乎只提供 2d 画布方法。它不会让我编译 gl.viewport() 等。如何添加对 WebGL 的支持?