view/renderer/Renderer: remove dead code
This commit is contained in:
parent
7112f40a70
commit
b04f18e29a
1 changed files with 0 additions and 33 deletions
|
@ -64,37 +64,4 @@ export default class Renderer {
|
||||||
|
|
||||||
this.gl.uniform2f(this.shaders.translateLoc, -5.0, -5.0);
|
this.gl.uniform2f(this.shaders.translateLoc, -5.0, -5.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAttribLocation(program: WebGLProgram, name: string): number {
|
|
||||||
const ret = this.gl.getAttribLocation(program, name);
|
|
||||||
if (ret < 0)
|
|
||||||
throw new Error("unable to get location of attribute '" + name + "'");
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation {
|
|
||||||
const ret = this.gl.getUniformLocation(program, name);
|
|
||||||
if (!ret)
|
|
||||||
throw new Error("unable to get location of uniform '" + name + "'");
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private compileShader(type: number, src: string): WebGLShader {
|
|
||||||
const shader = this.gl.createShader(type);
|
|
||||||
if (!shader)
|
|
||||||
throw new Error('Unable to create shader');
|
|
||||||
|
|
||||||
this.gl.shaderSource(shader, src);
|
|
||||||
this.gl.compileShader(shader);
|
|
||||||
|
|
||||||
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
|
|
||||||
const err = this.gl.getShaderInfoLog(shader);
|
|
||||||
this.gl.deleteShader(shader);
|
|
||||||
throw new Error('Unable to compile shader: ' + err);
|
|
||||||
}
|
|
||||||
|
|
||||||
return shader;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue