Compartilhar via


IDirect3DMobileDevice::ProcessVertices

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method provides the ability to transform and light vertices from a particular source buffer and output the resulting vertices to a destination vertex buffer. For more information, see Processing Vertex Transformations. It allows an application to transform, and optionally light, the vertices once and use the resulting vertex buffer one or more times as a source in multi-pass rendering operations.

Syntax

HRESULT ProcessVertices(
  UINT SrcStartIndex,
  UINT DestIndex,
  UINT VertexCount,
  IDirect3DMobileVertexBuffer* pDestBuffer,
  DWORD Flags
);

Parameters

  • SrcStartIndex
    [in] Index of first vertex to be loaded.
  • DestIndex
    [in] Index of first vertex in the destination vertex buffer into which the results are placed.
  • VertexCount
    [in] Number of vertices to process.
  • pDestBuffer
    [out] A pointer to an IDirect3DMobileVertexBuffer interface that will receive the results of the vertex transformation. Regardless of the data type used, the destination vertex buffer's flexible vertex format (FVF) type must consist of RHW post-transformed vertices. In Direct3D Mobile, the possible options for the destination vertex buffer are D3DMFVF_XYZRHW_FLOAT and D3DMFVF_XYZRHW_FIXED. As a result, certain FVF flags ma nor be used in a destination vertex buffer.

    The following list shows the FVF flags that may not be used in a destination vertex buffer as a result of these requirements.

    • D3DMFVF_XYZ_FLOAT
    • D3DMFVF_XYZ_FIXED
    • D3DMFVF_NORMAL_FLOAT
    • D3DMFVF_NORMAL_FIXED

    If you use any of these FVF flags in the destination vertex buffer the method will return E_INVALIDARG in the debug runtime.

    Passing a NULL pointer in this parameter will generate an exception.

  • Flags
    [in] Processing options. Set this parameter to 0 for default processing. Set to D3DPV_DONOTCOPYDATA (see D3DMPV Values) to prevent the system from copying vertex data not affected by the vertex operation into the destination buffer.

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

Although the IDirect3DMobileDevice::ProcessVertices method is more commonly associated with transformation and lighting operations, there are other applications for the method as well, including:

  • Transforming a polygonal model's bounding box.
  • Reading the results of a clipping test to determine if a mesh would be inside or outside the viewing frustum.
  • A front end to a sort-by-Z test for drawing alpha blending polygons in a back-to-front order.

The destination vertex buffer, pDestBuffer, must be created with a nonzero FVF parameter. The FVF code specified during the call to the IDirect3DMobileDevice::CreateVertexBuffer method specifies the vertex elements present in the destination vertex buffer.

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

Reference

IDirect3DMobileDevice
IDirect3DMobileVertexBuffer
D3DMPV Values
IDirect3DMobileDevice::CreateVertexBuffer

Concepts

Lighting
Processing Vertex Transformations