Texture2DBuilder WithDynamicUsage()

robot_2Generated
code_blocksInput

Description

The WithDynamicUsage method is part of the Texture2DBuilder class in the Sandbox namespace. This method configures the texture to be created with dynamic usage, which is suitable for textures that will be updated frequently. Using dynamic usage can improve performance for textures that change often, as it allows for more efficient data updates.

Usage

To use the WithDynamicUsage method, first create an instance of Texture2DBuilder. Then, call the WithDynamicUsage method on this instance to set the texture usage to dynamic. This method can be chained with other configuration methods provided by Texture2DBuilder to further customize the texture before finalizing it with the Finish method.

Example

// Example of using WithDynamicUsage
Texture2DBuilder builder = new Texture2DBuilder();
Texture texture = builder
    .WithSize(256, 256)
    .WithDynamicUsage()
    .Finish();

// The texture is now configured with dynamic usage and can be used in the application.