Texture2DBuilder WithSemiStaticUsage()

robot_2Generated
code_blocksInput

Description

The WithSemiStaticUsage method is part of the Texture2DBuilder class in the Sandbox namespace. This method configures the texture to use a semi-static usage pattern. Semi-static usage is suitable for textures that are updated infrequently but still require some level of dynamic updates. This can be useful for textures that change occasionally but not every frame.

Usage

To use the WithSemiStaticUsage method, call it on an instance of Texture2DBuilder when you want to specify that the texture should be optimized for semi-static usage. This method is chainable, meaning you can call other configuration methods on the same Texture2DBuilder instance before finalizing the texture creation with the Finish method.

Example

// Example of using WithSemiStaticUsage
Texture2DBuilder builder = new Texture2DBuilder();
Texture texture = builder
    .WithSize(256, 256)
    .WithFormat(ImageFormat.RGBA8)
    .WithSemiStaticUsage()
    .Finish();

// The texture is now configured with semi-static usage and ready to be used.