public GdxSpriteBatch(GraphicsDevice graphicsDevice)
{
if (graphicsDevice == null)
throw new ArgumentNullException("graphicsDevice");
_device = graphicsDevice;
_spriteEffect = new LocalSpriteEffect(graphicsDevice);
_matrixTransform = _spriteEffect.Parameters["MatrixTransform"];
_spritePass = _spriteEffect.CurrentTechnique.Passes[0];
_transformMatrix = Matrix.Identity;
//_projectionMatrix = Matrix.CreateOrthographicOffCenter(0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height, 0, 0, 1);
_projectionMatrix = XnaExt.Matrix.CreateOrthographic2D(0, 0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height, -1, 0);
Color = Color.White;
CalculateIndexBuffer();
_rasterizerScissorState = new RasterizerState() {
CullMode = CullMode.None,
ScissorTestEnable = true,
};
// projection uses CreateOrthographicOffCenter to create 2d projection
// matrix with 0,0 in the upper left.
/*_basicEffect.Projection = Matrix.CreateOrthographicOffCenter
(0, graphicsDevice.Viewport.Width,
graphicsDevice.Viewport.Height, 0,
0, 1);
this._basicEffect.World = Matrix.Identity;
this._basicEffect.View = Matrix.CreateLookAt(Vector3.Zero, Vector3.Forward,
Vector3.Up);*/
}