Writing Text to the screen

Started by
1 comment, last by Naku 22 years, 8 months ago
Hi, I''m having trouble drawing text to a D3D screen. I can''t create the D3D font. This is what I have so far g_hfDebugFont = CreateFont(12, 12, 0, 0, FW_NORMAL, FALSE, FALSE, OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial"); if (g_hfDebugFont == NULL) MSG("Failed to Create Font"); HRESULT hrF; if (FAILED (hrF = D3DXCreateFont(g_pd3dDevice, g_hfDebugFont, g_Font) ) ) The d3dDevice is the same one I''m using for drawing everything, is this right or do I need to create another one? D3DXCreateFont is returning an invalid call error message. Thanx *Naku
APE
Advertisement
Well it looks like your call is wrong...thus invalid call. The D3DXFONT which would be g_Font, should be a double pointer.

    LPD3DXFONT g_pFont;// other codeHRESULT hrF;if(FAILED(hrF = D3DXCreateFont(g_pd3dDevice, g_hfDebugFont, &g_pFont)))  


Make sure your g_Font is a pointer. And that should do it.

Edited by - lshadow on August 7, 2001 7:39:04 PM
Working on: DoP
For writing text in screen, only we can use of D3D ?


Hadi Rezaie
Hadi Rezaie

This topic is closed to new replies.

Advertisement