public void Clear(Texture renderTarget, Color4 color)
        {
            if (renderTarget == null)
            {
                throw new ArgumentNullException("RenderTarget");
            }

            NativeDeviceContext.ClearRenderTargetView(renderTarget.NativeRenderTargetView, color);
        }
예제 #2
0
 private void Draw()
 {
     d3dDeviceContext.ClearRenderTargetView(renderTargetView, new SharpDX.Color(32, 103, 178));
     d3dDeviceContext.InputAssembler.SetVertexBuffers(0, new SharpDX.Direct3D11.VertexBufferBinding(triangleVertexBuffer, SharpDX.Utilities.SizeOf <SharpDX.Vector3>(), 0));
     d3dDeviceContext.InputAssembler.SetIndexBuffer(idexBuffer, SharpDX.DXGI.Format.R32_UInt, 0);
     d3dDeviceContext.PixelShader.SetConstantBuffer(0, constBuffer);
     d3dDeviceContext.DrawIndexed(indexes.Count(), 0, 0);
     swapChain.Present(1, SharpDX.DXGI.PresentFlags.None);
 }