D3DRECTPATCH_INFO

Describes a rectangular high-order patch.

typedef struct D3DRECTPATCH_INFO {
    UINT StartVertexOffsetWidth;
    UINT StartVertexOffsetHeight;
    UINT Width;
    UINT Height;
    UINT Stride;
    D3DBASISTYPE Basis;
    D3DDEGREETYPE Degree;
} D3DRECTPATCH_INFO, *LPD3DRECTPATCH_INFO;

Members

StartVertexOffsetWidth
Starting vertex offset width, in number of vertices.
StartVertexOffsetHeight
Starting vertex offset height, in number of vertices.
Width
Width of each vertex, in number of vertices.
Height
Height of each vertex, in number of vertices.
Stride
Width of the imaginary two-dimensional vertex array, which occupies the same space as the vertex buffer. For an example, see the diagram below.
Basis
Member of the D3DBASISTYPE enumerated 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
Degree
Member of the D3DDEGREETYPE enumerated type, defining the degree for the rectangular patch.

Remarks

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

Rectangular high-order patch with parameters that specify it

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 five. The x offset to the first vertex is called the StartIndexVertexWidth and is in this case 1. The y offset to the first patch vertex is called the StartIndexVertexHeight and is in this case 0.

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

    
D3DRECTPATCH_INFO RectInfo;

RectInfo.Width = 4;
RectInfo.Height = 4;
RectInfo.Stride = 4;
RectInfo.Basis = D3DBASIS_BEZIER;
RectInfo.Order = D3DORDER_CUBIC;
RectInfo.StartVertexOffsetWidth = 0;
RectInfo.StartVertexOffsetHeight = 4*i;  // The variable i is the index of the 
//   patch you want to render.

See Also

IDirect3DDevice9::DrawRectPatch, D3DXTessellateRectPatch