Although this might sound implausible, this morning when compiling my game I got a run-time error: E_FAIL: An undetermined error ocurred (-2147467259).
The sequence of code is:
// DirectX DXGI 1.1 factory
factory1 = new SlimDX.DXGI.Factory1();
// The 1st graphics adapter
adapter1 = factory1.GetAdapter1(0);
description = new SlimDX.DXGI.SwapChainDescription()
{
BufferCount = 2,
Usage = SlimDX.DXGI.Usage.RenderTargetOutput,
OutputHandle = this.Handle,
IsWindowed = true,
ModeDescription = new SlimDX.DXGI.ModeDescription(0, 0, new SlimDX.Rational(60, 1), SlimDX.DXGI.Format.R8G8B8A8_UNorm),
SampleDescription = new SlimDX.DXGI.SampleDescription(1, 0),
Flags = SlimDX.DXGI.SwapChainFlags.AllowModeSwitch,
SwapEffect = SlimDX.DXGI.SwapEffect.Discard
}
SlimDX.Direct3D11.FeatureLevel[] featureLevels = new SlimDX.Direct3D11.FeatureLevel[] { SlimDX.Direct3D11.FeatureLevel.Level_10_1 };
if(debug){MessageBox.Show( "InitialiseGraphics()...2");}
SlimDX.Direct3D11.Device.CreateWithSwapChain(
adapter1,
SlimDX.Direct3D11.DeviceCreationFlags.Debug,
featureLevels,
description,
out graphics,
out swapChain
);
The swapChain creation code is failing, whereas yesterday is was fine. Nothing has been changed here at all, so I'm completely stumped. I've tried changing the feature level back down to 9_1 but this doesn't work. I'm baffled. Any ideas?