Jump to content
  • Advertisement


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


fastest way to get text in D3D

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

Is ID3DXText or whatever it''s called just a wrapped version of CD3DFont? Which is faster? I''ve no experiance of CD3DFont, is it easy or do you have to manually detelete all the bits and stuff?
Read about my game, project #1 NEW (13th August): A new screenshot is up, plus diaries for week #3
John 3:16

Share this post

Link to post
Share on other sites
It''s ID3DXFont... and no it''s not a wrapper around CD3DFont. I''ve used both, and ID3DXFont is mega slow. I wouldn''t recommend it for anything but simple demo apps.

CD3DFont works by creating a bitmap in memory, creating the requested font, and then blitting each letter of the alphabet onto the bitmap. It then copies the bitmap to a texture. When you want to draw text to the screen you just pass the string to the CD3DFont.DrawText() function and it creates a plane and figures out what texture coordinates to use for each letter in the string. When you are done with the font at the end of your program just delete the class, and it''s all cleaned up for you.

I''m not sure what the internals of ID3DXFont are, but I know it''s much slower than CD3DFont. I got a 300% increase in frame rate when I switched to CD3DFont.

Hope this helps.


Share this post

Link to post
Share on other sites

D3DXFont renders each string out to a texture using GDI, and then renders a quad using the texture. So it''s very pretty, but horribly slow.

D3DFont is a lot faster and it''s easy to use.
Here are some benchmarks I did comparing D3DXFont and D3DFont to my own text engine:

And here''s a link to my D3DFont mini-tutorial:

As you can see from the source, it''s incredibly simple to set up.

Stay Casual,

Drunken Hyena

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!