Home -> RawVertexAttribute -> SetInitialData

Description

The SetInitialData method supplies initial raw vertex data to upload when the buffer this attribute is assigned to is allocated. The source data is interpreted using the raw attribute layout supplied at construction time.

Initial data is consumed by IVertexBuffer.AllocateMemory. Use this path for data that is available before allocation and should be uploaded as part of the initial buffer creation.

WarningWarning

The supplied memory must remain valid and accessible until IVertexBuffer.AllocateMemory is called.

Usage

SuccessToken SetInitialData(const uint8_t* data, size_t entryCount, size_t entryStrideInBytes);

Argument list

data [const uint8_t*]
The source bytes to use when the buffer is allocated.
entryCount [size_t]
The number of vertex entries supplied in the source data.
entryStrideInBytes [size_t]
The byte stride between consecutive source entries.

Return value

[SuccessToken]
True if the operation succeeded, false otherwise. An assertion will be raised in debug builds if the result is not tested.

See also