DriftTexture · function
assignLayer
Give this material a layer. Returns it, or -1 when the array is full.
Explained in DriftTexture.
function assignLayer(array: MaterialArray, materialId: number, contentHash: string): numberimport { assignLayer } from '@driftengine/texture';Parameters
| Parameter | Type | Description |
|---|---|---|
array | MaterialArray | |
materialId | number | |
contentHash | string |
In depth
Full reports failure rather than evicting. An eviction here would silently repoint a material that is still being drawn, which is a texture swap nobody asked for in the middle of a frame; a caller that runs out needs to know.