HRESULT: [0x887A0004], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_UNSUPPORTED/Unsupported], Message: The specified device interface or feature level is not supported on this system.
And this is my code:
using D2D = SharpDX.Direct2D1;
using D3D = SharpDX.Direct3D11;
using DXGI = SharpDX.DXGI;
public class Render {
protected D2D.Factory D2DFactory;
protected D2D.RenderTarget D2DRenderTarget;
protected D3D.Device D3DDevice;
protected DXGI.Device DXGIDevice;
protected D2D.Device D2DDevice;
protected D2D.DeviceContext D2DDeviceContext;
protected DXGI.SwapChain DXGISwapChain;
protected DXGI.SwapChainDescription DXGIDescription;
protected DXGI.Surface DXGISurface;
public Render (Control renderControl) {
D3DDevice = new D3D.Device(SharpDX.Direct3D.DriverType.Hardware, D3D.DeviceCreationFlags.BgraSupport);
DXGIDevice = D3DDevice.QueryInterface<D3D.Device1>().QueryInterface<DXGI.Device>();
D2DDevice = new D2D.Device(DXGIDevice);
D2DDeviceContext = new D2D.DeviceContext(D2DDevice, D2D.DeviceContextOptions.EnableMultithreadedOptimizations);
D2DFactory = D2DDeviceContext.Factory;
DXGIDescription = new DXGI.SwapChainDescription() {
BufferCount = 1, IsWindowed = true, Usage = DXGI.Usage.RenderTargetOutput,
OutputHandle = renderControl.Handle, SwapEffect = DXGI.SwapEffect.Sequential,
ModeDescription = new DXGI.ModeDescription(
renderControl.Size.Width, renderControl.Size.Height,
new DXGI.Rational(60, 1), DXGI.Format.R8G8B8A8_UNorm),
SampleDescription = new DXGI.SampleDescription(1, 0),
};
DXGISwapChain = new DXGI.SwapChain(
DXGIDevice.GetParent<DXGI.Adapter>().GetParent<DXGI.Factory>(),
D3DDevice, DXGIDescription);
DXGISurface = DXGI.Surface.FromSwapChain(DXGISwapChain, 0);
D2DProperties = new D2D.BitmapProperties1() {
BitmapOptions = D2D.BitmapOptions.CannotDraw | D2D.BitmapOptions.Target,
PixelFormat = new D2D.PixelFormat(DXGI.Format.R8G8B8A8_UNorm, D2D.AlphaMode.Ignore),
DpiX = 96, DpiY = 96
};
D2DRenderTarget = new D2D.DeviceContext(D2DDevice, D2D.DeviceContextOptions.None);
D2DDeviceContext.Target = new D2D.Bitmap1((D2D.DeviceContext) D2DRenderTarget, DXGISurface, D2DProperties);
D2DDeviceContext.AntialiasMode = D2D.AntialiasMode.PerPrimitive;
D2DDeviceContext.TextAntialiasMode = D2D.TextAntialiasMode.Cleartype;
}
}
And this is my software environment:
WIN10, DirectX 12, SharpDX 3.1
I tried a variety of solutions but still have this error ...
What is the problem?
On which line do you have exactly the exception?
Have you tried to enable all DirectX debug (for both D3D and D2D) and you have carefully followed the instructions at the bottom of http://sharpdx.org/wiki/usage/
HRESULT: [0x887A0004], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_UNSUPPORTED/Unsupported], Message: The specified device interface or feature level is not supported on this system. And this is my code:
And this is my software environment: WIN10, DirectX 12, SharpDX 3.1
I tried a variety of solutions but still have this error ... What is the problem?