Class SimpleTextureMapper
A custom TextureMapper implementation that uses a user-supplied callback to retrieve texture data. This mapper allows you to control how texture streams are opened, enabling scenarios such as loading from memory or over the network.
Namespace: TriLibCore.Samples
Assembly: TriLibCore.Samples.dll
Syntax
public class SimpleTextureMapper : TextureMapper
Methods
Map(TextureLoadingContext)
Overrides the default texture mapping logic to use the user-supplied callback.
Declaration
public override void Map(TextureLoadingContext textureLoadingContext)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureLoadingContext | textureLoadingContext | The context containing information about the texture being loaded. |
Overrides
Remarks
TriLib calls this method for each texture that needs to be loaded, allowing you to retrieve texture data from a custom source.
Setup(Func<ITexture, Stream>)
Configures the callback used for texture loading.
Declaration
public void Setup(Func<ITexture, Stream> streamReceivingCallback)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<ITexture, Stream> | streamReceivingCallback | A required callback that returns a Stream containing texture data. |
Exceptions
| Type | Condition |
|---|---|
| Exception | Thrown if |