C3DMesh::ReallocateMesh

Top  Previous  Next

Syntax:

 

ReallocateMesh(int  numVertices, int  numIndices, uint  fvf)

 

Purpose:

Resizes a mesh previously created with the CreateMesh method.

 

Parameters:

numVertices - Number of vertices to allocate for the vertex buffer.

numIndices - Number of indices to allocate for the index buffer.

fvf - The flexible vertex format of the mesh.

 

Returned value(s):

None.

 

Application:

'create the mesh with a vertex format that allows position, a diffuse color and a normal vector.
'if the mesh already exists then just reallocate the buffers
if(rest = NULL)
       mesh.CreateMesh(pScreen,numVertices,numIndices,D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE )
else
       mesh.ReallocateMesh(numVertices,numIndices,D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE)
endif

 

Class Hierarchy

C3DObject

-------C3DMesh

 

Additional Info:

This method should only be used with meshes created with the CreateMesh method.  All data in the vertex and index buffers is destroyed before the buffers are reallocated.