Description
The WithDynamicUsage
method is a member of the TextureArrayBuilder
struct in the Sandbox namespace. This method configures the texture array to be used with dynamic usage, allowing for frequent updates to the texture data. This is particularly useful when the texture data is expected to change often, such as in dynamic textures or streaming scenarios.
Usage
To use the WithDynamicUsage
method, first create an instance of TextureArrayBuilder
. Then, call the WithDynamicUsage
method on this instance to set the usage type to dynamic. This method returns the modified TextureArrayBuilder
instance, allowing for method chaining to further configure the texture array.
Example
// Example of using WithDynamicUsage
TextureArrayBuilder builder = new TextureArrayBuilder();
builder = builder.WithDynamicUsage();
// Further configuration can be chained
builder = builder.WithSize(1024, 1024).WithFormat(ImageFormat.RGBA8);
// Finalize the texture creation
Texture texture = builder.Finish();