Archived

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

ack! choices!

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