directdrawdirectx-12direct3d12

How do you draw text in DirectX 12?


This is a follow-up question of How do you draw text in DirectX 11?

In Direct3D-12, things got much more complex and since it's new I couldn't find any suitable libraries online.

I'm building a basic Direct3D12 FPS Test application, and I like to display the FPS data on screen with my rendered image.


Solution

  • The general answer to questions like this is "if you have to ask, then you probably should be using DirectX 11." DirectX 12 is a graphics expert API that provide immense control, and is not particularly concerned with ease-of-use for novices. See this thread for more thoughts in this vein.

    With that out of the way, one option is to use device interop and Direct2D/DirectWrite. See Working with Direct3D 11, Direct3D 10 and Direct2D.

    UPDATE: DirectX Tool Kit for DirectX 12 is now available. It includes a SpriteFont / SpriteBatch implementation that will draw text on Direct3D 12 render targets. See this tutorial.