(canvas)
| 60 | |
| 61 | export class WebGLRenderer { |
| 62 | constructor(canvas) { |
| 63 | this.canvas = canvas; |
| 64 | this.gl = canvas.getContext('webgl2') || canvas.getContext('webgl'); |
| 65 | |
| 66 | if (!this.gl) { |
| 67 | throw new Error('WebGL not supported'); |
| 68 | } |
| 69 | |
| 70 | this.programs = {}; |
| 71 | this.textures = {}; |
| 72 | this.framebuffers = []; |
| 73 | this.quadBuffer = null; |
| 74 | this.texCoordBuffer = null; |
| 75 | this.currentCharset = null; |
| 76 | |
| 77 | this._initBuffers(); |
| 78 | this._initPrograms(); |
| 79 | } |
| 80 | |
| 81 | _initBuffers() { |
| 82 | const gl = this.gl; |
nothing calls this directly
no test coverage detected