D3DERR_INVALIDCALL:无效通话(-2005530516)

时间:2012-03-02 00:37:33

标签: c# windows-xp direct3d slimdx

在我的WinXP(SP3)PC上进行测试时,我似乎遇到了错误。错误如下,但在使用我的Win7笔记本电脑时却无法得到它。

D3DERR_INVALIDCALL: Invalid call (-2005530516)
at SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
at SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
at SlimDX.Direct3D9.Device..ctor(Direct3D direct3D, Int32 adapter, DeviceType deviceType, IntPtr     controlHandle, CreateFlags createFlags, PresentParameters[] presentParameters)

导致错误的代码是:

using (var d3d = new Direct3D())
{
using (var tmpDevice = new Device(d3d, 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.HardwareVertexProcessing, new PresentParameters() { BackBufferWidth = 1, BackBufferHeight = 1 }))
{
//I have some code here also but this doesn't even get here
}
}

据我所知,崩溃与创建新设备有关。

1 个答案:

答案 0 :(得分:1)

我的猜测是你的显卡可能不支持1x1后备缓冲。

查看调试运行时的输出。每当你得到InvalidCall时,很有可能会有某种诊断信息表明你做错了什么。