MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / constructor

Method constructor

gpu-pipeline/webgl/gl-class.js:70–84  ·  view source on GitHub ↗
(gl)

Source from the content-addressed store, hash-verified

68// Utility class for drawing.
69class FullscreenQuad {
70 constructor(gl) {
71 this.squareVerticesBuffer_ = gl.createBuffer();
72 gl.bindBuffer(gl.ARRAY_BUFFER, this.squareVerticesBuffer_);
73 gl.bufferData(
74 gl.ARRAY_BUFFER, Float32Array.from([-1, -1, 1, -1, -1, 1, 1, 1]),
75 gl.STATIC_DRAW);
76
77 this.textureVerticesBuffer_ = gl.createBuffer();
78 gl.bindBuffer(gl.ARRAY_BUFFER, this.textureVerticesBuffer_);
79 gl.bufferData(
80 gl.ARRAY_BUFFER, Float32Array.from([0, 0, 1, 0, 0, 1, 1, 1]),
81 gl.STATIC_DRAW);
82
83 this.gl_ = gl;
84 }
85
86 // Draws a quad covering the entire bound framebuffer.
87 draw() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected