DirectX SDK

IDirect3DVertexBuffer7::ProcessVertices

The IDirect3DVertexBuffer::ProcessVertices method processes untransformed vertices into a transformed or optimized vertex buffer.

HRESULT ProcessVertices( 
  DWORD dwVertexOp, 
  DWORD dwDestIndex, 
  DWORD dwCount, 
  LPDIRECT3DVERTEXBUFFER7 lpSrcBuffer, 
  DWORD dwSrcIndex, 
  LPDIRECT3DDEVICE7       lpD3DDevice, 
  DWORD dwFlags
);

Parameters

dwVertexOp
Flags defining how the method processes the vertices as they are transferred from the source buffer. You can specify any combination of the following flags:
D3DVOP_CLIP
Transform the vertices, and clip any vertices that exist outside the viewing frustum. This flag cannot be used with vertex buffers that do not contain clipping information (for example, those created with the D3DVBCAPS_DONOTCLIP flag).
D3DVOP_EXTENTS
Transform the vertices, then update the extents of the screen rectangle when the vertices are rendered. Using this flag can potentially help performance, but the extents returned by IDirect3DDevice7::GetClipStatus are not updated to account for the vertices when they are rendered.
D3DVOP_LIGHT
Light the vertices.
D3DVOP_TRANSFORM
Transform the vertices, using the world, view, and projection matrices. This flag must always be set.
dwDestIndex
Index into the destination vertex buffer (this buffer) where the vertices are placed after processing.
dwCount
Number of vertices in the source buffer to process.
lpSrcBuffer
Address of the IDirect3DVertexBuffer7 interface for the source vertex buffer.
dwSrcIndex
Index of the first vertex in the source buffer to be processed.
lpD3DDevice
Address of the IDirect3DDevice7 interface for the device to be used to transform the vertices.
dwFlags
Processing options. Set this parameter to 0 for default processing. Set to D3DPV_DONOTCOPYDATA to prevent the system from copying vertex data not affected by the current vertex operation into the destination buffer. For more information, see Processing Vertices.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values:

D3DERR_INVALIDVERTEXFORMAT
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_OUTOFMEMORY
DDERR_SURFACEBUSY
DDERR_SURFACELOST

Remarks

Always include the D3DVOP_TRANSFORMED flag in the dwVertexOp parameter. If you do not, the method fails, returning DDERR_INVALIDPARAMS.

In the legacy IDirect3DVertexBuffer interface, this method accepted pointers to the IDirect3DDevice3 and IDirect3DVertexBuffer interfaces.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3d.h.

See Also

Processing Vertices, Vertex Buffers