- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
import { FORMATS, TYPES } from '@pixi/constants';
/**
* Internal texture for WebGL context.
* @memberof PIXI
*/
export class GLTexture
{
/** The WebGL texture. */
public texture: WebGLTexture;
/** Width of texture that was used in texImage2D. */
public width: number;
/** Height of texture that was used in texImage2D. */
public height: number;
/** Whether mip levels has to be generated. */
public mipmap: boolean;
/** WrapMode copied from baseTexture. */
public wrapMode: number;
/** Type copied from baseTexture. */
public type: number;
/** Type copied from baseTexture. */
public internalFormat: number;
/** Type of sampler corresponding to this texture. See PIXI.SAMPLER_TYPES */
public samplerType: number;
/** Texture contents dirty flag. */
dirtyId: number;
/** Texture style dirty flag. */
dirtyStyleId: number;
constructor(texture: WebGLTexture)
{
this.texture = texture;
this.width = -1;
this.height = -1;
this.dirtyId = -1;
this.dirtyStyleId = -1;
this.mipmap = false;
this.wrapMode = 33071;
this.type = TYPES.UNSIGNED_BYTE;
this.internalFormat = FORMATS.RGBA;
this.samplerType = 0;
}
}