gpt4 book ai didi

c# - SlimDX Device.Reset 崩溃并出现 "D3DERR_INVALIDCALL: Invalid call (-2005530516)"错误

转载 作者:太空狗 更新时间:2023-10-29 22:29:08 29 4
gpt4 key购买 nike

我们最近从 VS 2005 升级到 VS 2008 (Windows XP)。我们在我们的一个项目中使用了 SlimDx。升级后一切正常,除了我的 Recover 函数,它在 devicelost/device reset 上调用,它因

而崩溃

D3DERR_INVALIDCALL: Invalid call (-2005530516)

我使用 Ctrl-Alt-Del 然后使用 Escape 来模拟设备丢失。

void Recover()
{
try
{
if (res.Code == D3DERR_DEVICENOTRESET)
{
res = m_device.Reset(m_presentParams); //Crashes on this.
if (res.IsSuccess)
{
m_deviceLost = false;
}
}
}
catch(Exception e)
{}
}

这是否与 VS 2008 有关,因为它曾经与 VS 2005 配合得很好?

最佳答案

我在 this forum post 中找到了一些有用的信息.请注意该论坛上与 VB 相关的问题,但这仍然是很好的信息。完全归功于Simon O'Connor .

重新格式化并稍作编辑。

INVALIDCALL usually means that either a parameter you've passed to D3D is invalid or an operation you've requested isn't possible.

The easiest way to find out why a D3D call returned an INVALIDCALL error is to let it tell you:

  1. Make sure you're using the DEBUG version of the D3D runtime is installed (you were given the option when you installed the SDK).
  2. Make sure that the DEBUG version of the runtime is enabled. Go to the DirectX applet in the Control Panel and look under the Direct3D tab.
  3. Whilst in the DirectX control panel applet, increase the debug output level for Direct3D to maximum. I've not used Visual BASIC for over 10 years so I've forgotten what debugging support is available and I don't have it installed on this machine to check... If VB DOES have a debug output window:
  4. Run your program and let it fail with the INVALIDCALL error.
  5. Now look at all the text in your debug output window. D3D will log information, warnings, and importantly errors to that. It'll also explain the reason WHY a D3D call has failed.

If VB doesn't have a simple debug output window, download and run DebugView from http://www.sysinternals.com or use the command line debug viewer that comes with the DirectX SDK

关于c# - SlimDX Device.Reset 崩溃并出现 "D3DERR_INVALIDCALL: Invalid call (-2005530516)"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2497641/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com