Various improvements

This commit is contained in:
schmelczerandras 2020-09-18 15:27:21 +02:00
parent ca2ac3fd2d
commit 8e73aee9ba
18 changed files with 259 additions and 115 deletions

View file

@ -23,6 +23,10 @@ export abstract class FrameBuffer {
this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);
}
public destroy(): void {
this.gl.deleteFramebuffer(this.frameBuffer);
}
public setSize(): boolean {
const realToCssPixels =
(this.enableHighDpiRendering ? window.devicePixelRatio : 1) * this.renderScale;

View file

@ -28,6 +28,10 @@ export class IntermediateFrameBuffer extends FrameBuffer {
this.setSize();
}
public destroy(): void {
this.gl.deleteTexture(this.frameTexture);
}
public get colorTexture(): WebGLTexture {
return this.frameTexture;
}