ID3DX10Font::PreloadText method
Load formatted text into video memory to improve the efficiency of rendering to the device. This method supports ANSI and Unicode strings.
Syntax
HRESULT PreloadText(
[in] LPCSTR pString,
[in] INT Count
);
Parameters
-
pString [in]
-
Type: LPCSTR
Pointer to a string of characters to be loaded into video memory. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR; otherwise, the data type resolves to LPCSTR. See Remarks.
-
Count [in]
-
Type: INT
Number of characters in the text string.
Return value
Type: HRESULT
If the method succeeds, the return value is S_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA.
Remarks
The compiler setting also determines the function version. If Unicode is defined, the function call resolves to PreloadTextW. Otherwise, the function call resolves to PreloadTextA because ANSI strings are being used.
This method generates textures that contain glyphs that represent the input text. The glyphs are drawn as a series of triangles.
Text will not be rendered to the device; ID3DX10Font::DrawText must still be called to render the text. However, by preloading text into video memory, ID3DX10Font::DrawText will use substantially fewer CPU resources.
This method internally converts characters to glyphs using the GDI function GetCharacterPlacement.
Requirements
Requirement | Value |
---|---|
Header |
|
Library |
|
See also