(gl: WebGLRenderingContext, tex: WebGLTexture)
| 523 | } |
| 524 | |
| 525 | function createFramebuffer(gl: WebGLRenderingContext, tex: WebGLTexture): WebGLFramebuffer { |
| 526 | const fbo = gl.createFramebuffer(); |
| 527 | if (!fbo) throw new Error("[HyperShader] Failed to create framebuffer"); |
| 528 | gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); |
| 529 | gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); |
| 530 | gl.bindFramebuffer(gl.FRAMEBUFFER, null); |
| 531 | return fbo; |
| 532 | } |
| 533 | |
| 534 | function createSnapshotLoadingOverlay( |
| 535 | root: HTMLElement | null, |