/** Used to set canvas size. */
static #cores: number = Math.max(1, Math.floor(navigator.hardwareConcurrency))
static #WORKLOAD: number = 256 * this.#cores
- static #canvas: OffscreenCanvas = new OffscreenCanvas(this.#WORKLOAD, this.#WORKLOAD)
+ static #canvas: OffscreenCanvas
static get size () { return this.#gl?.drawingBufferWidth }
static #gl: WebGL2RenderingContext | null
this.#busy = true
try {
+ this.#canvas = new OffscreenCanvas(this.#WORKLOAD, this.#WORKLOAD)
this.#canvas.addEventListener('webglcontextlost', event => {
event.preventDefault()
console.warn('WebGL context lost. Waiting for it to be restored...')