Add frame buffers
This commit is contained in:
parent
066314ede8
commit
582979d3ed
1 changed files with 308 additions and 101 deletions
|
|
@ -0,0 +1,26 @@
|
|||
import { FragmentShaderOnlyProgram } from './fragment-shader-only-program';
|
||||
import { FrameBuffer } from './frame-buffer';
|
||||
|
||||
export class DefaultFrameBuffer extends FrameBuffer {
|
||||
constructor(
|
||||
gl: WebGL2RenderingContext,
|
||||
programs: Array<FragmentShaderOnlyProgram>
|
||||
) {
|
||||
super(gl, programs);
|
||||
this.frameBuffer = null;
|
||||
|
||||
this.setSize();
|
||||
}
|
||||
|
||||
public setSize() {
|
||||
super.setSize();
|
||||
|
||||
if (
|
||||
this.gl.canvas.width !== this.size.x ||
|
||||
this.gl.canvas.height !== this.size.y
|
||||
) {
|
||||
this.gl.canvas.width = this.size.x;
|
||||
this.gl.canvas.height = this.size.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue