MCPcopy Index your code
hub / github.com/processing/p5.js / constructor

Method constructor

src/webgl/p5.Texture.js:17–38  ·  view source on GitHub ↗
(renderer, obj, settings = {})

Source from the content-addressed store, hash-verified

15
16class Texture {
17 constructor (renderer, obj, settings = {}) {
18 this._renderer = renderer;
19
20 this.src = obj;
21
22 this.format = settings.format || 'rgba8unorm';
23 this.minFilter = settings.minFilter || constants.LINEAR;
24 this.magFilter = settings.magFilter || constants.LINEAR;
25 this.wrapS = settings.wrapS || renderer.states.textureWrapX;
26 this.wrapT = settings.wrapT || renderer.states.textureWrapY;
27 this.dataType = settings.dataType || 'uint8';
28
29 this.textureHandle = null;
30
31 this._detectSourceType();
32
33 const textureData = this._getTextureDataFromSource();
34 this.width = textureData.width;
35 this.height = textureData.height;
36
37 this.init(textureData);
38 }
39 /*
40 const support = checkWebGLCapabilities(renderer);
41 if (this.glFormat === gl.HALF_FLOAT && !support.halfFloat) {

Callers

nothing calls this directly

Calls 3

_detectSourceTypeMethod · 0.95
initMethod · 0.95

Tested by

no test coverage detected