【问题标题】:Porting from DX9 to SlimDX - DeviceLost location从 DX9 移植到 SlimDX - DeviceLost 位置
【发布时间】:2012-06-04 23:35:38
【问题描述】:

我正在尝试将一些基于 .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 命名空间中,但我不知道这是否有用。

干杯,

【问题讨论】:

    标签: c# directx slimdx


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-05
      • 2013-09-29
      • 2015-11-04
      • 2012-06-03
      相关资源
      最近更新 更多