Microsoft DirectX 8.0 (C++) |
Binds a vertex buffer to a device data stream.
HRESULT SetStreamSource( UINT StreamNumber, IDirect3DVertexBuffer8* pStreamData, UINT Stride );
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value can be D3DERR_INVALIDCALL.
This method increments the reference count of the stream being assigned. When the texture is no longer needed, set the texture at the appropriate stage to NULL. If you fail to do this, the surface is not released, resulting in a memory leak.
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.
Header: Declared in D3d8.h.
Import Library: Use D3d8.lib.
IDirect3DDevice8::DrawIndexedPrimitive, IDirect3DDevice8::DrawIndexedPrimitiveUP, IDirect3DDevice8::DrawPrimitive, IDirect3DDevice8::DrawPrimitiveUP, IDirect3DDevice8::GetStreamSource