Exemplo n.º 1
0
        protected override void OnInitialization(Graphics3DConfiguration config)
        {
            if (GraphicsDirect3D11.Device != null)
            {
                throw new Graphics3DStateException("Cannot do device initialization: Device already initialized!");
            }

            Device11 device = null;

            Device11.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.None, Direct3DConverter11.ConvertToSwapChainDescription(config), out device, out swapChain);
            //Setup device to main device
            GraphicsDirect3D11.Device = device;

            SetupRenderTarget();
        }
        public void SetViewport(Viewport vp)
        {
            DXViewport dxvp = Direct3DConverter11.ConvertToViewport(vp);

            GraphicsDirect3D11.Device.ImmediateContext.Rasterizer.SetViewports(dxvp);
        }