Sign in to follow this  

Odd ID3DXFont problem

This topic is 2489 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

Hello all,

I'm having an odd issue with ID3DXFont.
I'll start by posting an image of the problem and maybe someone will recognize it straight away,

[img]http://i128.photobucket.com/albums/p169/liamf1986/craptext.jpg[/img]

That supposedly says Debug Mode....
This problem only occurs when the DrawText() function of any font object is only called once. If I draw another line later in the program both lines draw perfectly fine, as shown below,

[img]http://i128.photobucket.com/albums/p169/liamf1986/goodtext.jpg[/img]

The problem is localized to each instance of ID3DXFont, meaning I can create 2 instances of ID3DXFont draw 2 lines with one instance and they will draw fine but if I only draw one line with the other instance that line will draw incorrectly.

My Text drawing code is as follows;

[code]
device->ClearScreen(bgColor);
device->BeginScene();

spriteInterface->Begin(D3DXSPRITE_ALPHABLEND);

RECT fontPos;
SetRect(&fontPos, xPos, yPos, 100, 100);

debugText->DrawText(spriteInterface,
"Debug Mode",
-1,
&fontPos,
DT_LEFT | DT_NOCLIP,
D3DCOLOR_XRGB(255, 255, 255));

spriteInterface->End();

device->EndScene();
device->Present(NULL, NULL, NULL, NULL);
[/code]

Greatly appreciate any help anyone can offer,
cheers Liam F

Share this post


Link to post
Share on other sites
Oh I forgot to mention,
I just transfered this project from a Windows 7 laptop to a windows vista laptop which is when the issues arose. The text was always displaying fine on the other system.

Both systems have The latest Direct X SDK (June 2010) and both running the Visual C++ 2010 express edition IDE.

Thx again, Liam

Share this post


Link to post
Share on other sites

This topic is 2489 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this