// d3dumddi.h
PFND3DDDI_COMPOSERECTS Pfnd3dddiComposerects;
HRESULT Pfnd3dddiComposerects(
HANDLE hDevice,
const D3DDDIARG_COMPOSERECTS *unnamedParam2
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The ComposeRects function composes two-dimensional areas from a source surface to a destination surface.
hDeviceA handle to the display device (graphics context).
unnamedParam2pData [in]
A pointer to a D3DDDIARG_COMPOSERECTS structure that specifies the parameters that are used to compose rectangular areas.
ComposeRects returns one of the following values:
| Return code | Description |
|---|---|
| S_OK | The rectangular areas were successfully composed. |
| E_OUTOFMEMORY | ComposeRects could not allocate the required memory for it to complete. |
The following constraints and validations apply to the ComposeRects function:
The following example code shows an operation that ComposeRects performs:
for (UINT i=0; i < COMPOSERECTS.NumDstRects; i++) {
if (i >= Size(VertexBuffer(hDstRectDescsVB)) / sizeof(D3DCOMPOSERECTDSTDESC))
Ignore the rectangle;
if (VertexBuffer(hDstRectDescsVB)[i].RectDescIndex >= Size(VertexBuffer(hSrcRectDescsVB)) / sizeof(D3DCOMPOSERECTSRCDESC))
Ignore the rectangle;
SourceRectangle = VertexBuffer(hSrcResource)[VertexBuffer(hDstRectDescsVB)[i].RectDescIndex];
DestinationRectangle.X = {VertexBuffer(hDstRectDescsVB)[i].X + COMPOSERECTS.Xoffset;
DestinationRectangle.Y = {VertexBuffer(hDstRectDescsVB)[i].Y + COMPOSERECTS.Yoffset;
DestinationRectangle.Width = SourceRectangle.Width;
DestinationRectangle.Height = SourceRectangle.Height;
Perform COMPOSERECTS.Operation for each pixel;
}