ezEngine  Milestone 7
ezMeshBufferResourceDescriptor Struct Reference

Public Member Functions

ezUInt32 AddStream (ezGALVertexAttributeSemantic::Enum Semantic, ezGALResourceFormat::Enum Format)
 Use this function to add vertex streams to the mesh buffer. The return value is the index of the just added stream.
 
void AllocateStreams (ezUInt32 uiNumVertices, ezUInt32 uiNumTriangles=0)
 After all streams are added, call this to allocate the data for the streams. If uiNumTriangles is 0, the mesh buffer will not use indexed rendering.
 
const ezDynamicArray< ezUInt8 > & GetVertexBufferData () const
 Gives read access to the allocated vertex data.
 
const ezDynamicArray< ezUInt8 > & GetIndexBufferData () const
 Gives read access to the allocated index data.
 
ezDynamicArray< ezUInt8 > & GetVertexBufferData ()
 Allows write access to the allocated vertex data. This can be used for copying data fast into the array.
 
ezDynamicArray< ezUInt8 > & GetIndexBufferData ()
 Allows write access to the allocated index data. This can be used for copying data fast into the array.
 
template<typename TYPE >
void SetVertexData (ezUInt32 uiStream, ezUInt32 uiVertexIndex, const TYPE &data)
 Slow, but convenient method to write one piece of vertex data at a time into the stream buffer. More...
 
void SetTriangleIndices (ezUInt32 uiTriangle, ezUInt32 uiVertex0, ezUInt32 uiVertex1, ezUInt32 uiVertex2)
 Writes the three vertex indices for the given triangle into the index buffer.
 
const ezVertexDeclarationInfoGetVertexDeclaration () const
 Allows to read the stream info of the descriptor, which is filled out by AddStream()
 
ezUInt32 GetVertexDataSize () const
 Returns the byte size of all the data for one vertex.
 
ezUInt32 GetVertexCount () const
 Return the number of vertices, with which AllocateStreams() was called.
 
ezUInt32 GetPrimitiveCount () const
 Returns the number of primitives that the array holds.
 
bool Uses32BitIndices () const
 Returns whether 16 or 32 Bit indices are to be used.
 
bool HasIndexBuffer () const
 Returns whether an index buffer is available.
 

Private Attributes

ezUInt32 m_uiVertexSize
 
ezUInt32 m_uiVertexCount
 
ezVertexDeclarationInfo m_VertexDeclaration
 
ezDynamicArray< ezUInt8 > m_VertexStreamData
 
ezDynamicArray< ezUInt8 > m_IndexBufferData
 

Member Function Documentation

template<typename TYPE >
void ezMeshBufferResourceDescriptor::SetVertexData ( ezUInt32  uiStream,
ezUInt32  uiVertexIndex,
const TYPE &  data 
)
inline

Slow, but convenient method to write one piece of vertex data at a time into the stream buffer.

uiStream is the index of the data stream to write to. uiVertexIndex is the index of the vertex for which to write the data. data is the piece of data to write to the stream.


The documentation for this struct was generated from the following files: