Sign in to follow this  
Hiewk

ID3DXFont too slow

Recommended Posts

Hiewk    122
Hi I've been using ID3DXFont interface to draw some 2d text, but i'm getting a huge slowdown. I'm writing a console, and with 28 lines of text, the frame rate drops from 285 to 35. From past experiences, i kenw that ID3DXFont was slow, but not this much. With vtune i confirmed that ID3DXFont was the cause of this. Calling ID3DXFont.Begin() and ID3DXFont.End() before and after rendering all the lines of text helped a little. Is there any tip to improve the writing of 2d text, not considering rendering fonts from a image file? Or is 28 lines just too much?

Share this post


Link to post
Share on other sites
demiurgeinc    124
Something I noticed... the intellisense of the Draw function of the font class, suggests that when your calling the function for the same text a lot, you should use a sprite, as passing in a string causes the function to have to render the text each time.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
well but in this case isnt always the same text
anyway, thanks

Share this post


Link to post
Share on other sites
DrunkenHyena    805
The D3DXFont that ships with the DX8 SDK is very slow, don't use it. In the Common directory in the SDK install you can find CD3DFont. It's not quite as flexible as D3DXFont but it is a LOT faster.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this