Share via


IDirect3DMobileDevice::SetStreamSource (Windows Embedded CE 6.0)

1/6/2010

This method binds a vertex buffer to a device data stream.

Syntax

HRESULT SetStreamSource(
  UINT StreamNumber,
  IDirect3DMobileVertexBuffer* pStreamData,
  UINT Stride
);

Parameters

  • StreamNumber
    [in] A UINT value identifying the data stream. This parameter is not used. The Direct3D Mobile middleware is hard-coded to use zero for this value.
  • pStreamData
    [in] Pointer to an IDirect3DMobileVertexBuffer interface that represents the vertex buffer to bind to the specified data stream.
  • Stride
    [in] A UINT value that indicates the stride of the vertex buffer. You can only set this value to zero, or the vertex size implied by the vertex buffer's flexible vertex format (FVF).

Return Value

If the method succeeds, the return value is D3DM_OK (see D3DM Values).

If the method fails, the return value can be D3DMERR_INVALIDCALL (see D3DMERR Values).

Remarks

Unlike the Direct3D implementations found on Windows-based desktop where vertex buffers can be bound to specific device data streams, Direct3D Mobile only supports vertex buffers bound to stream zero.

This method increments the reference count of the stream being assigned. When the stream is no longer needed, set it to NULL. If you fail to do this, the surface is not released, which results in a memory leak.

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

The IDirect3DMobileDevice::SetStreamSource method binds a vertex buffer to a device data stream.

Requirements

Header d3dm.h
Library D3dm.lib, D3dmguid.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

IDirect3DMobileDevice
IDirect3DMobileVertexBuffer