Copy a text string to one surface using an alphabet of glyphs on another surface. Composition is done by the GPU using bitwise operations.
HRESULT ComposeRects( [in] IDirect3DSurface9 *pSource, [in] IDirect3DSurface9 *pDestination, [in] IDirect3DVertexBuffer9 *pSrcRectDescriptors, [in] UINT NumRects, [in] IDirect3DVertexBuffer9 *pDstRectDescriptors, [in] D3DCOMPOSERECTSOP Operation, [in] INT XOffset, [in] INT YOffset );
- pSource [in]
- pDestination [in]
A pointer to the destination surface (prepared by IDirect3DSurface9) that receives the glyph data. The surface must be part of a texture.
- pSrcRectDescriptors [in]
- NumRects [in]
The number of rectangles or glyphs that are used in the operation. The number applies to both the source and destination surfaces. The range is 0 to D3DCOMPOSERECTS_MAXNUMRECTS.
- pDstRectDescriptors [in]
A pointer to a vertex buffer (see IDirect3DVertexBuffer9) containing rectangles (see D3DCOMPOSERECTDESTINATION) that describe the destination to which the indicated glyph from the source surface will be copied.
- Operation [in]
Specifies how to combine the source and destination surfaces. See D3DCOMPOSERECTSOP.
- XOffset [in]
A value added to the x coordinates of all destination rectangles. This value can be negative, which may cause the glyph to be rejected or clipped if the result is beyond the bounds of the surface.
- YOffset [in]
A value added to the y coordinates of all destination rectangles. This value can be negative, which may cause the glyph to be rejected or clipped if the result is beyond the bounds of the surface.
If the method succeeds, the return value is D3D_OK.
Glyphs from a one-bit source surface are put together into another one-bit texture surface with this method. The destination surface can then be used as the source for a normal texturing operation that will filter and scale the strings of text onto some other non-monochrome surface.
This method has several constraints (which are similar to StretchRect):
- Surfaces cannot be locked.
- The source and destination surfaces cannot be the same surface.
- The source and destination surfaces must be created with the D3DFMT_A1 format.
- The source surface and both vertex buffers must be created with the D3DPOOL_DEFAULT flag.
- The destination surface must be created with either the D3DPOOL_DEFAULT or D3DPOOL_SYSTEMMEM flags.
- The source rectangles must be within the source surface.
The method is not recorded in state blocks.