예제 #1
0
        private Device()
        {
            DeviceCreationFlags flags = DeviceCreationFlags.DisableGpuTimeout
                                        | DeviceCreationFlags.BgraSupport;

#if DEBUG
            flags |= DeviceCreationFlags.Debug;
#endif
            // create 11.1 if possible (disable gpu timeout) but 11.0 is also fine
            Handle = new SharpDX.Direct3D11.Device(DriverType.Hardware, flags, new FeatureLevel[] { FeatureLevel.Level_11_1, FeatureLevel.Level_11_0 });

            // obtain the factory that created the device
            var obj     = Handle.QueryInterface <SharpDX.DXGI.Device>();
            var adapter = obj.Adapter;
            FactoryHandle = adapter.GetParent <SharpDX.DXGI.Factory>();
            context       = Handle.ImmediateContext;

            SetDefaults();
            SupportsDouble         = Handle.CheckFeatureSupport(SharpDX.Direct3D11.Feature.ShaderDoubles);
            SupportMinMaxFiltering = Handle.CheckD3D112Feature().MinMaxFiltering;
        }