Microsoft.Xna.Framework.Graphics.SpriteBatch.SpriteBatch C# (CSharp) Method

SpriteBatch() public method

Constructs a SpriteBatch.
Thrown when is null.
public SpriteBatch ( Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice ) : System
graphicsDevice Microsoft.Xna.Framework.Graphics.GraphicsDevice The , which will be used for sprite rendering.
return System
        public SpriteBatch (GraphicsDevice graphicsDevice)
		{
			if (graphicsDevice == null)
            {
				throw new ArgumentNullException ("graphicsDevice", FrameworkResources.ResourceCreationWhenDeviceIsNull);
			}	

			this.GraphicsDevice = graphicsDevice;

            // Use a custom SpriteEffect so we can control the transformation matrix
            _spriteEffect = new Effect(graphicsDevice, SpriteEffect.Bytecode);
            _matrixTransform = _spriteEffect.Parameters["MatrixTransform"];
            _spritePass = _spriteEffect.CurrentTechnique.Passes[0];

            _batcher = new SpriteBatcher(graphicsDevice);

            _beginCalled = false;
		}