[D3D] - Showing text as textured quads

Started by
1 comment, last by ChristianPena 18 years, 4 months ago
Hi, I haven't yet delved into doing text on screen besides using the Font class provided by DirectX, but I am planning to use textured quads to represent my text on screen. My question is this: I am creating a console. Should I have a quad for every character in every line of the console or should I have a quad for every character on 1 line and re-texture (for each letter), offset (translate), and draw that one set of quads over and over again for each line of the console? Thanks in advance.
Advertisement
It's not really an answer to your question, but you might want to look into the Sprite class (for Managed DirectX, I believe the C++ equivalent is D3DXSPRITE). This will take care of all the font rendering details behind the scenes, so you don't have to.

Basically you create a Font for it and use the DrawText (or something close) method on the sprite to render a string in your selected font, without all the hassle. Check out the DirectX SDK's samples, they all should use Sprites to draw the frame statistics, help and other texts.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
I will look into it! It doesn't answer the question though. :)

Any one have any take on what approach should be taken?

This topic is closed to new replies.

Advertisement