Home -> VertexAttribute -> SetInitialData
Description
The SetInitialData method supplies initial data to use when allocating the buffer this attribute is assigned to. Note that the supplied memory must remain valid and accessible until the AllocateMemory method is called.
Warning
Initial data is consumed when memory is allocated. The source memory must remain valid and unmodified until allocation occurs.
Usage
SuccessToken SetInitialData(const T* data, size_t entryCount, size_t entryStrideInBytes = sizeof(T));
SuccessToken SetInitialData(const std::vector<T>& data);
SuccessToken SetInitialData(std::vector<T>&& data) = delete;
SuccessToken SetInitialData(std::initializer_list<T> data);
Argument list
- data [const T*]
- The source data to use when the attribute buffer is allocated.
- entryCount [size_t]
- The number of 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.