Show More
Commit Description:
Add missing component and message.
Commit Description:
Add missing component and message.
File last commit:
Show/Diff file:
Action:
FNA/src/Graphics/States/BlendState.cs
242 lines | 3.9 KiB | text/x-csharp | CSharpLexer
Early working version (including all dependencies, lol).
r0 #region License
/* FNA - XNA4 Reimplementation for Desktop Platforms
Upgrade FNA to 22.12...
r690 * Copyright 2009-2022 Ethan Lee and the MonoGame Team
Early working version (including all dependencies, lol).
r0 *
* Released under the Microsoft Public License.
* See LICENSE for details.
*/
#endregion
namespace Microsoft.Xna.Framework.Graphics
{
public class BlendState : GraphicsResource
{
#region Public Properties
public BlendFunction AlphaBlendFunction
{
Upgrade FNA to 22.12...
r690 get
{
return state.alphaBlendFunction;
}
set
{
state.alphaBlendFunction = value;
}
Early working version (including all dependencies, lol).
r0 }
public Blend AlphaDestinationBlend
{
Upgrade FNA to 22.12...
r690 get
{
return state.alphaDestinationBlend;
}
set
{
state.alphaDestinationBlend = value;
}
Early working version (including all dependencies, lol).
r0 }
public Blend AlphaSourceBlend
{
Upgrade FNA to 22.12...
r690 get
{
return state.alphaSourceBlend;
}
set
{
state.alphaSourceBlend = value;
}
Early working version (including all dependencies, lol).
r0 }
public BlendFunction ColorBlendFunction
{
Upgrade FNA to 22.12...
r690 get
{
return state.colorBlendFunction;
}
set
{
state.colorBlendFunction = value;
}
Early working version (including all dependencies, lol).
r0 }
public Blend ColorDestinationBlend
{
Upgrade FNA to 22.12...
r690 get
{
return state.colorDestinationBlend;
}
set
{
state.colorDestinationBlend = value;
}
Early working version (including all dependencies, lol).
r0 }
public Blend ColorSourceBlend
{
Upgrade FNA to 22.12...
r690 get
{
return state.colorSourceBlend;
}
set
{
state.colorSourceBlend = value;
}
Early working version (including all dependencies, lol).
r0 }
public ColorWriteChannels ColorWriteChannels
{
Upgrade FNA to 22.12...
r690 get
{
return state.colorWriteEnable;
}
set
{
state.colorWriteEnable = value;
}
Early working version (including all dependencies, lol).
r0 }
public ColorWriteChannels ColorWriteChannels1
{
Upgrade FNA to 22.12...
r690 get
{
return state.colorWriteEnable1;
}
set
{
state.colorWriteEnable1 = value;
}
Early working version (including all dependencies, lol).
r0 }
public ColorWriteChannels ColorWriteChannels2
{
Upgrade FNA to 22.12...
r690 get
{
return state.colorWriteEnable2;
}
set
{
state.colorWriteEnable2 = value;
}
Early working version (including all dependencies, lol).
r0 }
public ColorWriteChannels ColorWriteChannels3
{
Upgrade FNA to 22.12...
r690 get
{
return state.colorWriteEnable3;
}
set
{
state.colorWriteEnable3 = value;
}
Early working version (including all dependencies, lol).
r0 }
public Color BlendFactor
{
Upgrade FNA to 22.12...
r690 get
{
return state.blendFactor;
}
set
{
state.blendFactor = value;
}
Early working version (including all dependencies, lol).
r0 }
public int MultiSampleMask
{
Upgrade FNA to 22.12...
r690 get
{
return state.multiSampleMask;
}
set
{
state.multiSampleMask = value;
}
Early working version (including all dependencies, lol).
r0 }
#endregion
#region Public BlendState Presets
public static readonly BlendState Additive = new BlendState(
"BlendState.Additive",
Blend.SourceAlpha,
Blend.SourceAlpha,
Blend.One,
Blend.One
);
public static readonly BlendState AlphaBlend = new BlendState(
"BlendState.AlphaBlend",
Blend.One,
Blend.One,
Blend.InverseSourceAlpha,
Blend.InverseSourceAlpha
);
public static readonly BlendState NonPremultiplied = new BlendState(
"BlendState.NonPremultiplied",
Blend.SourceAlpha,
Blend.SourceAlpha,
Blend.InverseSourceAlpha,
Blend.InverseSourceAlpha
);
public static readonly BlendState Opaque = new BlendState(
"BlendState.Opaque",
Blend.One,
Blend.One,
Blend.Zero,
Blend.Zero
);
#endregion
Upgrade FNA to 22.12...
r690 #region Internal FNA3D Variables
internal FNA3D.FNA3D_BlendState state;
#endregion
Early working version (including all dependencies, lol).
r0 #region Public Constructor
public BlendState()
{
AlphaBlendFunction = BlendFunction.Add;
AlphaDestinationBlend = Blend.Zero;
AlphaSourceBlend = Blend.One;
ColorBlendFunction = BlendFunction.Add;
ColorDestinationBlend = Blend.Zero;
ColorSourceBlend = Blend.One;
ColorWriteChannels = ColorWriteChannels.All;
ColorWriteChannels1 = ColorWriteChannels.All;
ColorWriteChannels2 = ColorWriteChannels.All;
ColorWriteChannels3 = ColorWriteChannels.All;
BlendFactor = Color.White;
MultiSampleMask = -1; // AKA 0xFFFFFFFF
}
#endregion
#region Private Constructor
private BlendState(
string name,
Blend colorSourceBlend,
Blend alphaSourceBlend,
Blend colorDestBlend,
Blend alphaDestBlend
) : this() {
Name = name;
ColorSourceBlend = colorSourceBlend;
AlphaSourceBlend = alphaSourceBlend;
ColorDestinationBlend = colorDestBlend;
AlphaDestinationBlend = alphaDestBlend;
}
#endregion
}
}