/// <summary> /// Function to clear the states for the graphics object. /// </summary> /// <param name="flush">[Optional] TRUE to flush the queued graphics object commands, FALSE to leave as is.</param> /// <remarks>If <paramref name="flush"/> is set to TRUE, then a performance penalty is incurred.</remarks> public void ClearState(bool flush = false) { if (flush) { Context.Flush(); } if (IsDeferred) { Context.ClearState(); } // Set default states. Input.Reset(); Rasterizer.Reset(); Output.Reset(); Shaders.Reset(); }