1

我正在尝试将一些基于 .NET1.1 下的 DX9 的代码转换为 DX9、.NET4 和 SlimDX。

旧代码设置了许多事件处理程序:

graphics.DeviceLost     += new EventHandler( this.InvalidateDeviceObjects );
graphics.DeviceReset    += new EventHandler( this.RestoreDeviceObjects );
graphics.Disposing      += new EventHandler( this.DeleteDeviceObjects );
graphics.DeviceResizing += new CancelEventHandler( this.EnvironmentResizing );

我注意到在 SlimDX.Direct3D9 中,DeviceLost 不再存在。我和其他人有一个类似的问题。

DeviceLost 存在于 SlimDX.Direct3D9.ResultCode 命名空间中,但我不知道这是否有用。

干杯,

4

1 回答 1

1

您需要像在本机 DirectX 中一样使用 TestCooperativeLevel 方法来检查结果代码并采取相应措施。MDX 的事件处理方法有一些不幸的性能缺陷,这就是我们避免实现该系统的原因。

于 2012-06-04T15:35:38.347 回答