Skip to content

Commit 44290ca

Browse files
Verbage
1 parent dfbcd36 commit 44290ca

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/src/app/view/background-webgl/background-webgl.component.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ void main() {
3636
}`;
3737
animate: () => void = () => {};
3838
dispose = false;
39-
private disposableBuffers: WebGLBuffer[] = [];
40-
private disposableArrayObjects: WebGLVertexArrayObject[] = [];
41-
private disposablePrograms: WebGLProgram[] = [];
42-
private disposableShaders: WebGLShader[] = [];
39+
private buffers: WebGLBuffer[] = [];
40+
private vertexArrays: WebGLVertexArrayObject[] = [];
41+
private programs: WebGLProgram[] = [];
42+
private shaders: WebGLShader[] = [];
4343
private gl: WebGL2RenderingContext | null = null;
4444

4545
ngOnInit(): void {
@@ -53,17 +53,17 @@ void main() {
5353

5454
// Release the OpenGL resources we allocated
5555
if (null !== this.gl) {
56-
for (let i = this.disposableBuffers.length - 1; i >= 0; i--) {
57-
this.gl.deleteBuffer(this.disposableBuffers[i]);
56+
for (let i = this.buffers.length - 1; i >= 0; i--) {
57+
this.gl.deleteBuffer(this.buffers[i]);
5858
}
59-
for (let i = this.disposableArrayObjects.length - 1; i >= 0; i--) {
60-
this.gl.deleteVertexArray(this.disposableArrayObjects[i]);
59+
for (let i = this.vertexArrays.length - 1; i >= 0; i--) {
60+
this.gl.deleteVertexArray(this.vertexArrays[i]);
6161
}
62-
for (let i = this.disposablePrograms.length - 1; i >= 0; i--) {
63-
this.gl.deleteProgram(this.disposablePrograms[i]);
62+
for (let i = this.programs.length - 1; i >= 0; i--) {
63+
this.gl.deleteProgram(this.programs[i]);
6464
}
65-
for (let i = this.disposableShaders.length - 1; i >= 0; i--) {
66-
this.gl.deleteShader(this.disposableShaders[i]);
65+
for (let i = this.shaders.length - 1; i >= 0; i--) {
66+
this.gl.deleteShader(this.shaders[i]);
6767
}
6868
}
6969
}
@@ -107,7 +107,7 @@ void main() {
107107
gl.compileShader(shader);
108108
const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
109109
if (success) {
110-
this.disposableShaders.push(shader);
110+
this.shaders.push(shader);
111111
return shader;
112112
}
113113

@@ -127,7 +127,7 @@ void main() {
127127
gl.linkProgram(program);
128128
const success = gl.getProgramParameter(program, gl.LINK_STATUS);
129129
if (success) {
130-
this.disposablePrograms.push(program);
130+
this.programs.push(program);
131131
return program;
132132
}
133133

@@ -164,8 +164,8 @@ void main() {
164164
}
165165

166166
// Save for disposing of resources later
167-
this.disposableArrayObjects.push(VAO)
168-
this.disposableBuffers.push(...[VBO, EBO]);
167+
this.vertexArrays.push(VAO)
168+
this.buffers.push(...[VBO, EBO]);
169169

170170
// bind the Vertex Array Object first, then bind and set vertex buffer(s), and then configure vertex attributes(s).
171171
gl.bindVertexArray(VAO);

0 commit comments

Comments
 (0)