使用 Direct3D 的 2D 图形
我正在尝试使用 Direct3D 渲染 2D 图形,这是自 DirectDraw 弃用以来每个人都推荐的。我确实不关心任何 3D 效果,只是希望能够执行诸如在彼此上绘制线条、圆圈和位图传输图像之类的操作。因此,我的问题是
- 我需要从文件中加载大量图像,并将它们相互绘制。纹理会是正确的选择吗?
- 非常愚蠢的问题,但我似乎找不到任何东西:如何将一个表面渲染到另一个表面上?
- 您应该将所有内容渲染到单个纹理上,然后将其作为精灵绘制到屏幕上,还是只绘制许多纹理?
- 如何在纹理/表面/精灵上绘制线条等?我认为有比获取设备上下文并使用 GDI 在其上绘图更好的方法吗?
I'm trying to use Direct3D to render 2D graphics, as recommended by everyone since DirectDraw's deprecation. There really isn't any 3D-ness I care about, and just want to be able to do things like draw lines, circles, and blit images onto each other. My questions are thus
- I need to load a lot of images from files, and draw them onto each other. Would textures be the way to go?
- Very stupid question, but I can't seem to find anything: How do you render one surface onto another?
- Should you render everything onto a single texture and then draw that to screen as a sprite, or just draw many textures?
- How do you draw lines, etc, onto a texture/surface/sprite? I assume there's a better way than getting a device context and using GDI to draw on it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)