Description
The WithStaticUsage
method is a part of the Texture2DBuilder
class in the Sandbox namespace. This method configures the texture to be used with static usage, which is optimal for textures that do not change frequently. This can improve performance by allowing the graphics hardware to optimize the storage and access patterns for the texture.
Usage
To use the WithStaticUsage
method, first create an instance of Texture2DBuilder
. Then, call the WithStaticUsage
method on this instance to set the texture usage to static. This method returns the same Texture2DBuilder
instance, allowing for method chaining.
Example
// Example of using WithStaticUsage
Texture2DBuilder builder = new Texture2DBuilder();
builder.WithStaticUsage();
Texture texture = builder.Finish();
// The texture is now configured with static usage.