Begin() public method

public Begin ( ) : void
return void
Ejemplo n.º 1
0
        private void BeginSpriteBatch(RenderStateVariables renderStates, Layer layer, BeginType beginType)
        {
            Matrix matrix = GetZoomAndMatrix(layer);

            SamplerState samplerState = GetSamplerState(renderStates);

            RasterizerState rasterizerState = GetRasterizerState(renderStates, layer);


            Rectangle scissorRectangle = new Rectangle();

            if (rasterizerState.ScissorTestEnable)
            {
                scissorRectangle = layer.GetScissorRectangleFor(mCamera);
            }


            DepthStencilState depthStencilState = DepthStencilState.DepthRead;

            if (beginType == BeginType.Begin)
            {
                mSpriteBatch.Begin(SpriteSortMode.Immediate, renderStates.BlendState,
                                   samplerState,
                                   depthStencilState,
                                   rasterizerState,
                                   null, matrix,
                                   scissorRectangle);
            }
            else
            {
                mSpriteBatch.Push(SpriteSortMode.Immediate, renderStates.BlendState,
                                  samplerState,
                                  depthStencilState,
                                  rasterizerState,
                                  null, matrix,
                                  scissorRectangle);
            }
            mDrawCallsPerFrame++;
        }
Ejemplo n.º 2
0
 public void Begin()
 {
     mSpriteBatch.Begin();
 }