
2358.5. TextDX Class Details
return dxFont->DrawTextA(graphics->getSprite(), str.c_str(), -1, &rect,
format, color);
}
Listing 8.37. Prints text in a rectangular region that is aligned as specied by the format parameter.
Both versions of print use DrawText to print the text. Here is the syntax for Draw
Text:
INT DrawText(
LPD3DXSPRITE pSprite,
LPCTSTR pString,
INT Count,
LPRECT pRect,
DWORD Format,
D3DCOLOR Color
);
e parameters are:
• pSprite. A pointer to an ID3DXSprite object that contains the string. It can be
NULL, which results in Direct3D using its own sprite object. For improved perfor-
mance, a sprite object should be specied if DrawText ...