public DepthStencilStateDesc(DepthStencilStateTypes type)
        {
            switch (type)
            {
                case DepthStencilStateTypes.None:
                    depthReadEnable = false;
                    depthWriteEnable = false;
                    depthFunc = X.CompareFunction.Less;

                    stencilEnable = false;
                    stencilFunc = X.CompareFunction.Never;
                    stencilFailOp = X.StencilOperation.Keep;
                    stencilDepthFailOp = X.StencilOperation.Keep;
                    stencilPassOp = X.StencilOperation.Keep;
                    break;

                case DepthStencilStateTypes.ReadWrite_Less:
                    depthReadEnable = true;
                    depthWriteEnable = true;
                    depthFunc = X.CompareFunction.Less;

                    stencilEnable = false;
                    stencilFunc = X.CompareFunction.Never;
                    stencilFailOp = X.StencilOperation.Keep;
                    stencilDepthFailOp = X.StencilOperation.Keep;
                    stencilPassOp = X.StencilOperation.Keep;
                    break;

                default:
                    Debug.ThrowError("DepthStencilStateDesc", "Unsuported DepthStencilStateType");
                    break;
            }
        }
Exemplo n.º 2
0
        public DepthStencilStateDesc(DepthStencilStateTypes type)
        {
            switch (type)
            {
            case DepthStencilStateTypes.None:
                depthReadEnable  = false;
                depthWriteEnable = false;
                depthFunc        = X.CompareFunction.Less;

                stencilEnable      = false;
                stencilFunc        = X.CompareFunction.Never;
                stencilFailOp      = X.StencilOperation.Keep;
                stencilDepthFailOp = X.StencilOperation.Keep;
                stencilPassOp      = X.StencilOperation.Keep;
                break;

            case DepthStencilStateTypes.ReadWrite_Less:
                depthReadEnable  = true;
                depthWriteEnable = true;
                depthFunc        = X.CompareFunction.Less;

                stencilEnable      = false;
                stencilFunc        = X.CompareFunction.Never;
                stencilFailOp      = X.StencilOperation.Keep;
                stencilDepthFailOp = X.StencilOperation.Keep;
                stencilPassOp      = X.StencilOperation.Keep;
                break;

            default:
                Debug.ThrowError("DepthStencilStateDesc", "Unsuported DepthStencilStateType");
                break;
            }
        }