Im kinda new to DirectX and i have a problem drawing my font.
When i draw a red text, it shows it like that on the screen:

Why is that?
Could someone tell me what do i need to do to make it draw correctly?
Thank you.
Posted 11 February 2012 - 09:44 AM
HDC hDC = GetDC( NULL );
int nLogPixelsY = GetDeviceCaps(hDC, LOGPIXELSY);
ReleaseDC( NULL, hDC );
int nHeight = -10 * nLogPixelsY / 72;
D3DXCreateSprite(pDevice, &g_pTextSprite);
D3DXCreateFontA( pDevice, nHeight, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
"Arial", &g_pFont );
DrawText("TEST test 1", 5, 5, 0xFFFF0000, true);
void DrawText(LPCSTR text, int X, int Y, D3DCOLOR Color, bool bBold)
{
g_pTextSprite->Begin(NULL);
RECT rcText7 = {X, Y, 0, 0};
g_pFont->DrawTextA(g_pTextSprite, text, -1, &rcText7, DT_NOCLIP, Color);
g_pTextSprite->End();
}
Posted 15 February 2012 - 12:21 PM