Microsoft DirectX 8.1 (Visual Basic)

D3DRECTPATCH_INFO

Describes a rectangular high-order patch.

Type D3DRECTPATCH_INFO
    Basis As CONST_D3DBASISTYPE
    Height As Long
    Order As CONST_D3DORDERTYPE
    StartVertexOffsetHeight As Long
    StartVertexOffsetWidth As Long
    StrideBytes As Long
    Width As Long
End Type

Members

Basis
Member of the CONST_D3DBASISTYPE type, defining the basis type for the rectangular high-order patch.
Value Order Supported Width and Height
D3DBASIS_BEZIER Linear, Cubic and Quintic Width = Height = (DWORD)order + 1
D3DBASIS_BSPLINE Linear, Cubic and Quintic Width = Height > (DWORD)order
D3DBASIS_INTERPOLATE Cubic Width = Height > (DWORD)order
Height
Height of each patch, in number of vertices.
Order
Member of the CONST_D3DORDERTYPE type, defining the order type for the rectangular high-order patch.
StartVertexOffsetHeight
Starting vertex offset height, in number of vertices.
StartVertexOffsetWidth
Starting vertex offset width, in number of vertices.
StrideBytes
The stride is a width of the imaginary 2-dimensional vertex array, which occupies the same space as the vertex buffer. See the diagram below for an example.
Width
Width of each patch, in number of vertices.

Remarks

To render a stream of individual rectangular patches (nonmosaic), you should interpret your geometry as a long narrow (1 × N) rectangular patch. The D3DRECTPATCH_INFO structure for such a strip (cubic Bézier) would be set up in the following manner.

Dim i As Integer
Dim RectInfo As D3DRECTPATCH_INFO

With D3DRECTPATCH_INFO
    .Width = 4
    .Height = 4
    .Stride = 4
    .Basis = D3DBASIS_BEZIER
    .Order = D3DORDER_CUBIC
    .StartVertexOffsetWidth = 0
    .StartVertexOffsetHeight = 4 * i  ' The variable i is the index of the patch you want to render.
End With

The following diagram identifies the parameters that specify a rectangle patch.

Parameters that specify a rectangle patch.

Each of the vertices in the vertex buffer is shown as a black dot. In this case, the vertex buffer has 20 vertices in it, 16 of which are in the rectangle patch. The stride is the number of vertices in the width of the vertex buffer, in this case 5. The "x" offset to the first vertex is called the StartIndexVertexWidth and is 1 in this case. The "y" offset to the first patch vertex is called the StartIndexVertexHeight and is 0 in this case.

See Also

Direct3DDevice8.DrawRectPatch