Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.SetStreamSource

Binds a vertex buffer to a device data stream.

object.SetStreamSource( _ 
    StreamNumber As Long, _ 
    StreamData As Direct3DVertexBuffer8, _ 
    Stride As Long)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
StreamNumber
Specifies the data stream, in the range from 0 to the maximum number of streams - 1.
StreamData
A Direct3DVertexBuffer8 object, representing the vertex buffer to bind to the specified data stream.
Stride
Stride of the component, in bytes. See Remarks.

Error Codes

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.

Remarks

When a flexible vertex format (FVF) vertex shader is used, the stream vertex stride in SetStreamSource must match the vertex size, computed from the FVF. When a declaration is used, the stream vertex stride in SetStreamSource should be greater than or equal to the stream size, computed from the declaration.

The SetStreamSource method binds a vertex buffer to a device data stream. For details, see Setting the Stream Source.

See Also

Direct3DDevice8.DrawIndexedPrimitive, Direct3DDevice8.DrawIndexedPrimitiveUP, Direct3DDevice8.DrawPrimitive, Direct3DDevice8.DrawPrimitiveUP, Direct3DDevice8.GetStreamSource