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

Method _recreateTextures

src/webgl/p5.Framebuffer.js:452–485  ·  view source on GitHub ↗

* Creates new textures and renderbuffers given the current size of the * framebuffer. * * @private

()

Source from the content-addressed store, hash-verified

450 * @private
451 */
452 _recreateTextures() {
453 this._updateSize();
454
455 // Let renderer handle texture creation and framebuffer setup
456 this.renderer.recreateFramebufferTextures(this);
457
458 if (this.useDepth) {
459 this.depth = new FramebufferTexture(this, 'depthTexture');
460 const depthFilter = constants.NEAREST;
461 this.depthP5Texture = new Texture(
462 this.renderer,
463 this.depth,
464 {
465 minFilter: depthFilter,
466 magFilter: depthFilter
467 }
468 );
469 this.renderer.textures.set(this.depth, this.depthP5Texture);
470 }
471
472 this.color = new FramebufferTexture(this, 'colorTexture');
473 const filter = this.textureFiltering === constants.LINEAR
474 ? constants.LINEAR
475 : constants.NEAREST;
476 this.colorP5Texture = new Texture(
477 this.renderer,
478 this.color,
479 {
480 minFilter: filter,
481 magFilter: filter
482 }
483 );
484 this.renderer.textures.set(this.color, this.colorP5Texture);
485 }
486
487 /**
488 * A method that will be called when recreating textures. If the framebuffer

Callers 2

constructorMethod · 0.95
_handleResizeMethod · 0.95

Calls 3

_updateSizeMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected