ack! choices!
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
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
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
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
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
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
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.
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
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 Ippolito, a United Underdog
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement