Device.DrawRectanglePatch Method

Language:

Draws a rectangular patch using the currently set streams.

Definition

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

Parameters

handle System.Int32
Handle to the rectangular patch to draw.
numSegs System.Single[]
Array of four floating-point values that identify the number of segments into which each edge of the rectangle patch should be divided when tessellated. For more information, see RectanglePatchInformation.
rectPatchInformation Microsoft.DirectX.Direct3D.RectanglePatchInformation

Remarks

For static patches, set the vertex shader and the appropriate streams, supply patch information in the param_RectanglePatchInformationR_rectPatchInformation parameter, and specify a handle so that Microsoft Direct3D can capture and cache information. To efficiently draw the patch, call Device.DrawRectanglePatch subsequently without the param_RectanglePatchInformationR_rectPatchInformation parameter. When drawing a cached patch, the currently set streams are ignored. Override the cached param_SingleA_numSegs by specifying 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.DrawRectanglePatch with a handle invalidates the same handle cached by a previous Device.DrawTrianglePatch 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 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_RectanglePatchInformationR_rectPatchInformation to null.

Exceptions
ArgumentException Leave Site The 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.

See Also


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.