/// <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); }
/// <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); }