Microsoft.Xna.Framework.Graphics.GraphicsExtensions.GetBlendFactorDest C# (CSharp) Method

GetBlendFactorDest() public static method

public static GetBlendFactorDest ( this blend ) : BlendingFactorDest
blend this
return BlendingFactorDest
		public static BlendingFactorDest GetBlendFactorDest (this Blend blend)
		{
			switch (blend) {
			case Blend.DestinationAlpha:
				return BlendingFactorDest.DstAlpha;
//			case Blend.DestinationColor:
//				return BlendingFactorDest.DstColor;
			case Blend.InverseDestinationAlpha:
				return BlendingFactorDest.OneMinusDstAlpha;
//			case Blend.InverseDestinationColor:
//				return BlendingFactorDest.OneMinusDstColor;
			case Blend.InverseSourceAlpha:
				return BlendingFactorDest.OneMinusSrcAlpha;
			case Blend.InverseSourceColor:
#if MONOMAC || WINDOWS
				return (BlendingFactorDest)All.OneMinusSrcColor;
#else
				return BlendingFactorDest.OneMinusSrcColor;
#endif
			case Blend.One:
				return BlendingFactorDest.One;
			case Blend.SourceAlpha:
				return BlendingFactorDest.SrcAlpha;
//			case Blend.SourceAlphaSaturation:
//				return BlendingFactorDest.SrcAlphaSaturate;
			case Blend.SourceColor:
#if MONOMAC || WINDOWS
				return (BlendingFactorDest)All.SrcColor;
#else
				return BlendingFactorDest.SrcColor;
#endif
			case Blend.Zero:
				return BlendingFactorDest.Zero;
			default:
				return BlendingFactorDest.One;
			}

		}

Usage Example

Example #1
0
 internal void ApplyState(GraphicsDevice device)
 {
     GL.Enable(EnableCap.Blend);
     GL.ColorMask((this.ColorWriteChannels & ColorWriteChannels.Red) == ColorWriteChannels.Red, (this.ColorWriteChannels & ColorWriteChannels.Green) == ColorWriteChannels.Green, (this.ColorWriteChannels & ColorWriteChannels.Blue) == ColorWriteChannels.Blue, (this.ColorWriteChannels & ColorWriteChannels.Alpha) == ColorWriteChannels.Alpha);
     GL.BlendEquation(GraphicsExtensions.GetBlendEquationMode(this.ColorBlendFunction));
     GL.BlendFunc(GraphicsExtensions.GetBlendFactorSrc(this.ColorSourceBlend), GraphicsExtensions.GetBlendFactorDest(this.ColorDestinationBlend));
 }
All Usage Examples Of Microsoft.Xna.Framework.Graphics.GraphicsExtensions::GetBlendFactorDest