Add more improvements

This commit is contained in:
schmelczerandras 2020-09-16 14:45:08 +02:00
parent e1c74a8054
commit bc16bdd62e
29 changed files with 288 additions and 160 deletions

View file

@ -1,16 +1,17 @@
import { vec2 } from 'gl-matrix';
import { settings } from '../../settings';
export abstract class FrameBuffer {
public renderScale = 1;
public enableHighDpiRendering = settings.enableHighDpiRendering;
protected size = vec2.create();
// null means the default framebuffer
protected frameBuffer: WebGLFramebuffer | null = null;
constructor(protected gl: WebGL2RenderingContext) {}
constructor(
protected gl: WebGL2RenderingContext,
private enableHighDpiRendering: boolean
) {}
public bindAndClear(colorInput?: WebGLTexture) {
this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, this.frameBuffer);