如何在DirectX 11中绘制文本? [英] How do you draw text in DirectX 11?

查看:1846
本文介绍了如何在DirectX 11中绘制文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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教程的链接不再有效,这里是一个指向 RasterTek的Webarchive RadioSpace 提供。

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.

我知道两个选项

I know about two options

关于直接写入的第二个选项需要在d3d11和d3d10.1设备之间共享backbuffer,并使用dwrite + d2d + d3d10.1来渲染gui和d3d11设备渲染3d几何体,并将其合并到backbuffer 查看DieterVW发布的帖子

second option regarding direct write requires sharing backbuffer between d3d11 and d3d10.1 devices and using dwrite + d2d + d3d10.1 to render gui and d3d11 device to render 3d geometry and merge it all in backbuffer see the post from DieterVW on this thread

此时,dwrite和d2d不接受使用d3d11设备创建的表面以进行渲染。但希望MS能尽快做到。

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中绘制文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆