D3DXCreateText
Microsoft DirectX 9.0 SDK Update (October 2004)

D3DXCreateText Function


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

Syntax

HRESULT WINAPI D3DXCreateText(      

    LPDIRECT3DDEVICE9 pDevice,     HDC hDC,     LPCTSTR pText,     FLOAT Deviation,     FLOAT Extrusion,     LPD3DXMESH *ppMesh,     LPD3DXBUFFER *ppAdjacency,     LPGLYPHMETRICSFLOAT pGlyphMetrics );

Parameters

pDevice
[in] Pointer to the device that created the 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 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] Maximum chordal deviation from TrueType font outlines.
Extrusion
[in] Amount to extrude text in the negative z-direction.
ppMesh
[out] Pointer to the returned mesh.
ppAdjacency
[out] Pointer to a buffer containing adjacency information. May be NULL.
pGlyphMetrics
[out] Pointer to an array of GLYPHMETRICSFLOAT World Wide Web link 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

If the function succeeds, the return value is D3D_OK.

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

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
D3DXERR_INVALIDDATAThe data is invalid.
E_OUTOFMEMORYMicrosoft Direct3D could not allocate sufficient memory to complete the call.


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

Function Information

Headerd3dx9shape.h
Import libraryd3dx9.lib
Minimum operating systems Windows 98


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.