UNPKG

@animech-public/playcanvas

Version:
28 lines (27 loc) 980 B
/** * A cache storing shared resources associated with a device. The resources are removed * from the cache when the device is destroyed. * * @ignore */ export class DeviceCache { /** * Cache storing the resource for each GraphicsDevice * * @type {Map<import('./graphics-device.js').GraphicsDevice, any>} */ _cache: Map<import("./graphics-device.js").GraphicsDevice, any>; /** * Returns the resources for the supplied device. * * @param {import('./graphics-device.js').GraphicsDevice} device - The graphics device. * @returns {any} The resource for the device. */ get(device: import("./graphics-device.js").GraphicsDevice, onCreate: any): any; /** * Destroys and removes the content of the cache associated with the device * * @param {import('./graphics-device.js').GraphicsDevice} device - The graphics device. */ remove(device: import("./graphics-device.js").GraphicsDevice): void; }