Click to Rate and Give Feedback
MSDN
MSDN Library
DirectX
SDK Documentation
DirectX Graphics
Direct3D 9
Reference
Direct3D Reference
Interfaces
IDirect3DDevice9
 IDirect3DDevice9::SetStreamSource

  Switch on low bandwidth view
IDirect3DDevice9::SetStreamSource
Bb174459.XDK_CHM_BANNER_left(en-us,VS.85).jpgBb174459.XDK_CHM_BANNER_right(en-us,VS.85).jpg

IDirect3DDevice9::SetStreamSource

Binds a vertex buffer to a device data stream. For more information, see Setting the Stream Source (Direct3D 9).

HRESULT SetStreamSource(
  UINT StreamNumber,
  IDirect3DVertexBuffer9 * pStreamData,
  UINT OffsetInBytes,
  UINT Stride
);

Parameters

StreamNumber
[in] Specifies the data stream, in the range from 0 to the maximum number of streams -1.
pStreamData
[in] Pointer to an IDirect3DVertexBuffer9 interface, representing the vertex buffer to bind to the specified data stream.
OffsetInBytes
[in] Offset from the beginning of the stream to the beginning of the vertex data, in bytes. To find out if the device supports stream offsets, see the D3DDEVCAPS2_STREAMOFFSET constant in D3DDEVCAPS2.
Stride
[in] Stride of the component, in bytes. See Remarks.

Return Values

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.

Remarks

When a FVF vertex shader is used, the stride of the vertex stream must match the vertex size, computed from the FVF. When a declaration is used, the stride should be greater than or equal to the stream size computed from the declaration.

When calling SetStreamSource, the stride is normally required to be equal to the vertex size. However, there are times when you may want to draw multiple instances of the same or similar geometry (such as when using instancing to draw). For this case, use a zero stride to tell the runtime not to increment the vertex buffer offset (ie: use the same vertex data for all instances). For more information about instancing, see Efficiently Drawing Multiple Instances of Geometry (Direct3D 9).

Requirements

Header: Declared in D3D9.h.

Library: Use D3D9.lib.

See Also

IDirect3DDevice9::GetStreamSource, IDirect3DDevice9::DrawIndexedPrimitive, IDirect3DDevice9::DrawIndexedPrimitiveUP, IDirect3DDevice9::DrawPrimitive, IDirect3DDevice9::DrawPrimitiveUP, Vertex Buffers (Direct3D 9)

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker