Text Engine

Started by
3 comments, last by _Sigma 19 years, 5 months ago
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
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.
Stay Casual,KenDrunken Hyena
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
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/
Stay Casual,KenDrunken Hyena
Thanks, I'll try that.

This topic is closed to new replies.

Advertisement