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);
The "HTMLCanvasElement" seems to offer only 2d canvas methods. This will not allow me to compile gl.viewport (), etc. How to add this support for WebGL?
source share