问题描述
在DirectX 10中,您可以使用D3DX10提供的字体界面。在DirectX 11中,你应该使用DirectWrite。但看起来DirectWrite不直接对Direct3D说话?有什么基本的我缺少?如何使用DirectX 11绘制简单文本?
In DirectX 10 you could use the font interface provided by D3DX10. In DirectX 11 you are supposed to use DirectWrite. But it looks like DirectWrite doesn't speak natively to Direct3D? Is there something basic I'm missing? How do you draw simple text with DirectX 11?
推荐答案
编辑2014:
正如评论中指出的,RasterTek教程的链接不再有效,这里是一个指向由提供。
As pointed out in comment, the link to RasterTek tutorials no longer functions, here is a link to Webarchive of RasterTek provided by RadioSpace.
原始答案的第二点不再有效,因为它现在可以与Direct2D共享D3D11 backbuffer,并通过DirectWrite绘制文本。
The second point of the original answer is no longer valid either, because its now possible to share D3D11 backbuffer with Direct2D and through it draw text with DirectWrite.
At this moment dwrite and d2d dont accept surface created with d3d11 device for rendering. But hopefully MS will make it so soon.
这篇关于如何在DirectX 11中绘制文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!