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 topic introduces the DrawPrimitiverendering methods and provides information about using them in your application.

Vertex Data Streams

The rendering interfaces for Microsoft® Direct3D® Mobile consist of methods that render primitives from vertex data stored in a data buffer. Vertex data consists of vertex elements combined to form vertex components. Vertex elements are the smallest unit of a vertex and represent entities such as position, normal, or color.

Rendering primitives consists of two steps. First, set up the vertex component streams; second, invoke a DrawPrimitivemethod to render from that stream.

The DrawPrimitivemethods specify an offset in the vertex data stream so that an arbitrary contiguous subset of the primitives within one set of vertex data can be rendered with each draw invocation. This enables you to change the device rendering state between groups of primitives that are rendered from the same vertex buffers.

Both indexed and nonindexed drawing methods are supported.

Setting the Stream Source

The IDirect3DMobileDevice::SetStreamSourcemethod binds a vertex buffer to a device data stream, creating an association between the vertex data and the data stream port that feeds the primitive processing functions. The actual references to the stream data do not occur until a drawing method, such as IDirect3DMobileDevice::DrawPrimitive, is called.

A stream is defined as a uniform array of component data, where each component consists of one or more elements representing a single entity such as position, normal, color, and so on. The Strideparameter specifies the size of the component, in bytes.

Rendering from Vertex and Index Buffers

Both indexed and nonindexed drawing methods are supported by Direct3D Mobile. The indexed methods use a single set of indices for all vertex components. Vertex data is presented to the Direct3D Mobile application programming interface (API) in vertex buffers, and index data for the indexed drawing methods is presented in index buffers. For more information, see the following reference topics:

These methods draw primitives from the current set of data input streams. For details on setting the current index array to an index buffer, see the IDirect3DMobileDevice::SetIndicesmethod.

See Also

Concepts

Rendering