Archived

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

jumble

Blitting fonts to a surface

Recommended Posts

Ok, looking through the directx SDK Font sample i notice:
quote:
This sample program shows how to directly lock and access video memory, using text generated from a GDI font. There are much better ways to draw text into a DirectDrawSurface, and the only point of this sample is to show exactly how to lock and access the video memory directly.
What are the better ways? I need to write an FPS counter and score table to my almost complete tetris clone And dont worry, i''ll force all of you to play it once ive finished it /home/./~jumble ---------------

Share this post


Link to post
Share on other sites
You can use GDI if you don''t need speed or you can blt from a bitmap which has all the letters and symbols you want to use.
GDI is simple to use but it''s not very fast.
The bitmap technique is faster but harder to implent.
So, it''s up to up to decide if you need speed or easy programmation.

Darkening

Share this post


Link to post
Share on other sites
NukeDX has a bitmap font implementation, and so do several other graphics helper libraries.

NukeDX actually allows you to create a bitmap from a True Type font at runtime (actually uses GDI just once, creating a bitmap in memory of all the letters), and uses that to draw the font characters.

http://www.nukesoftware.dk

Clay

Share this post


Link to post
Share on other sites