Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/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 IDirect3DMobileVertexBufferinterface 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::SetStreamSourcemust match the vertex size, computed from the FVF. When a declaration is used, the stream vertex stride in IDirect3DMobileDevice::SetStreamSourceshould be greater than or equal to the stream size computed from the declaration.

The IDirect3DMobileDevice::SetStreamSourcemethod 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
Windows Mobile Windows Mobile Version 5.0 and later

See Also