DirectX SDK |
The Direct3DDevice7.DrawPrimitiveVB method renders an array of vertices in a vertex buffer as a sequence of geometric primitives.
object.DrawPrimitiveVB( _ d3dpt As CONST_D3DPRIMITIVETYPE, _ vertexBuffer As Direct3DVertexBuffer7, _ startVertex As Long, _ numVertices As Long, _ flags As CONST_D3DDPFLAGS)
Note that the D3DPT_POINTLIST member of CONST_D3DPRIMITIVETYPE is not indexed.
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 |
D3DERR_VERTEXBUFFERLOCKED |
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.
With the exception of the reference rasterizer, software devices cannot render from a video memory (local or non-local) vertex buffer. To render a vertex buffer using a software device, the vertex buffer must exist in system memory. Hardware devices can render from system memory or video memory vertex buffers.
You cannot render from a locked vertex buffer; calls to the Direct3DDevice7.DrawIndexedPrimitiveVB or Direct3DDevice7.DrawPrimitiveVB method using a locked buffer will fail, returning D3DERR_VERTEXBUFFERLOCKED.
Direct3DDevice7.DrawPrimitive, Direct3DDevice7.DrawIndexedPrimitive, Direct3DDevice7.DrawIndexedPrimitiveVB