Jump to content
  • Advertisement
Sign in to follow this  
xegoth

Text in D3D9

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

What's the best way to go about displaying text in D3D9? In a game I made with D3D in DX8 I used D3DXText or whatever it's called, and it was VERY VERY slow. I switched to a text engine by drunken hyena I found, but it displayed oddly on some graphics cards. Anyone know an easy way to display text in DX9 that isn't too slow?

Share this post


Link to post
Share on other sites
Advertisement
ID3DXFont is a lot faster since the Summer 2004 update, and you can preload glyphs or text, and specify your own sprite object if you're going to be drawing multiple sets of text.
If you don't need truetype fonts, you could write your own font renderer with ID3DXSprite, and use a texture with ASCII characters on it.
I currently use both methods, and I don't see any significant slowdown.

Share this post


Link to post
Share on other sites
If you feel like doing some experimenting, take a look at FreeType (http://www.freetype.org). FreeType is a crossplatform library that can load various font formats (including TrueType fonts). I've been using it for a while and it works great! It supports anti-aliasing, kerning, and most likely all the advanced features you can think of.

From the web site:
"FreeType 2 is a software font engine that is designed to be small, efficient, highly customizable and portable while capable of producing high-quality output (glyph images). It can be used in graphics libraries, display servers, font conversion tools, text image generation tools, and many other products as well.."

It's a bit more work but the results are truly great!

Share this post


Link to post
Share on other sites
Well, I agree with the speed of ID3DXFont, but I don't like having to use truetype fonts and such, so I made a system that uses quads (using vertex and index buffers) and a bitmap font. You can color the font any color you want (but the font has to be white in the bitmap). I'm currently setting it up so that you can use upto 4 different colors (one color for each corner) just for an added effect. The font can be customized (I've used it with both 8x16 characters and 10x17 characters. Its free to use (you don't even have to put me in your credits if you don't want to). Since I'm not an artist (and I don't have one yet) I just mapped lucida console to a bitmap for now. If anybody is interested, email me at Programmer16@dfgames.net or Programmer16@msn.com .

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!