// d3dumddi.h
PFND3DDDI_DRAWTRIPATCH Pfnd3dddiDrawtripatch;
HRESULT Pfnd3dddiDrawtripatch(
[in] HANDLE hDevice,
const D3DDDIARG_DRAWTRIPATCH *unnamedParam2,
const D3DDDITRIPATCH_INFO *unnamedParam3,
const FLOAT *unnamedParam4
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The DrawTriPatch function draws a new or cached triangular patch or updates the specification of a previously defined patch.
hDevice [in]A handle to the display device (graphics context).
unnamedParam2pData [in]
A pointer to a D3DDDIARG_DRAWTRIPATCH structure that describes the triangular patch to draw.
unnamedParam3pInfo [in]
Optional. A pointer to a D3DDDITRIPATCH_INFO structure that describes information about the triangular patch.
unnamedParam4pPatch [in]
Optional. A pointer to a buffer that contains three floating-point values (D3DFLOAT[3]) that provide the segment counts for each of the three edges of the triangular patch.
DrawTriPatch returns S_OK or an appropriate error result if the triangular patch is not successfully drawn.
When the Microsoft Direct3D runtime calls the user-mode display driver's DrawTriPatch function, it can optionally supply information in the pInfo and pPatch parameters. The runtime sets flags in the Flags member of the D3DDDIARG_DRAWTRIPATCH structure that is specified by pData to indicate if it supplies this optional information.
The runtime supplies a UINT value in the Handle member of D3DDDIARG_DRAWTRIPATCH to refer to the patch surface. Whenever the runtime redraws the patch surface, it passes the patch handle value and is not required to re-specify the D3DDDITRIPATCH_INFO data structure for the patch surface. The user-mode display driver can precompute and cache forward-difference coefficients and any other information. Therefore, subsequent calls to the driver's DrawTriPatch function that use the same patch handle value run more efficiently.
The actual value in Handle is determined by the application and is not under runtime control. Therefore, the driver must handle any value that can be specified by a UINT.
The special Handle value of zero indicates that the patch is dynamic; therefore, the driver cannot precompute or cache information for the patch. A nonzero value for Handle indicates that the patch is static (or updated with low frequency); therefore, the driver can precompute and cache information for the patch.
The driver must handle the following scenarios in its DrawTriPatch function:
The driver receives notification to release cached patch information through the D3DRS_DELETERTPATCH render state. The value of this render state is the patch to delete.