Microsoft DirectX 8.1 (Visual Basic) |
Renders data specified by a user memory pointer as a sequence of geometric primitives of the specified type.
object.DrawPrimitiveUP( _ PrimitiveType As CONST_D3DPRIMITIVETYPE, _ PrimitiveCount As Long, _ VertexStreamZeroDataArray As Any, _ VertexStreamZeroStride As Long)
If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
This method is intended for use in applications that are unable to store their vertex data in vertex buffers. This method supports only a single vertex stream. The effect of this call is to use the provided vertex data pointer and stride for vertex stream zero. It is invalid to have the declaration of the current vertex shader refer to vertex streams other than stream zero.
The following code fragment shows how to determine VertexStreamZeroStride, using the Visual Basic Len function.
Dim device As Direct3DDevice8 Dim verts(3) As D3DVERTEX device.DrawPrimitiveUP D3DPT_TRIANGLELIST, 1, verts(0), Len(vert(0))
Note that you pass in only the first element of the array containing the vertex data.
Following any DrawPrimitiveUP call, the stream zero settings, referenced by Direct3DDevice8.GetStreamSource, are set to ByVal 0.
Direct3DDevice8.DrawIndexedPrimitiveUP, Direct3DDevice8.SetStreamSource, Rendering Primitives