Example #1
0
 /// <summary>
 /// Applies the state block
 /// </summary>
 /// <param name="state">Stateblock to apply</param>
 public void Apply(StateBlock state)
 {
     AlphaTest           = state.AlphaTest;
     Blending            = state.Blending;
     ClearColor          = state.ClearColor;
     Culling             = state.Culling;
     DepthClearValue     = state.DepthClearValue;
     DepthMask           = state.DepthMask;
     DepthTest           = state.DepthTest;
     MultiSample         = state.MultiSample;
     PointSize           = state.PointSize;
     Scissor             = state.Scissor;
     StencilClearValue   = state.StencilClearValue;
     StencilFail         = state.StencilFail;
     StencilFunction     = state.StencilFunction;
     StencilMask         = state.StencilMask;
     StencilPass         = state.StencilPass;
     StencilReference    = state.StencilReference;
     StencilTest         = state.StencilTest;
     StencilWriteMask    = state.StencilWriteMask;
     TwoSidedStencilMode = state.TwoSidedStencilMode;
     LineWidth           = state.LineWidth;
     PolygonOffsetFill   = state.PolygonOffsetFill;
     PolygonOffsetLine   = state.PolygonOffsetLine;
     PolygonOffsetPoint  = state.PolygonOffsetPoint;
     ProgramPointSize    = state.ProgramPointSize;
     FrontFace           = state.FrontFace;
 }
Example #2
0
        /// <summary>
        /// Captures the current value of states that are included in a state block.
        /// </summary>
        /// <returns>State block</returns>
        public StateBlock Capture()
        {
            StateBlock state = new StateBlock();

            state.AlphaTest           = AlphaTest;
            state.Blending            = Blending;
            state.ClearColor          = ClearColor;
            state.Culling             = Culling;
            state.DepthClearValue     = DepthClearValue;
            state.DepthMask           = DepthMask;
            state.DepthTest           = DepthTest;
            state.MultiSample         = MultiSample;
            state.PointSize           = PointSize;
            state.Scissor             = Scissor;
            state.StencilClearValue   = StencilClearValue;
            state.StencilFail         = StencilFail;
            state.StencilFunction     = StencilFunction;
            state.StencilMask         = StencilMask;
            state.StencilPass         = StencilPass;
            state.StencilReference    = StencilReference;
            state.StencilTest         = StencilTest;
            state.StencilWriteMask    = StencilWriteMask;
            state.TwoSidedStencilMode = TwoSidedStencilMode;
            state.LineWidth           = LineWidth;
            state.PolygonOffsetFill   = PolygonOffsetFill;
            state.PolygonOffsetLine   = PolygonOffsetLine;
            state.PolygonOffsetPoint  = PolygonOffsetPoint;
            state.ProgramPointSize    = ProgramPointSize;
            state.FrontFace           = FrontFace;

            return(state);
        }