SlimDX Device.Reset 崩溃并显示“D3DERR_INVALIDCALL:无效调用 (-2005530516)”错误
我们最近从 VS 2005
升级到 VS 2008
(Windows XP)。我们在一个项目中使用了 SlimDx
。升级后一切正常,除了我的恢复功能,该功能在设备丢失/设备重置时被调用,并崩溃
D3DERR_INVALIDCALL:无效调用 (-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
配合得很好?
We recently upgraded from VS 2005
to VS 2008
(Windows XP). We use SlimDx
in one of our projects. All was working ok after the upgrade, except my Recover function, which gets called on devicelost/device reset which crashes with
D3DERR_INVALIDCALL: Invalid call (-2005530516)
I use Ctrl-Alt-Del and then Escape to simulate device lost.
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)
{}
}
Is this something to do with VS 2008
, as it used to work nicely with VS 2005
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在此论坛帖子中找到了一些有用的信息。请注意该论坛上与 VB 相关的问题,但这仍然是很好的信息。完全归功于Simon O'Connor。
重新格式化并稍加编辑。
I found some helpful information in this forum post. Note the question on that forum related to VB but this is still good info. Full credit to Simon O'Connor.
Reformatted and edited slightly.
当您没有处理所有资源(顶点缓冲区、纹理等)时,通常会发生这种情况
This usually happens when you didn't dispose all you resources (vertex buffer, texture, ...)