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

Method _createTexture

src/tools/texture-lab/renderer.js:181–196  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

179 }
180
181 _createTexture(source) {
182 const gl = this.gl;
183 const texture = gl.createTexture();
184
185 gl.bindTexture(gl.TEXTURE_2D, texture);
186 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
187 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
188 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
189 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
190
191 if (source) {
192 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
193 }
194
195 return texture;
196 }
197
198 _createFramebuffer(width, height) {
199 const gl = this.gl;

Callers 4

setImageMethod · 0.95
setOverlayTextureMethod · 0.95
_updateCharacterAtlasMethod · 0.95
setDisplacementMapMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected