Jump to content
  • Advertisement

Archived

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

Naku

Writing Text to the screen

This topic is 6191 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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 code


HRESULT 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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!