Game Development Reference
In-Depth Information
Example :
Font->DrawText(20, 20, 0xff000000, “Hello, World”);
9.2.3 Cleanup
Before deleting a CD3DFont object, we must call some cleanup rou-
tines first, as the following code snippet illustrates:
Font->InvalidateDeviceObjects();
Font->DeleteDeviceObjects();
delete Font;
9.3 D3DXCreateText
This last function is used for creating 3D meshes of text. Figure 9.1
shows the 3D text mesh that the FontMesh3D sample of this chapter
renders.
Figure 9.1: 3D text
created with the
D3DXCreateText function
The function is prototyped as:
HRESULT D3DXCreateText(
LPDIRECT3DDEVICE9 pDevice,
HDC hDC,
LPCTSTR pText,
FLOAT Deviation,
FLOAT Extrusion,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency,
LPGLYPHMETRICSFLOAT pGlyphMetrics
);
This function returns D3D_OK on success.
pDevice —The device to be associated with the mesh
hDC —A handle to a device context that contains a description of
the font that we are going to use to generate the mesh
Search WWH ::




Custom Search