IDirect3DDevice9Ex::ComposeRects method

Copy a text string to one surface using an alphabet of glyphs on another surface. Composition is done by the GPU using bitwise operations.

Syntax


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
);

Parameters

pSource [in]

Type: IDirect3DSurface9*

A pointer to a source surface (prepared by IDirect3DSurface9) that supplies the alphabet glyphs. This surface must be created with the D3DUSAGE_TEXTAPI flag.

pDestination [in]

Type: IDirect3DSurface9*

A pointer to the destination surface (prepared by IDirect3DSurface9) that receives the glyph data. The surface must be part of a texture.

pSrcRectDescriptors [in]

Type: IDirect3DVertexBuffer9*

A pointer to a vertex buffer (see IDirect3DVertexBuffer9) containing rectangles (see D3DCOMPOSERECTDESC) that enclose the desired glyphs in the source surface.

NumRects [in]

Type: UINT

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]

Type: IDirect3DVertexBuffer9*

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]

Type: D3DCOMPOSERECTSOP

Specifies how to combine the source and destination surfaces. See D3DCOMPOSERECTSOP.

XOffset [in]

Type: INT

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]

Type: INT

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.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK.

Remarks

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.

Requirements

Header

D3d9.h

Library

D3D9.lib

See also

IDirect3DDevice9Ex

 

 

Community Additions

ADD
Show:
© 2014 Microsoft