Show More
Commit Description:
Fix syntax error.
Commit Description:
Fix syntax error.
References:
File last commit:
Show/Diff file:
Action:
FNA/src/Graphics/States/RasterizerState.cs
141 lines | 2.2 KiB | text/x-csharp | CSharpLexer
141 lines | 2.2 KiB | text/x-csharp | CSharpLexer
r0 | #region License | |||
/* FNA - XNA4 Reimplementation for Desktop Platforms | ||||
r690 | * Copyright 2009-2022 Ethan Lee and the MonoGame Team | |||
r0 | * | |||
* Released under the Microsoft Public License. | ||||
* See LICENSE for details. | ||||
*/ | ||||
#endregion | ||||
namespace Microsoft.Xna.Framework.Graphics | ||||
{ | ||||
public class RasterizerState : GraphicsResource | ||||
{ | ||||
#region Public Properties | ||||
public CullMode CullMode | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.cullMode; | ||||
} | ||||
set | ||||
{ | ||||
state.cullMode = value; | ||||
} | ||||
r0 | } | |||
public float DepthBias | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.depthBias; | ||||
} | ||||
set | ||||
{ | ||||
state.depthBias = value; | ||||
} | ||||
r0 | } | |||
public FillMode FillMode | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.fillMode; | ||||
} | ||||
set | ||||
{ | ||||
state.fillMode = value; | ||||
} | ||||
r0 | } | |||
public bool MultiSampleAntiAlias | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.multiSampleAntiAlias == 1; | ||||
} | ||||
set | ||||
{ | ||||
state.multiSampleAntiAlias = (byte) (value ? 1 : 0); | ||||
} | ||||
r0 | } | |||
public bool ScissorTestEnable | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.scissorTestEnable == 1; | ||||
} | ||||
set | ||||
{ | ||||
state.scissorTestEnable = (byte) (value ? 1 : 0); | ||||
} | ||||
r0 | } | |||
public float SlopeScaleDepthBias | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.slopeScaleDepthBias; | ||||
} | ||||
set | ||||
{ | ||||
state.slopeScaleDepthBias = value; | ||||
} | ||||
r0 | } | |||
#endregion | ||||
#region Public RasterizerState Presets | ||||
public static readonly RasterizerState CullClockwise = new RasterizerState( | ||||
"RasterizerState.CullClockwise", | ||||
CullMode.CullClockwiseFace | ||||
); | ||||
public static readonly RasterizerState CullCounterClockwise = new RasterizerState( | ||||
"RasterizerState.CullCounterClockwise", | ||||
CullMode.CullCounterClockwiseFace | ||||
); | ||||
public static readonly RasterizerState CullNone = new RasterizerState( | ||||
"RasterizerState.CullNone", | ||||
CullMode.None | ||||
); | ||||
#endregion | ||||
r690 | #region Internal FNA3D Variables | |||
internal FNA3D.FNA3D_RasterizerState state; | ||||
#endregion | ||||
r0 | #region Public Constructor | |||
public RasterizerState() | ||||
{ | ||||
CullMode = CullMode.CullCounterClockwiseFace; | ||||
FillMode = FillMode.Solid; | ||||
DepthBias = 0; | ||||
MultiSampleAntiAlias = true; | ||||
ScissorTestEnable = false; | ||||
SlopeScaleDepthBias = 0; | ||||
} | ||||
#endregion | ||||
#region Private Constructor | ||||
private RasterizerState( | ||||
string name, | ||||
CullMode cullMode | ||||
) : this() { | ||||
Name = name; | ||||
CullMode = cullMode; | ||||
} | ||||
#endregion | ||||
} | ||||
} | ||||