【发布时间】:2015-01-30 23:54:23
【问题描述】:
我正在运行我的程序,一段时间后它正在运行它抛出这个异常:
我在我的程序中使用了directx,并且在我所做的表格顶部使用了direct3d:
using Microsoft.DirectX.Direct3D;
using Microsoft.DirectX;
我在我的程序中使用 Direct3D.Sprite 和 Device 以及 Texture PresentParameters 和 DisplayMode 都连接到 DirectX.Direct3D
在异常消息中它说的是关于 OnLostDevice() 和其他的东西。但它没有给出任何具体的行或代码中的问题所在。
有什么方法可以找出问题的原因吗?
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Microsoft.DirectX.Direct3DX
StackTrace:
at Microsoft.DirectX.Direct3D.Sprite.OnLostDevice()
at Microsoft.DirectX.Direct3D.Sprite.OnParentLost(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Microsoft.DirectX.Direct3D.Device.raise_DeviceLost(Object i1, EventArgs i2)
at Microsoft.DirectX.Direct3D.Device.Finalize()
InnerException:
【问题讨论】:
-
我可以将整个项目上传到我的skydrive,因为问题的形式是大量代码,而且项目本身我无法将其上传到这里。也许如果有人尝试使用我的程序,他将能够找到并查看问题所在。
标签: c# .net winforms directx direct3d