Skip to content

IAssetLoader.GetOrLoadTextureAsync(string, TextureScaleMode, CancellationToken) Method

Definition

Namespace: Brine2D.Assets

Returns a cached texture, loading it on first request. The (path, scaleMode) pair is the cache key; the same file at different scale modes is two separate entries.

System.Threading.Tasks.Task<Brine2D.Rendering.ITexture> GetOrLoadTextureAsync(string path, Brine2D.Rendering.TextureScaleMode scaleMode=Brine2D.Rendering.TextureScaleMode.Linear, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

path System.String

scaleMode TextureScaleMode

cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<ITexture>