有哪些方法可以将 IDirect3DDevice9 实例恢复为其默认渲染状态?

发布于 2024-09-05 18:42:58 字数 225 浏览 11 评论 0原文

给定 IDirect3DDevice9 的实例,可以使用哪些方法将其置于原始渲染状态(即设备最初创建时所处的状态)?

我遇到的最干净的方法是在创建设备后通过 IDirect3DDevice9::CreateStateBlock 创建一个状态块,以便稍后应用。不幸的是,我在现有项目的限制下操作,因此无法修改设备创建代码;当我的组件获取设备时,其默认状态已被修改。因此,我正在寻找替代方法。

谢谢! 〜拉夫

Given an instance of IDirect3DDevice9, what approaches are available to put it in its original render state (i.e. the state it was in when the device was initially created)?

The cleanest way that I've come across is to create a state block via IDirect3DDevice9::CreateStateBlock just after the device has been created so that it can be applied later. Unfortunately, I'm operating under the constraints of an existing project such that I can't modify the device creation code; by the time my component gets the device, its default state has been modified. As a result, I'm looking for alternative approaches.

Thx!
~Raf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玩心态 2024-09-12 18:42:58

嗯,没有办法 100% 确定。驱动程序经常无法将事物置于默认状态。大多数软件都会设置自己的默认状态,以避免驱动程序出现此类问题。

然而,您“可以”相信驾驶员也做了它应该做的事情。然后,您可以通读文档并将所有渲染状态设置为假定的 默认值

没有其他方法可以做到这一点。

Well there is no way to be 100% sure. The driver often fails to put things into a default state. Most software will set up its own default state to avoid suffering such problems from the driver.

You "could" however rely on the fact that the driver does what it is supposed too. You can then read through the docs and set all the render states to the, supposed, default value.

There is no other way to do this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文