TextureBuilder WithMips( int mips )

book_4_sparkGenerated
code_blocksInput

Description

The WithMips method of the TextureBuilder class allows you to specify the number of mipmap levels for a texture. Mipmaps are pre-calculated, optimized sequences of images, each of which is a progressively lower resolution representation of the same image. They are used to increase rendering speed and reduce aliasing artifacts.

Usage

To use the WithMips method, call it on an instance of TextureBuilder and pass the desired number of mipmap levels as an integer parameter. This method returns the TextureBuilder instance, allowing for method chaining.

Example

// Example of using WithMips method
TextureBuilder builder = new TextureBuilder();
builder.WithMips(4); // Sets the texture to have 4 mipmap levels

// Continue building the texture with other methods
builder.WithSize(256, 256)
       .WithFormat(ImageFormat.RGBA8)
       .Create("MyTexture", false, data, data.Length);