我使用DirectX SDK在C#中执行应用程序。它有效,但在重新安装操作系统后,它没有
当我尝试初始化Microsoft.DirectX.Direct3D.Device时,它会抛出Microsoft.DirectX.Direct3D.GraphicsException
ErrorCode:-2147467263(0x80004001)
ErrorString:E_NOTIMPL
Windows Embedded 8.1 Industry Pro(但之前曾在同一系统上工作 - 重新安装之前)
Visual Studio 2015社区(或Visual Studio 2013 Professional - 同样的问题)
以下是代码:
PresentParameters pp = new PresentParameters();
pp.SwapEffect = SwapEffect.Discard;
pp.Windowed = true;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, pp);
答案 0 :(得分:0)
我刚发现自己的错误。我有一个控件中的设备,控件不是任何形式。在我将控件添加到主窗体后,它可以正常工作。 这是代码示例:
public Form1()
{
//Some other staff
this.Controls.Add(myDirect3DControl);
//After that I can initialize the device
}