Advertisement Jump to content
Sign in to follow this  
FireSoul

How to create Text in directx9

This topic is 4881 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 have been trying to find out a way to create text in directx 9, i went to msdn and there is the ID3DXFONT interface, and to create it you use D3DXCreateFont or another function (cant remember name). The problem is whenever i try to use this function within my c++ program, whenever i try to compile it, it says D3DXCreateFont does not take 12 paramters. The reason why that is a problem is because there is 12 parameters on the stated on msdn, so im stuck :(. Heres the msdn page: HRESULT WINAPI D3DXCreateFont( LPDIRECT3DDEVICE9 pDevice, INT Height, UINT Width, UINT Weight, UINT MipLevels, BOOL Italic, DWORD CharSet, DWORD OutputPrecision, DWORD Quality, DWORD PitchAndFamily, LPCTSTR pFacename, LPD3DXFONT *ppFont ); msdn page and heres the error: C:\RyanSaved Data\Include\g11\GraphicsFunctions.cpp(68) : error C2660: 'D3DXCreateFont' : function does not take 12 parameters Error executing cl.exe. I might have missed something or using the wrong function, or even the wrong msdn page :). Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
In my code that uses the older style d3dxfont, it works like this. You might want to see if this way compiles.


D3DXFONT_DESC lf;
ZeroMemory(&lf, sizeof(D3DXFONT_DESC));
lf.Height = 0;
lf.Width = 0;
lf.Weight = 500;
lf.MipLevels = 0;
lf.Italic = false;
lf.CharSet = DEFAULT_CHARSET;

strcpy(lf.FaceName, "Times New Roman");
D3DXCreateFontIndirect(device, &lf, &_font);



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!