public Application( ISwapchainFactory swapChainFactory, IOSMessageLoop messageLoop, IFileSystem fileSystem) { m_services.Add(new GraphicsDevice(swapChainFactory)); m_services.Add(new ContentManager(fileSystem, m_services)); m_messageLoop = messageLoop; swapChainFactory.Resizing += OnResizing; swapChainFactory.Resized += OnResized; }
public GraphicsDevice(ISwapchainFactory swapchainFactory) { m_swapChainFactory = swapchainFactory; DeviceCreationFlags flags = DeviceCreationFlags.BgraSupport; #if DEBUG flags |= DeviceCreationFlags.Debug; #endif FeatureLevel[] featureLevels = { FeatureLevel.Level_11_0, FeatureLevel.Level_10_1, FeatureLevel.Level_10_0 }; Device = new SharpDX.Direct3D11.Device(DriverType.Hardware, flags, featureLevels); Logger.Log.Info(string.Format("Created device with feature level: {0}", Device.FeatureLevel)); ImmediateContext = Device.ImmediateContext; Reset(); }