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

Method bindShader

src/webgl/p5.Shader.js:796–808  ·  view source on GitHub ↗

* initializes (if needed) and binds the shader program. * @private

(shaderType, options)

Source from the content-addressed store, hash-verified

794 * @private
795 */
796 bindShader(shaderType, options) {
797 if (this.shaderType && this.shaderType !== shaderType) {
798 throw new Error(
799 `You've already used this shader as a ${this.shaderType} shader, but are now using it as a ${shaderType}.`
800 );
801 }
802 this.shaderType = shaderType;
803 this.init();
804 if (!this._bound) {
805 this.useProgram(options);
806 this._bound = true;
807 }
808 }
809
810 /**
811 * @chainable

Callers 5

testShaderFunction · 0.80
_renderPassMethod · 0.80
_drawFillsMethod · 0.80
_drawStrokesMethod · 0.80
textFunction · 0.80

Calls 2

initMethod · 0.95
useProgramMethod · 0.95

Tested by

no test coverage detected