I am writing an offline renderer using SlimDX and Direct3D 10 that will need to be run on machines without graphics cards (servers). On these machines, I'll be using the WARP software renderer.
Is it possible to tell if a hardware device is present without throwing an exception in SlimDX? Currently I'm having to do this:
try
{
Device device = new Device1(DriverType.Hardware, deviceCreationFlags,
FeatureLevel.Level_10_1);
return device;
}
catch (Direct3D10Exception)
{
return null;
}
And then create a WARP device if null is returned.
However, each time the exception is thrown, it breaks Visual Studio, which is annoying, and it doesn't seem like I should be catching an exception to determine if a feature is available.
Any way to do this?