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

Method _applyClip

src/webgl/p5.RendererGL.js:474–491  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

472 }
473
474 _applyClip() {
475 const gl = this.GL;
476 gl.clearStencil(0);
477 gl.clear(gl.STENCIL_BUFFER_BIT);
478 this._internalEnable.call(gl, gl.STENCIL_TEST);
479 this._stencilTestOn = true;
480 gl.stencilFunc(
481 gl.ALWAYS, // the test
482 1, // reference value
483 0xff // mask
484 );
485 gl.stencilOp(
486 gl.KEEP, // what to do if the stencil test fails
487 gl.KEEP, // what to do if the depth test fails
488 gl.REPLACE // what to do if both tests pass
489 );
490 gl.disable(gl.DEPTH_TEST);
491 }
492
493 _unapplyClip() {
494 const gl = this.GL;

Callers 1

beginClipMethod · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected