Device.DrawTrianglePatch(Int32,Single[],TrianglePatchInformation) Method (Microsoft.DirectX.Direct3D)

Draws a triangular patch using the currently set streams.

Definition

Visual Basic Public Sub DrawTrianglePatch( _
    ByVal handle As Integer, _
    ByVal numSegs() As Single, _
    ByVal triPatchInformation As TrianglePatchInformation _
)
C# public void DrawTrianglePatch(
    int handle,
    float[] numSegs,
    TrianglePatchInformation triPatchInformation
);
C++ public:
void DrawTrianglePatch(
    int handle,
    array<float>^ numSegs,
    TrianglePatchInformation triPatchInformation
);
JScript public function DrawTrianglePatch(
    handle : int,
    numSegs : float[],
    triPatchInformation : TrianglePatchInformation
);

Parameters

handle System.Int32
Handle to the triangular patch to draw.
numSegs System.Single[]
Pointer to an array of three floating-point values that identify the number of segments each edge of the triangle patch should be divided into when tessellated. For more information, see TrianglePatchInformation.
triPatchInformation Microsoft.DirectX.Direct3D.TrianglePatchInformation
A TrianglePatchInformation structure that describes the triangular high-order patch to draw.

Remarks

For static patches, set the vertex shader and the appropriate streams, supply patch information in the param_TrianglePatchInformationR_triPatchInformation parameter, and specify a handle so that Microsoft Direct3D can capture and cache information. To efficiently draw the patch, call Device.DrawTrianglePatch with param_TrianglePatchInformationR_triPatchInformation set to null. When drawing a cached patch, the currently set streams are ignored. To override the cached param_SingleA_numSegs, specify a new value for param_SingleA_numSegs. When rendering a cached patch, set the same vertex shader that was set when it was captured.

Calling Device.DrawTrianglePatch with a handle invalidates the same handle cached by a previous Device.DrawRectanglePatch call.

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 param_Int32_handle to 0. In this case, Direct3D draws the patch using the currently set streams and the param_SingleA_numSegs values, and does not cache any information. It is not valid to simultaneously set param_Int32_handle to 0 and param_TrianglePatchInformationR_triPatchInformation to null.

Exceptions

ArgumentExceptionLeave Site

The param_SingleA_numSegs parameter must be an array of four segments.

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.