struct
MeshA structure that represents a basic mesh, made up of vertices and triangles.
By default it only has one vertex buffer, you can have more by using Mesh_
Derived classes
Public static variables
Constructors, destructors, conversion operators
- Mesh()
Public functions
-
auto CalculateTriangleCount(D3DPRIMITIVETYPE primitiveType) -> size_
t - Returns the number of triangles this mesh would use if the primitive type was the one specified.
- auto SetIndexBuffer(IndexBuffer* pBuffer) -> void
- Sets the IndexBuffer used by this mesh.
-
auto SetIndicesCount(size_
t nIndicesCount) -> void - Sets the number of indicies used in this mesh.
-
auto SetVertexBuffer(size_
t nIndex, VertexBuffer* pVertexBuffer) -> void - Sets the VertexBuffer used by this mesh at the given index.
- auto Render() -> void
- Renders this mesh.
Public variables
Function documentation
size_ t RenderWare:: Mesh:: CalculateTriangleCount(D3DPRIMITIVETYPE primitiveType)
Returns the number of triangles this mesh would use if the primitive type was the one specified.
Parameters | |
---|---|
primitiveType | The type of primitive, in the D3DPRIMITIVETYPE enum. |
void RenderWare:: Mesh:: SetIndexBuffer(IndexBuffer* pBuffer)
Sets the IndexBuffer used by this mesh.
Parameters | |
---|---|
pBuffer | The new IndexBuffer. |
The primitive type will be set to use the one the buffer uses. CalculateTriangleCount(D3DPRIMITIVETYPE) will be called to update the triangle count.
void RenderWare:: Mesh:: SetIndicesCount(size_ t nIndicesCount)
Sets the number of indicies used in this mesh.
Parameters | |
---|---|
nIndicesCount | The new number of indices. |
The primitive type will be set to use the one the index buffer uses. CalculateTriangleCount(D3DPRIMITIVETYPE) will be called to update the triangle count.
void RenderWare:: Mesh:: SetVertexBuffer(size_ t nIndex,
VertexBuffer* pVertexBuffer)
Sets the VertexBuffer used by this mesh at the given index.
Parameters | |
---|---|
nIndex | The index of the VertexBuffer, usually 0. |
pVertexBuffer | The VertexBuffer to use. |
Meshes can use multiple vertex buffers, although usually only one is used. The index is expected to be lower than the amount of buffers specified using the templated parameter. The primitive type will be set to use the one the index buffer uses. CalculateTriangleCount(D3DPRIMITIVETYPE) will be called to update the triangle count.