コード例 #1
0
 public DeviceRenderState(AlphaBlendState alphaBlendState, AlphaTestState alphaTestState, DepthColourCullState depthState, StencilTestState stencilState)
 {
     StencilTest     = stencilState;
     AlphaBlend      = alphaBlendState;
     AlphaTest       = alphaTestState;
     DepthColourCull = depthState;
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: AlphaTestState.cs プロジェクト: TormentedEmu/OpenUO
        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;
        }
コード例 #5
0
ファイル: AlphaTestState.cs プロジェクト: TormentedEmu/OpenUO
        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;
        }