MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / _useProgram

Method _useProgram

src/tools/texture-lab/renderer.js:216–231  ·  view source on GitHub ↗
(program, flipY = 1.0)

Source from the content-addressed store, hash-verified

214 }
215
216 _useProgram(program, flipY = 1.0) {
217 const gl = this.gl;
218 gl.useProgram(program);
219
220 gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
221 gl.enableVertexAttribArray(program.attributes.position);
222 gl.vertexAttribPointer(program.attributes.position, 2, gl.FLOAT, false, 0, 0);
223
224 gl.bindBuffer(gl.ARRAY_BUFFER, this.texCoordBuffer);
225 gl.enableVertexAttribArray(program.attributes.texCoord);
226 gl.vertexAttribPointer(program.attributes.texCoord, 2, gl.FLOAT, false, 0, 0);
227
228 if (program.uniforms.u_flipY !== undefined) {
229 gl.uniform1f(program.uniforms.u_flipY, flipY);
230 }
231 }
232
233 _blendModeToInt(mode) {
234 switch (mode) {

Callers 15

renderMethod · 0.95
_renderPassthroughMethod · 0.95
_renderNoiseMethod · 0.95
_renderDitherMethod · 0.95
_renderHalftoneMethod · 0.95
_renderAsciiMethod · 0.95
_renderOverlayMethod · 0.95
_renderChromaticMethod · 0.95
_renderVignetteMethod · 0.95
_renderScanlinesMethod · 0.95
_renderPixelateMethod · 0.95
_renderBlurMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected