public DeviceRenderState(AlphaBlendState alphaBlendState, AlphaTestState alphaTestState, DepthColourCullState depthState, StencilTestState stencilState) { StencilTest = stencilState; AlphaBlend = alphaBlendState; AlphaTest = alphaTestState; DepthColourCull = depthState; }
internal void ResetState(ref AlphaTestState current, DeviceContext device) { device.SetRenderState(RenderState.AlphaTestEnable, Enabled); device.SetRenderState(RenderState.AlphaFunc, AlphaTestFunction); device.SetRenderState(RenderState.AlphaRef, ReferenceAlpha); current._mode = _mode; }
internal bool ApplyState(ref AlphaTestState current, DeviceContext device) { bool changed = false; if (Enabled) { #if DEBUG changed = _mode != current._mode; #endif if (!current.Enabled) { device.SetRenderState(RenderState.AlphaTestEnable, true); } if (AlphaTestFunction != current.AlphaTestFunction) { device.SetRenderState(RenderState.AlphaFunc, AlphaTestFunction); } if (ReferenceAlpha != current.ReferenceAlpha) { device.SetRenderState(RenderState.AlphaRef, ReferenceAlpha); } current._mode = _mode; } else { if (current.Enabled) { #if DEBUG changed = true; #endif device.SetRenderState(RenderState.AlphaTestEnable, false); current.Enabled = false; } } return(changed); }
internal bool ApplyState(ref AlphaTestState current, DeviceContext device) { bool changed = false; if (Enabled) { #if DEBUG changed = _mode != current._mode; #endif if (!current.Enabled) device.SetRenderState(RenderState.AlphaTestEnable, true); if (AlphaTestFunction != current.AlphaTestFunction) device.SetRenderState(RenderState.AlphaFunc, AlphaTestFunction); if (ReferenceAlpha != current.ReferenceAlpha) device.SetRenderState(RenderState.AlphaRef, ReferenceAlpha); current._mode = _mode; } else { if (current.Enabled) { #if DEBUG changed = true; #endif device.SetRenderState(RenderState.AlphaTestEnable, false); current.Enabled = false; } } return changed; }