Microsoft DirectX 8.1 (C++)

D3DXCreateText

Creates a mesh containing the specified text, using the font associated with the device context.

HRESULT D3DXCreateText(
  LPDIRECT3DDEVICE8   pDevice,
  HDC                 hDC,
  LPCTSTR             pText,
  FLOAT               Deviation,
  FLOAT               Extrusion,
  LPD3DXMESH*         ppMesh,
  LPD3DXBUFFER*       ppAdjacency,  
  LPGLYPHMETRICSFLOAT pGlyphMetrics
);

Parameters

pDevice
[in] Pointer to an IDirect3DDevice8 interface, representing the device associated with the created text mesh.
hDC
[in] Device context, containing the font for output. The font selected by the device context must be a TrueType font.
pText
[in] Pointer to a string, specifying the text to generate.
Deviation
[in] Maximum chordal deviation from true font outlines.
Extrusion
[in] Amount to extrude text in the negative Z direction.
ppMesh
[out] Address of a pointer to the output shape, an ID3DXMesh interface.
ppAdjacency
[out] Pointer to an array of three DWORDs per face containing the adjacency information for the output mesh.
pGlyphMetrics
[out] Pointer to an array of GLYPHMETRICSFLOAT structures to receive the glyph metric data. Each GLYPHMETRICSFLOAT structure in the array contains information about the placement and orientation of the corresponding glyph in the string. The number of elements in the array should be equal to the number of characters in the string. Note that the origin in each structure is not relative to the entire string, but rather is relative to that character cell. To compute the entire bounding box, add the increment for each glyph while traversing the string.

If you are not concerned with the glyph sizes, you can pass NULL to pGlyphMetrics.

Return Values

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be one of the following values.

D3DERR_INVALIDCALL
D3DXERR_INVALIDDATA
E_OUTOFMEMORY

Remarks

This function supports both Unicode and ANSI strings.

For more information on the GLYPHMETRICSFLOAT structure, see the Microsoft® Platform Software Development Kit (SDK).

Requirements

  Header: Declared in D3dx8shape.h.
  Import Library: Use D3dx8.lib.