* initializes (if needed) and binds the shader program. * @private
(shaderType, options)
| 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 |
no test coverage detected