Skip to content

ITextureLoader Interface

Definition

Namespace: Brine2D.Rendering

Low-level texture loading interface.

For most use cases, use instead!

This interface is for advanced scenarios like: - Custom texture loading implementations - Framework/system-level texture management - Direct texture operations without caching

C#
public interface ITextureLoader : System.IDisposable

Derived
HeadlessTextureLoader

Implements System.IDisposable

Remarks

\<strong>Prefer IAssetLoader for scene asset loading\</strong> - it provides: - Automatic caching - Progress tracking - Parallel loading - Thread-safe operations

Methods
CreateTexture\(int, int, TextureScaleMode\) Creates a blank texture with the specified dimensions.
LoadTexture\(string, TextureScaleMode\) Loads a texture from a file path synchronously.
LoadTextureAsync\(string, TextureScaleMode, CancellationToken\) Loads a texture from a file path asynchronously.
UnloadTexture\(ITexture\) Unloads a texture and frees its resources. Implementations must be idempotent — calling this twice with the same instance must not throw or cause a double-free of native resources.