示例#1
0
 protected D3D11RenderTarget SetRenderTarget(D3D11Device device)
 {
     if (_renderTarget == null)
     {
         _renderTarget = new D3D11RenderTarget();
         _renderTarget.Create(device, Width, Height);
     }
     _renderTarget.Setup(device, ClearColor);
     return(_renderTarget);
 }
示例#2
0
        private void D3DContent_Paint(object sender, PaintEventArgs e)
        {
            _device.SetHWND(Handle, ClientSize.Width, ClientSize.Height);

            _drawable.Update(_device);

            if (_backbuffer == null)
            {
                _backbuffer = _device.SwapChain.CreateRenderTarget(_device);
            }
            _backbuffer.Setup(_device,
                              new Color4(0.5f, 0.5f, 0.5f, 0)
                              );
            _drawable.Draw(_device, 0, 0);

            _device.Present();
        }