MCPcopy
hub / github.com/processing/p5.js / createTexture

Method createTexture

src/webgl/p5.RendererGL.js:1187–1195  ·  view source on GitHub ↗
({ width, height, format, dataType })

Source from the content-addressed store, hash-verified

1185 }
1186
1187 createTexture({ width, height, format, dataType }) {
1188 const gl = this.GL;
1189 const tex = gl.createTexture();
1190 gl.bindTexture(gl.TEXTURE_2D, tex);
1191 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0,
1192 gl.RGBA, gl.UNSIGNED_BYTE, null);
1193 // TODO use format and data type
1194 return { texture: tex, glFormat: gl.RGBA, glDataType: gl.UNSIGNED_BYTE };
1195 }
1196
1197 createFramebufferTextureHandle(framebufferTexture) {
1198 // For WebGL, framebuffer texture handles are designed to be null

Callers 4

constructorMethod · 0.45
initMethod · 0.45

Calls 1

bindTextureMethod · 0.45

Tested by

no test coverage detected