28 lines
740 B
C#
28 lines
740 B
C#
|
|
using System.Runtime.InteropServices;
|
||
|
|
|
||
|
|
namespace XCEngine.Rendering
|
||
|
|
{
|
||
|
|
[StructLayout(LayoutKind.Sequential)]
|
||
|
|
public struct RenderStateBlock
|
||
|
|
{
|
||
|
|
public RenderStateMask mask;
|
||
|
|
public DepthState depthState;
|
||
|
|
public StencilState stencilState;
|
||
|
|
public byte stencilReference;
|
||
|
|
|
||
|
|
public bool hasOverrides =>
|
||
|
|
mask != RenderStateMask.None;
|
||
|
|
|
||
|
|
public static RenderStateBlock CreateDefault()
|
||
|
|
{
|
||
|
|
return new RenderStateBlock
|
||
|
|
{
|
||
|
|
mask = RenderStateMask.None,
|
||
|
|
depthState = DepthState.CreateDefault(),
|
||
|
|
stencilState = StencilState.CreateDefault(),
|
||
|
|
stencilReference = 0
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|