()
| 285 | } |
| 286 | |
| 287 | function captureScreenshot () { |
| 288 | let res = getResolution(config.CAPTURE_RESOLUTION); |
| 289 | let target = createFBO(res.width, res.height, ext.formatRGBA.internalFormat, ext.formatRGBA.format, ext.halfFloatTexType, gl.NEAREST); |
| 290 | render(target); |
| 291 | |
| 292 | let texture = framebufferToTexture(target); |
| 293 | texture = normalizeTexture(texture, target.width, target.height); |
| 294 | |
| 295 | let captureCanvas = textureToCanvas(texture, target.width, target.height); |
| 296 | let datauri = captureCanvas.toDataURL(); |
| 297 | downloadURI('fluid.png', datauri); |
| 298 | URL.revokeObjectURL(datauri); |
| 299 | } |
| 300 | |
| 301 | function framebufferToTexture (target) { |
| 302 | gl.bindFramebuffer(gl.FRAMEBUFFER, target.fbo); |
nothing calls this directly
no test coverage detected