Sign in to follow this  

DirectX 11 and Drawing Text

This topic is 2657 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
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

This topic is 2657 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this