(engine: Engine, vertexSource: string, fragmentSource: string)
| 69 | } |
| 70 | |
| 71 | constructor(engine: Engine, vertexSource: string, fragmentSource: string) { |
| 72 | this._engine = engine; |
| 73 | this._gl = engine._hardwareRenderer.gl; |
| 74 | this._glProgram = this._createProgram(vertexSource, fragmentSource); |
| 75 | |
| 76 | if (this._glProgram) { |
| 77 | this._isValid = true; |
| 78 | this._recordLocation(); |
| 79 | } else { |
| 80 | this._isValid = false; |
| 81 | } |
| 82 | |
| 83 | this.id = ShaderProgram._counter++; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Upload all shader data in shader uniform block. |
nothing calls this directly
no test coverage detected