コード例 #1
0
        public DeviceContext10_1(DeviceSettings10_1 settings)
        {
            m_settings = settings;

            Direct3DFactory = new Factory1();
         
            /* Create a Direct3D device using our passed settings */
            Device = new SlimDX.Direct3D10_1.Device1(Direct3DFactory.GetAdapter(m_settings.AdapterOrdinal),
                                                       DriverType.Hardware,
                                                       settings.CreationFlags,
                                                       FeatureLevel.Level_10_0);

            /* Create a Direct2D factory while we are at it...*/
            Direct2DFactory = new SlimDX.Direct2D.Factory(FactoryType.Multithreaded);

            MakeBothSidesRendered();
        }
コード例 #2
0
        private void InitializeDeviceResources()
        {
            var deviceSettings = new DeviceSettings10_1();
            
            /* Direct2D needs BgraSupport support flag to be set */
            deviceSettings.CreationFlags = DeviceCreationFlags.BgraSupport;

            /* Creates the new device */
            DeviceContext = new DeviceContext10_1(deviceSettings);

            /* Instantiate our composer */
            m_composer = new Composer(DeviceContext);

            /* Make sure we can create pixel shader effects... */
            m_shaderRenderer = new ShaderRenderer(this);

            /* Make sure we can create resources :) */
            m_resources = new ResourceFactory(this);
        }