DirectX SDK |
The Direct3DDevice7.DrawIndexedPrimitive method renders the specified geometric primitive based on indexing into an array of vertices.
object.DrawIndexedPrimitive( _ d3Dpt As CONST_D3DPRIMITIVETYPE, _ d3dfvf As CONST_D3DFVFFLAGS, _ vertices As Any, _ vertexCount As Long, _ indices() As Integer, _ IndicesCount As Long, _ flags As CONST_D3DDPFLAGS)
Note that the D3DPT_POINTLIST member of CONST_D3DPRIMITIVETYPE is not indexed.
Notice that this parameter is used differently from the vertexCount parameter in the Direct3DDevice7.DrawPrimitive method. In that method, the vertexCount parameter gives the number of vertices to draw, but here it gives the total number of vertices in the array pointed to by the vertices parameter. When you call Direct3DDevice7.DrawIndexedPrimitive, you specify the number of vertices to draw in the IndicesCount parameter.
If the method fails, an error is raised and Err.Number may be set to one of the following values:
D3DERR_INVALIDRAMPTEXTURE |
D3DERR_INVALIDPRIMITIVETYPE |
D3DERR_INVALIDVERTEXTYPE |
DDERR_WASSTILLDRAWING |
DDERR_INVALIDPARAMS |
For information on trapping errors, see the Visual Basic Error Trapping topic.
Make sure that the vertices being rendered match the vertex format you specify. For performance reasons, Direct3D does not attempt to verify that vertex size and stride match the provided flexible vertex format. If a mismatch occurs, a memory fault is likely to result.
In current versions of DirectX, Direct3DDevice7.DrawIndexedPrimitive can sometimes generate an update rectangle that is larger than it strictly needs to be. If a large number of vertices need to be processed, this can have a negative impact on the performance of your application. If you are using D3DTLVERTEX vertices and the system is processing more vertices than you need, you should use the D3DDP_DONOTCLIP and D3DDP_DONOTUPDATEEXTENTS flags to solve the problem.
Direct3DDevice7.DrawPrimitive, Direct3DDevice7.DrawPrimitiveVB, Direct3DDevice7.DrawIndexedPrimitiveVB