English 中文(简体)
What approaches are available to revert an IDirect3DDevice9 instance to its default render state?
原标题:

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

最佳回答

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.

问题回答

暂无回答




相关问题
Prerequisite for learning directx

I am from .net C# background and I want to learn DirectX. I have knowledge of C++ but I am fairly new to graphic world. I am little confused about how to start learning directx, should I start ...

How to programmatically disable the auto-focus of a webcam?

I am trying to do computer vision using a webcam (the model is Hercules Dualpix). I know it is not the ideal camera to use, but I have no choice here. The problem is the auto-focus makes it hard/...

Making an object orbit a fixed point in directx?

I am trying to make a very simple object rotate around a fixed point in 3dspace. Basically my object is created from a single D3DXVECTOR3, which indicates the current position of the object, ...

3d Alternative for D3DXSPRITE for billboarding

I am looking to billboard a sun image in my 3d world (directx 9). Creating a D3DXSPRITE is great in some cases, but it is only a 2d object and can not exist in my "world" as a 3d object. What is ...

热门标签