Jump to content
  • Advertisement
Sign in to follow this  
_Sigma

Text Engine

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

How would I go about writing a text engine for my DirectDraw game? I don't really even know where to start other than GDI, which I've heard is slow... Cheers Sigma

Share this post


Link to post
Share on other sites
Advertisement
GDI is very slow.

Most font engines are basically the same. You have an image (or images) that have your font glyphs. You can pre-create it or create it at runtime from a GDI font.

Then when you draw a string you loop through it and for each character you draw/blit the appropriate glyph.

There are numerous optimizations and spiffy additions you can add, but that's the basics. I'd get that working before looking into anything fancier.

Share this post


Link to post
Share on other sites
OK, that sounds bloody slow tho, drawing lets say...100 "letters" per cycle...:(

Or is it more or less faster than one would think? How do you create the font bmp?

cheers

chris

Share this post


Link to post
Share on other sites
It's probably faster than you think. Though as I mentioned that's just a basic implementation. After you get that running you can see how fast it is and then look at possible improvements. The type of optimizations that you would want to use depend a lot on how you're planning on using it. But worry about optimization when you know it's a problem.

To create the font bitmap, I generally use this:
http://www.lmnopc.com/bitmapfontbuilder/

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.

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

Sign me up!