IDirect3DMobileDevice::ProcessVertices (Windows Embedded CE 6.0)
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.
HRESULT ProcessVertices( UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DMobileVertexBuffer* pDestBuffer, DWORD Flags );
[in] Index of first vertex to be loaded.
[in] Index of first vertex in the destination vertex buffer into which the results are placed.
[in] Number of vertices to process.
[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.
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.
[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.
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.