- 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
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
import type { Program, Texture, BaseTexture } from '@pixi/core';
/**
* @todo Describe property usage
* @static
* @name ProgramCache
* @memberof PIXI.utils
* @type {object}
*/
export const ProgramCache: {[key: string]: Program} = {};
/**
* @todo Describe property usage
* @static
* @name TextureCache
* @memberof PIXI.utils
* @type {object}
*/
export const TextureCache: {[key: string]: Texture} = Object.create(null);
/**
* @todo Describe property usage
* @static
* @name BaseTextureCache
* @memberof PIXI.utils
* @type {object}
*/
export const BaseTextureCache: {[key: string]: BaseTexture} = Object.create(null);
/**
* Destroys all texture in the cache
* @memberof PIXI.utils
* @function destroyTextureCache
*/
export function destroyTextureCache(): void
{
let key;
for (key in TextureCache)
{
TextureCache[key].destroy();
}
for (key in BaseTextureCache)
{
BaseTextureCache[key].destroy();
}
}
/**
* Removes all textures from cache, but does not destroy them
* @memberof PIXI.utils
* @function clearTextureCache
*/
export function clearTextureCache(): void
{
let key;
for (key in TextureCache)
{
delete TextureCache[key];
}
for (key in BaseTextureCache)
{
delete BaseTextureCache[key];
}
}