Description
The WithData
method of the TextureCubeBuilder
class allows you to specify the raw byte data for the texture cube being built. This method is part of a fluent interface, enabling method chaining to configure various properties of the texture cube before finalizing it with the Finish
method.
Usage
To use the WithData
method, you need to pass a byte array containing the texture data. This data should be formatted appropriately for a texture cube, typically including data for each face of the cube.
Example usage:
var textureBuilder = new TextureCubeBuilder();
textureBuilder.WithData(myTextureData)
.WithSize(256, 256)
.WithFormat(ImageFormat.RGBA8)
.Finish();
In this example, myTextureData
is a byte array containing the texture data. The texture is configured with a size of 256x256 and a format of RGBA8 before being finalized.
Example
var textureData = new byte[] { /* texture data bytes */ };
var textureCube = new TextureCubeBuilder()
.WithData(textureData)
.WithSize(512, 512)
.WithFormat(ImageFormat.RGBA8)
.Finish();