ack! choices!

Started by
6 comments, last by cheez_keeper 21 years, 7 months ago
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
Brett Lynnescheez_keeper@hotmail.com
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
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
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
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
Stay Casual,KenDrunken Hyena
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.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
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
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
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
Domenic, Underdoghttp://www.unitedunderdogs.com
better response than i was expecting thanks (and to dh for the link)

Brett Lynnes
cheez_keeper@hotmail.com
Brett Lynnescheez_keeper@hotmail.com

This topic is closed to new replies.

Advertisement