🔒 Locked
Text Methods....
Advertisement
Original Post
Hey, I was wondering what are some different methods to make some text functions to display text on the screen using a bitmap with letters on it. The search isnt working right now, so I cant really find anything that way. I was wondering if you would create an image surface, some matrices, or some other method. If someone could point me towards some tutorials, that would be great. Thanks!
The recommended way is to use one large texture in video memory with all the printable characters on it, and adjust the texture coordinates appropriately for each letter.
How you get this texture depends. You can load it from a custom image file, or you can generate it at runtime (i.e, use GDI to draw the characters onto the texture when your app loads).
ID3DXFont is also a very viable alternative. It's very fast and reasonably flexible. It should usually do the trick unless you have some specific feature that ID3DXFont does not posess.
How you get this texture depends. You can load it from a custom image file, or you can generate it at runtime (i.e, use GDI to draw the characters onto the texture when your app loads).
ID3DXFont is also a very viable alternative. It's very fast and reasonably flexible. It should usually do the trick unless you have some specific feature that ID3DXFont does not posess.
Quote:
Original post by Holy Fuzz
The recommended way is to use one large texture in video memory with all the printable characters on it, and adjust the texture coordinates appropriately for each letter.
How you get this texture depends. You can load it from a custom image file, or you can generate it at runtime (i.e, use GDI to draw the characters onto the texture when your app loads).
ID3DXFont is also a very viable alternative. It's very fast and reasonably flexible. It should usually do the trick unless you have some specific feature that ID3DXFont does not posess.
... or you fancy learning it for urself.
Go with textured quads, look at my site for one in my X-Engine i wrote ages ago.
See sig.
ace
Quote:
Original post by ace_lovegrove Quote:
Original post by Holy Fuzz
The recommended way is to use one large texture in video memory with all the printable characters on it, and adjust the texture coordinates appropriately for each letter.
How you get this texture depends. You can load it from a custom image file, or you can generate it at runtime (i.e, use GDI to draw the characters onto the texture when your app loads).
ID3DXFont is also a very viable alternative. It's very fast and reasonably flexible. It should usually do the trick unless you have some specific feature that ID3DXFont does not posess.
... or you fancy learning it for urself.
Go with textured quads, look at my site for one in my X-Engine i wrote ages ago.
See sig.
ace
Well, the OP's asking for a function to print text, not how to; it sounds like they just want to stick text on the screen without having to roll their own. Also, as the previous posters and the forum FAQ says, ID3DXFONT is very fast and it's very doubtful you could write a faster solution. It's really simple to get working, too. I like it :]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement