Faster Text Drawing?

Started by
1 comment, last by Sailorstick 20 years ago
I''m using DirectDraw for my game 2D tile based game. Each ''unit'' on the map has stats displayed next to it (eg. 3/3) the problem is when I am drawing the stats I go down to 15FPS from the 100FPS without drawing the stats. I''ve had a look at all the samples in the SDK and they all use the Windows GDI function ExtTextOut so I used it as well, but it is just too slow. Is there nothing in DirectDraw that can display text faster? I am thinking of making a bitmap character set and just blitting that instead.
Advertisement
GDI produces nice looking text, but it is horribly slow. Bitmap fonts are one solution. Most decent DirectDraw books cover better text output than GDI''s.


Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena
Well one way to speed things up a bit would be how I did it in my game. What I did was add an array to hold whether or not it was time to redraw text to the screen. I won''t show you the code because it was LONG but, you could also try DrawText, it is a standard windows function and it only slows my games down to 30fps. I''ve seen a function called wsprint that seems even faster but I could never get it to work.
By the way drunkenhyna''s suggestion that you use bitmaps is probably the best. I used to use the GDI but now I use bitmaps. I did speed my game up around 40%, but don''t expect to see your game run 100 fps either way. If you need an example of how to bitmaps for numbers send me an email and I''ll send you the some code to show you how.

I wish my lawn was emo, so it would cut itself.

This topic is closed to new replies.

Advertisement