Initializing Direct3D.Device throws GraphicsException with E_NOTIMPL

0

I do an application in C# using DirectX SDK. It worked but after OS reinstall, it don't.
When I try to initialize Microsoft.DirectX.Direct3D.Device, it throws Microsoft.DirectX.Direct3D.GraphicsException ErrorCode: -2147467263 (0x80004001)
ErrorString: E_NOTIMPL

Windows Embedded 8.1 Industry Pro (but it used to work on the same system earlier - before reinstall)

Visual Studio 2015 Community (or Visual Studio 2013 Professional - the same problem)

Here is the code:

        PresentParameters pp = new PresentParameters();
        pp.SwapEffect = SwapEffect.Discard;
        pp.Windowed = true;
        device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, pp);
c#
directx
visual-studio-2015
direct3d
asked on Stack Overflow Sep 17, 2015 by user5342945

1 Answer

0

I just found my mistake. I have the device in a Control and the Control wasn't in any Form. After I've added the Control to the main Form, it works. Here is the code exemple:

public Form1()
{
  //Some other staff
  this.Controls.Add(myDirect3DControl);
  //After that I can initialize the device
}
answered on Stack Overflow Sep 17, 2015 by user5342945

User contributions licensed under CC BY-SA 3.0