mirror of
https://github.com/Memorix101/UnityXNA/
synced 2024-12-30 15:25:35 +01:00
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
|
|
|
|
namespace Microsoft.Xna.Framework.Graphics
|
|
{
|
|
public class RasterizerState : GraphicsResource
|
|
{
|
|
// TODO: We should be asserting if the state has
|
|
// been changed after it has been bound to the device!
|
|
|
|
public CullMode CullMode { get; set; }
|
|
public float DepthBias { get; set; }
|
|
public FillMode FillMode { get; set; }
|
|
public bool MultiSampleAntiAlias { get; set; }
|
|
public bool ScissorTestEnable { get; set; }
|
|
public float SlopeScaleDepthBias { get; set; }
|
|
|
|
public static readonly RasterizerState CullClockwise;
|
|
public static readonly RasterizerState CullCounterClockwise;
|
|
public static readonly RasterizerState CullNone;
|
|
|
|
public RasterizerState ()
|
|
{
|
|
CullMode = CullMode.CullCounterClockwiseFace;
|
|
FillMode = FillMode.Solid;
|
|
DepthBias = 0;
|
|
MultiSampleAntiAlias = true;
|
|
ScissorTestEnable = false;
|
|
SlopeScaleDepthBias = 0;
|
|
}
|
|
|
|
static RasterizerState ()
|
|
{
|
|
CullClockwise = new RasterizerState () {
|
|
CullMode = CullMode.CullClockwiseFace
|
|
};
|
|
CullCounterClockwise = new RasterizerState () {
|
|
CullMode = CullMode.CullCounterClockwiseFace
|
|
};
|
|
CullNone = new RasterizerState () {
|
|
CullMode = CullMode.None
|
|
};
|
|
}
|
|
}
|
|
} |