Esempio n. 1
0
        /// <summary>
        /// Clears the specified render target. See <see cref="Textures+and+render+targets"/> to learn how to use it.
        /// </summary>
        /// <param name="renderTarget">The render target.</param>
        /// <param name="color">The color.</param>
        /// <exception cref="System.ArgumentNullException">renderTarget</exception>
        public unsafe void Clear(Texture renderTarget, Color4 color)
        {
            if (renderTarget == null)
            {
                throw new ArgumentNullException("renderTarget");
            }

            NativeDeviceContext.ClearRenderTargetView(renderTarget.NativeRenderTargetView, *(RawColor4 *)&color);
        }
Esempio n. 2
0
 /// <summary>
 /// Clear backbuffer and zbuffer
 /// </summary>
 /// <param name="color">background color</param>
 public void Clear(Color4 color)
 {
     NativeDeviceContext.ClearRenderTargetView(backBufferView, color);
     NativeDeviceContext.ClearDepthStencilView(depthStencilView, DepthStencilClearFlags.Depth, 1.0F, 0);
 }