Skip to main content
gamedev.net
🔒 Locked

Text Engine

Started by _Sigma 3 replies 600+ views
Original Post
_Sigma
_Sigma
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
DrunkenHyena
DrunkenHyena
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</FON
_Sigma
_Sigma
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
DrunkenHyena
DrunkenHyena
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</FON
_Sigma
_Sigma
Thanks, I'll try that.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.