CD3DFont::Render3DText looks scary internally

Started by
4 comments, last by HaywireGuy 20 years, 6 months ago
Don''t you think so? I mean all the Lock/Unlock of VB, multiplications/divisions, DrawPrimitives... so many of them. Isn''t that tellin'' me "dude, your framerate is now halved"? Ugh, anyway, I''m gonna give ID3DXFont a try first... THEN, I''m gonna try the summer update
Advertisement
That''s I said as well when I saw it but it looks like it doesn''t eat up your fps. An alternative is to go with ID3DXFONT directly like I did... I''m quite happy about it

Ivan
quote:Original post by HaywireGuy
THEN, I''m gonna try the summer update


... might want to avoid id3dxfont until *after* you''ve put on the summer update --- it''s wicked-slow pre-update, and almost just as fast as cd3dfont in the update.

Also, if you''re looking a spitting out mostly static text very quickly, then your own font class may be worthwhile - just so you''re not recalculating font size/pos and rebuilding the vb every frame, plus you can better optimize the building/rendering.

Depends a lot on how much text you''re looking at outputting - if it''s not much, or if it''s not very static, then you''ll need to weigh whether it''s worth your time to write your own font class.
Or maybe he wants to see the difference

--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..
Cryo75,

I''ve looked into CD3DFont class and understood the way it
works. Yeah, you''re right, I misunderstood the code at the
beginnin'' and thought it could take up too much processin''
time, but that''s not true. However, it''s redundant to do this
kind of lockin''/unlockin'' if your text does not change.

Chdennis,

Yes you''re right, I''m workin'' on my own font class since
yesterday, in fact I called it "label", where you can call
CD3DLabel::SetText(_T("Bla bla")) and have all the VB/textures
set up once. Use CD3DLabel::Render() to draw it without any
other calculations.

Pipo,

You know simply by lookin'' at how CD3DFont works, I could feel
the slowness of it... it was so scary with tons of function
calls/calculations in it. So I''m not gonna try because I
already can see the difference.




I''m using ID3DXFONT directly coz I just want to display the fps so I avoided CD3DFont and writing my own classes. When it comes to the actual font used in the engine, well... that''s a different story altogether.

This topic is closed to new replies.

Advertisement