MCPcopy
hub / github.com/processing/p5.js / updateFramebufferTexture

Method updateFramebufferTexture

src/webgl/p5.RendererGL.js:1692–1726  ·  view source on GitHub ↗
(framebuffer, property)

Source from the content-addressed store, hash-verified

1690 }
1691
1692 updateFramebufferTexture(framebuffer, property) {
1693 if (framebuffer.antialias) {
1694 const gl = this.GL;
1695 gl.bindFramebuffer(gl.READ_FRAMEBUFFER, framebuffer.aaFramebuffer);
1696 gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebuffer.framebuffer);
1697 const partsToCopy = {
1698 colorTexture: [
1699 gl.COLOR_BUFFER_BIT,
1700 framebuffer.colorP5Texture.magFilter === constants.LINEAR ? gl.LINEAR : gl.NEAREST
1701 ],
1702 };
1703 if (framebuffer.useDepth) {
1704 partsToCopy.depthTexture = [
1705 gl.DEPTH_BUFFER_BIT,
1706 framebuffer.depthP5Texture.magFilter === constants.LINEAR ? gl.LINEAR : gl.NEAREST
1707 ];
1708 }
1709 const [flag, filter] = partsToCopy[property];
1710 gl.blitFramebuffer(
1711 0,
1712 0,
1713 framebuffer.width * framebuffer.density,
1714 framebuffer.height * framebuffer.density,
1715 0,
1716 0,
1717 framebuffer.width * framebuffer.density,
1718 framebuffer.height * framebuffer.density,
1719 flag,
1720 filter
1721 );
1722
1723 const activeFbo = this.activeFramebuffer();
1724 this.bindFramebuffer(activeFbo);
1725 }
1726 }
1727
1728 bindFramebuffer(framebuffer) {
1729 const gl = this.GL;

Callers 1

_updateMethod · 0.45

Calls 2

bindFramebufferMethod · 0.95
activeFramebufferMethod · 0.80

Tested by

no test coverage detected