• Advertisement
Sign in to follow this  

DirectX 11 and Drawing Text

This topic is 2730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I am using DirectX 11 and want to draw some text on the screen. I have done some
research and it seems the nice interface that existed in DirectX 10 ID3DX10Font
doesn't exist anymore. One way is to use DirectWrite but then I have to involve
another API in my code and I want to avoid that. The SimpleSample11 in the latest DirectX SDK draws the text from scratch, creating the glyphs and so on, which I think is way to complicated for my project. Is there a nice way to just
draw some basic text without relying on either third-party APIs, DirectWrite, or the DirectX Utility Library (which I haven't in my project).

talax

Share this post


Link to post
Share on other sites
Advertisement
Unfortunately, there's no simple solution. Direct2D/DirectWrite don't natively interop with D3D11, which makes it tricky to deal with them (you can do it with DXGI synchronization). The DXUT solution works, but it's not super flexible nor is it easy to just rip it out.

For my own little sample framework I came up with a SpriteRenderer class, and also came up with a SpriteFont class that can generate a sprite sheet of glyphs using GDI+. It's not fantastic, but it works well enough and certainly has good performance. I also tried to make it easier to rip out components than it is with DXUT, but they still rely on a shared error handling utility. You can check it out if you download one of my samples.

Share this post


Link to post
Share on other sites
as alternative you can try CEGUI, it now has d3d11 render along with ability to render any text/gui and images

Share this post


Link to post
Share on other sites
Okej, thank you for that additional suggestion. I'll look into it as soon as I have some time :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement