This topic is now archived and is closed to further replies.


Writing Text to the screen

Recommended Posts

Naku    151
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

Share this post

Link to post
Share on other sites
lshadow    123
Well it looks like your call is wrong...thus invalid call. The D3DXFONT which would be g_Font, should be a double pointer.


// other code


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

Share this post

Link to post
Share on other sites