1 | import { SAMPLER_TYPES } from '@pixi/constants';
|
2 | import { BaseTexture } from './BaseTexture';
|
3 | import { GLTexture } from './GLTexture';
|
4 | import type { ExtensionMetadata } from '@pixi/extensions';
|
5 | import type { IRenderingContext } from '../IRenderer';
|
6 | import type { Renderer } from '../Renderer';
|
7 | import type { ISystem } from '../system/ISystem';
|
8 | import type { Texture } from './Texture';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare class TextureSystem implements ISystem {
|
14 |
|
15 | static extension: ExtensionMetadata;
|
16 | |
17 |
|
18 |
|
19 |
|
20 | boundTextures: BaseTexture[];
|
21 | |
22 |
|
23 |
|
24 |
|
25 | managedTextures: Array<BaseTexture>;
|
26 |
|
27 | protected hasIntegerTextures: boolean;
|
28 | protected CONTEXT_UID: number;
|
29 | protected gl: IRenderingContext;
|
30 | protected internalFormats: {
|
31 | [type: number]: {
|
32 | [format: number]: number;
|
33 | };
|
34 | };
|
35 | protected samplerTypes: Record<number, SAMPLER_TYPES>;
|
36 | protected webGLVersion: number;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | protected unknownTexture: BaseTexture;
|
42 | |
43 |
|
44 |
|
45 |
|
46 | protected _unknownBoundTextures: boolean;
|
47 | |
48 |
|
49 |
|
50 |
|
51 | currentLocation: number;
|
52 | emptyTextures: {
|
53 | [key: number]: GLTexture;
|
54 | };
|
55 | private renderer;
|
56 | |
57 |
|
58 |
|
59 | constructor(renderer: Renderer);
|
60 | /** Sets up the renderer context and necessary buffers. */
|
61 | contextChange(): void;
|
62 | /**
|
63 | * Bind a texture to a specific location
|
64 | *
|
65 | * If you want to unbind something, please use `unbind(texture)` instead of `bind(null, textureLocation)`
|
66 | * @param texture - Texture to bind
|
67 | * @param [location=0] - Location to bind at
|
68 | */
|
69 | bind(texture: Texture | BaseTexture, location?: number): void;
|
70 | /** Resets texture location and bound textures Actual `bind(null, i)` calls will be performed at next `unbind()` call */
|
71 | reset(): void;
|
72 | /**
|
73 | * Unbind a texture.
|
74 | * @param texture - Texture to bind
|
75 | */
|
76 | unbind(texture?: BaseTexture): void;
|
77 | /**
|
78 | * Ensures that current boundTextures all have FLOAT sampler type,
|
79 | * see {@link PIXI.SAMPLER_TYPES} for explanation.
|
80 | * @param maxTextures - number of locations to check
|
81 | */
|
82 | ensureSamplerType(maxTextures: number): void;
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 | initTexture(texture: BaseTexture): GLTexture;
|
89 | initTextureType(texture: BaseTexture, glTexture: GLTexture): void;
|
90 | |
91 |
|
92 |
|
93 |
|
94 |
|
95 | updateTexture(texture: BaseTexture): void;
|
96 | |
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | destroyTexture(texture: BaseTexture | Texture, skipRemove?: boolean): void;
|
103 | |
104 |
|
105 |
|
106 |
|
107 |
|
108 | updateTextureStyle(texture: BaseTexture): void;
|
109 | |
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | setStyle(texture: BaseTexture, glTexture: GLTexture): void;
|
116 | destroy(): void;
|
117 | }
|