Archived

This topic is now archived and is closed to further replies.

Nicao

Text on direct draw overlay

Recommended Posts

Nicao    122
I''m building a simple direct draw overlay to display numbers. I need to know how to display text on a direct draw overlay surface. I can blit to it fine and I can see it on the screen fine. But I can''t use the TextOut function to draw on the overlay surface. Infact I can''t get a DC for the overlay surface. Does anyone know of a better/different way to display text on an overlay surface?

Share this post


Link to post
Share on other sites
DrunkenHyena    805
G''day!

I haven''t played with DirectDraw or Overlays in quite a while, but here''s 3 ideas:
1)Create an offscreen surface (probably in SYSMEM) and write your text to it, then blit to your Overlay.
2)Don''t use Overlays, just get the DC for the backbuffer and write your text directly to it.
3)Create a surface with all the glyphs for the font you want (either pre-made using a tool like Bitmap Font Builder, or dynamically generated at run-time) and blit the font to the backbuffer.

#3 should be the fastest and most efficient but obviously requires the most work.

Of course if you NEED overlays for what you''re doing, you can combine #3 with your original method and blit the font bits to the overlay.

Just a few ideas, I hope they help.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites