D3DXCreateFontIndirect

Started by
3 comments, last by Muhammad Haggag 19 years, 6 months ago
Dear all: When i use the D3DXCreateFontIndirect or D3DXCreateFont in WinMe system,it always fall. Everyone know about it,Please tell me. thanks ttom
Advertisement
There are 2 reasons why D3DXCreateFontIndirect might be failing, one is that you are running out of memory, and there is not enough left to create the font object. The other is that one of the parameters passed to the function is invalid.

You can find out which it is like so:

HRESULT hr = D3DXCreateFontIndirect(...);if(FAILED(hr)){    if(hr == D3DERR_INVALIDCALL)    {        // A parameter may have an invalid value.     }    if(hr == E_OUTOFMEMORY)    {        // Direct3D couldnt allocate sufficient memory to        // complete the call    }}


Once you know what the error is, you will have a better idea how to fix it.
Life is all about expression, so express yourself.
If you have your Debug settings set up properly it will tell you why it's failing. Check out the Forum FAQ for more details.
Stay Casual,KenDrunken Hyena
Thanks to all reply this question.
When I ues the D3DXCreateFontIndirect or D3DXCreateFont,
it fail and it show "D3DERR_INVALIDCALL". So i change the
every parameter , it is the same. i don't have any idea.
ps. i use the vs2003 and dx9.0b in winxp sp2 for develop and
test and the win me.
ttom
Quote:Original post by Mosh
There are 2 reasons why D3DXCreateFontIndirect might be failing, one is that you are running out of memory, and there is not enough left to create the font object. The other is that one of the parameters passed to the function is invalid.

Keep in mind that functions aren't limited to returning the values listed in their documentation page. They can and do return other values (Though you compare against specific errors inside a FAILED() block, so it's relatively Ok).

The best thing to do here is link to the debug version of D3DX (d3dx9d.lib) and check the debug output.

This topic is closed to new replies.

Advertisement