Jump to content
  • Advertisement

Archived

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

Speed of LPD3DXFONT

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

I just wrote a class that works with the LPD3DXFONT Direct X class. Although I have just ran into a problem, speed. When I print out just the fps in 800x600x32 I get about 600-800fps. When I print out just 7 more variables the FPS slows to about 300-400!! Does anyone have any idea what I am doing wrong, by the way I am calling the text like this:
    
LPD3DXFONT->Begin();
LPD3DXFONT->DrawText(idents[i], -1, &fontRect, DT_CALCRECT, 0);
LPD3DXFONT->DrawText(idents[i], -1, &fontRect, DT_LEFT, D3DCOLOR_XRGB(255, 50, 50));

...

LPD3DXFONT->End();
    
[edited by - HunterTKilla on October 20, 2002 1:16:32 PM]

Share this post


Link to post
Share on other sites
Advertisement
There are many shortcommings to D3DXFont. The one I read of most often is it uses the Windows GDI to create the text, which is never good when speed is key. You''re only going to get about two to three lines of text before taking massive performance hits.

----
AIDS

Share this post


Link to post
Share on other sites
I can confirm this, I have been using D3DXFont for some basic output stuff, and it is *slow*. I''ll have to look into what Drunken Hyena is talking about.

Share this post


Link to post
Share on other sites
Argh, I just got finished working D3DXFont into my textbox/listitem class hierarchy. I really wanted to be able to set the rectangle for clipping so I could chop text to a certain length in text boxes etc.

Neither CD3DFont nor DH''s implementation do this...

Anyone looked into extending CD3DFont to clip (especially the width) to a rectangle yet? Hmmm...

Share this post


Link to post
Share on other sites
quote:
Original post by Igilima
Anyone looked into extending CD3DFont to clip (especially the width) to a rectangle yet? Hmmm...

yup.

Share this post


Link to post
Share on other sites
the ID3DXFont class isn''t for rendering directly to the screen. Well, it is if you dont care about speed. But if you do care about speed, then its for rendering to a texture.

use the ID3DXFont class to render the alphabet to a texture, then parse the letters of the texture, and go from there.

The problem with the DH font tutorials is that all the fonts have to be pre-generated with a separate program. You can use ID3DXFont to generate them programmatically at load time, or on-the-fly.

Share this post


Link to post
Share on other sites
quote:
Original post by PSioNiC
use the ID3DXFont class to render the alphabet to a texture, then parse the letters of the texture, and go from there.


um... CD3DFont already does that.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!