Microsoft DirectX 8.1 (C++)

IDirect3DDevice8::DrawTriPatch

Draws a triangular high-order patch using the currently set streams.

HRESULT DrawTriPatch(
  UINT Handle,
  CONST float* pNumSegs,
  CONST D3DTRIPATCH_INFO* pTriPatchInfo
);

Parameters

Handle
[in] Handle to the triangular high-order patch to draw.
pNumSegs
[in, out] Pointer to an array of three floating-point values identifying the number of segments that each edge of the higher-order primitive should be divided into when tessellated.
pTriPatchInfo
[in, out] Pointer to a D3DTRIPATCH_INFO structure, describing the triangular high-order patch to draw.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be D3DERR_INVALIDCALL.

Remarks

For static patches, set the vertex shader and appropriate streams, supply patch information in the pRectPatchInfo parameter, and specify a handle so that Microsoft® Direct3D® can capture and cache information. Call DrawRectPatch subsequently with pRectPatchInfo set to NULL to efficiently draw the patch. When drawing a cached patch, the currently set streams are ignored. Override the cached pNumSegs by specifying a new value for pNumSegs. When rendering a cached patch, you must set the same vertex shader that was set when it was captured.

For dynamic patches, the patch data changes for every rendering of the patch, so it is not efficient to cache information. The application can convey this to Direct3D by setting Handle to 0. In this case, Direct3D draws the patch using the currently set streams and the pNumSegs values, and does not cache any information. It is not valid to simultaneously set Handle to 0 and pPatch to NULL.

Requirements

  Header: Declared in D3d8.h.
  Import Library: Use D3d8.lib.

See Also

Using Higher-Order Primitives