TextureBuilder WithDepth( int depth )

book_4_sparkGenerated
code_blocksInput

Description

The WithDepth method of the TextureBuilder class allows you to specify the depth of a texture. This method is part of a fluent interface, enabling you to chain multiple configuration methods together to build a texture with specific properties.

Usage

To use the WithDepth method, call it on an instance of TextureBuilder and pass an integer value representing the desired depth of the texture. This method returns the same TextureBuilder instance, allowing for method chaining.

Example

// Example of using WithDepth method
TextureBuilder builder = new TextureBuilder();
builder.WithDepth(32)
       .WithSize(256, 256)
       .WithFormat(ImageFormat.RGBA8);

// After configuring, you can create the texture
Texture texture = builder.Create("MyTexture", false, data, data.Length);