(renderer, obj, settings = {})
| 15 | |
| 16 | class 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) { |
nothing calls this directly
no test coverage detected