/// <summary> /// Begins a new sprite batch using the appropriate settings for rendering UPF. /// </summary> /// <param name="sortMode">The sorting mode to use when rendering interface elements.</param> /// <param name="blendState">The blend state to apply to the rendered elements.</param> /// <param name="samplerState">The sampler state to apply to the rendered interface elements.</param> /// <param name="effect">The custom effect to apply to the rendered interface elements.</param> /// <param name="localTransform">The transform matrix to apply to the rendered interface elements.</param> public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, Effect effect, Matrix localTransform) { if (SpriteBatch == null) throw new InvalidOperationException(PresentationStrings.DrawingContextDoesNotHaveSpriteBatch); this.localTransform = localTransform; this.combinedTransform = Matrix.Identity; Matrix.Concat(ref localTransform, ref globalTransform, out combinedTransform); SpriteBatch.Begin(sortMode, blendState ?? BlendState.AlphaBlend, samplerState ?? SamplerState.LinearClamp, StencilReadDepthState, RasterizerState.CullCounterClockwise, effect, combinedTransform); }
/// <inheritdoc/> public void SetBlendState(BlendState state) { Contract.EnsureNotDisposed(this, Disposed); }
/// <inheritdoc/> public void SetBlendState(BlendState state) { Contract.Require(state, "state"); Contract.EnsureNotDisposed(this, Disposed); Ultraviolet.ValidateResource(state); if (this.blendState != state) { this.blendState = (OpenGLBlendState)state; this.blendState.Apply(); } }