Jump to content
  • Advertisement

Archived

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

cheez_keeper

ack! choices!

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

ID3DXFont::DrawText or CD3DFont::DrawText this may sound stupid, but i have never used windows to draw text for me before, i always used my nice little texture and (hellishly hard to program) drawText routine. so here i am ready to call it quits on my cute text (i am getting sick of the font) and want to know which is faster. currently i am using the CD3DFont because it only requires a x,y rather than a bounding rect (figuring that the clipping and formatting in a rect would take longer) but as i have never used the GDI before i would like some input on which is better. Brett Lynnes cheez_keeper@hotmail.com

Share this post


Link to post
Share on other sites
Advertisement
CD3DFont. No question about it. CD3DFont creates its own texture, and uses that - it''s fast enough for most things (although you can squeeze a bit more out of the system). ID3DXFont is very slow.

If you really need the speed, you can get a faster font class from:
www.drunkenhyena.com
Look for dhEngine, and dhFont.
(Disclaimer: I didn''t make it, it''s not my site)

John B

Share this post


Link to post
Share on other sites
Actually, both CD3DFont and ID3DXFont use texture maps for fonts - it''s just the difference in the implementation. ID3DXFont is more robust, but at the cost of speed.

Jim Adams

Share this post


Link to post
Share on other sites
CD3DFont creates a texture of the font at startup, and then pieces strings together as quads.
ID3DXFont renders a string to a texture and then renders that on a quad.
That''s why ID3DXFont is nicer looking but slower.

The full link to my dhFastFont class is:
http://www.drunkenhyena.com/docs/dhFastFont.phtml

It''s just a simple header file and it doesn''t require my dhEngine. Also you can see the results of speed tests comparing ID3DXFont vs. CD3DFont vs. dhFastFont.

My font class uses pre-made bitmaps, the others use fonts in the system. There are benefits to both ways.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
Also, CD3DFont seems to have a few minor problems, especially if you have a larger font setting for your system. If you find abnormalities with the output, you may need to tweak the code some.

Share this post


Link to post
Share on other sites
quote:
Original post by Jim Adams
Actually, both CD3DFont and ID3DXFont use texture maps for fonts - it''s just the difference in the implementation. ID3DXFont is more robust, but at the cost of speed.

Really? Oh well. I bow to your better knowledge.

John B

Share this post


Link to post
Share on other sites
I''d noticed that using ID3DXFont was consuming a large part of my rendering resources. Thanks for the tip -- I''ll switch over to CD3DFont today.

Domenic Ippolito, a United Underdog

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!