D3DERR_INVALIDCALL: Invalid call (-2005530516)

倖福魔咒の 提交于 2019-12-20 05:21:48

问题


I seem to be getting an error when testing on my WinXP(SP3) PC. The error is below but I don't get it when using my Win7 laptop.

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)

The code that is causes the error is:

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
}
}

As far as I'm aware the crash is to do with creating the new device.


回答1:


My guess is that your graphics card probably doesn't support a 1x1 backbuffer.

Take a look at the output from the debug runtimes. Whenever you get an InvalidCall chances are good that there's some sort of diagnostic information there indicating what you did wrong.



来源:https://stackoverflow.com/questions/9526428/d3derr-invalidcall-invalid-call-2005530516

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!