D3DXCreateText function

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

Syntax

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

Parameters

pDevice [in]

Type: LPDIRECT3DDEVICE9

Pointer to the device that created the mesh.

hDC [in]

Type: HDC

Device context, containing the font for output. The font selected by the device context must be a TrueType font.

pText [in]

Type: LPCTSTR

Pointer to a string that specifies the text to generate. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Deviation [in]

Type: FLOAT

Maximum chordal deviation from TrueType font outlines.

Extrusion [in]

Type: FLOAT

Amount to extrude text in the negative z-direction.

ppMesh [out]

Type: LPD3DXMESH*

Pointer to the returned mesh.

ppAdjacency [out]

Type: LPD3DXBUFFER*

Pointer to a buffer containing adjacency information. May be NULL.

pGlyphMetrics [out]

Type: LPGLYPHMETRICSFLOAT

Pointer to an array of GLYPHMETRICSFLOAT structures that contain the glyph metric data. Each element contains information about the position 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, set this parameter to NULL.

Return value

Type: HRESULT

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

Remarks

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXCreateTextW. Otherwise, the function call resolves to D3DXCreateTextA because ANSI strings are being used.

This function creates a mesh with the D3DXMESH_MANAGED creation option and D3DFVF_XYZ | D3DFVF_NORMAL flexible vertex format (FVF).

Requirements

Requirement Value
Header
D3dx9shape.h
Library
D3dx9.lib

See also

Shape Drawing Functions