Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.DrawRectPatch

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

object.DrawRectPatch( _ 
    Handle As Long, _ 
    NumSegments As Single, _ 
    Surface As Any)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Handle
Handle to the rectangular high-order patch to draw.
NumSegments
Number of segments that each edge of the higher-order primitive should be divided into when tessellated.
Surface
D3DRECTPATCH_INFO type, describing the rectangular high-order patch to draw.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

For static patches, set the vertex shader and appropriate streams, supply patch information in the Surface parameter, and specify a handle so that Microsoft® Direct3D® can capture and cache information. Call DrawRectPatch subsequently with Surface set to NULL to efficiently draw the patch. When drawing a cached patch, the currently set streams are ignored. Override the cached NumSegments by specifying a new value for NumSegments. 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 NumSegments values, and does not cache any information. It is not valid to simultaneously set Handle to 0 and Surface to NULL.

See Also

Direct3DDevice8.DeletePatch, Drawing Patches

Using Higher-Order Primitives