示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="bs"></param>
 /// <param name="ss"></param>
 /// <param name="rs"></param>
 /// <param name="dss"></param>
 /// <param name="transform"></param>
 /// <param name="clip"></param>
 public void Restart(PipelineState ps, SamplerState ss = null, DepthStencilState dss = null, Matrix?transform = null, Rectangle?clip = null)
 {
     End();
     Begin(ps, ss, dss, transform, clip);
 }
示例#2
0
 public void Restart(SpriteBlend spriteBlend = SpriteBlend.AlphaBlend, SamplerState ss = null, DepthStencilState dss = null, Matrix?transform = null, Rectangle?clip = null)
 {
     Restart(pipelineStates[spriteBlend], ss, dss, transform, clip);
 }
示例#3
0
 public void Restart( SpriteBlend spriteBlend = SpriteBlend.AlphaBlend, SamplerState ss = null, DepthStencilState dss = null, Matrix? transform = null, Rectangle? clip = null )
 {
     Restart( pipelineStates[ spriteBlend ], ss, dss, transform, clip );
 }
示例#4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="bs"></param>
 /// <param name="ss"></param>
 /// <param name="rs"></param>
 /// <param name="dss"></param>
 /// <param name="transform"></param>
 /// <param name="clip"></param>
 public void Restart( PipelineState ps, SamplerState ss = null, DepthStencilState dss = null, Matrix? transform = null, Rectangle? clip = null )
 {
     End();
     Begin( ps, ss, dss, transform, clip );
 }
示例#5
0
        /// <summary>
        /// 
        /// </summary>
        public void Begin( PipelineState ps, SamplerState ss = null, DepthStencilState dss = null, Matrix? transform = null, Rectangle? clip = null )
        {
            if (ps==null) {
                throw new ArgumentNullException("ps");
            }

            pipelineState		=	ps;
            samplerState		=	ss	?? SamplerState.LinearWrap;
            depthStencilState	=	dss	?? DepthStencilState.Readonly;

            int	w	=	device.DisplayBounds.Width;
            int h	=	device.DisplayBounds.Height;
            var ofs	=	0.0f;

            Matrix sbTransform;
            if (transform.HasValue) {
                sbTransform = transform.Value;
            } else {
                sbTransform = Matrix.OrthoOffCenterRH(ofs, w + ofs, h + ofs, ofs, -9999, 9999);
            }

            Vector4 clipRect  = new Vector4(0,0,w,h);

            if ( clip.HasValue ) {
                clipRect.X = clip.Value.X;
                clipRect.Y = clip.Value.Y;
                clipRect.Z = clip.Value.Width;
                clipRect.W = clip.Value.Height;
            }

            device.PipelineState			=	pipelineState;
            device.PixelShaderSamplers[0]	=	samplerState;

            constData.Transform		=	sbTransform;
            constData.ClipRectangle	=	clipRect;
            constBuffer.SetData( constData );
        }