public SpriteBatch(GraphicsDevice graphicsDevice) { if (graphicsDevice == null) { throw new ArgumentException ("graphicsDevice"); } this.graphicsDevice = graphicsDevice; spriteEffect = new SpriteEffect (this.graphicsDevice); _batcher = new SpriteBatcher (); }
public SpriteBatch(GraphicsDevice graphicsDevice) { if (graphicsDevice == null) { throw new ArgumentException("graphicsDevice"); } this.graphicsDevice = graphicsDevice; spriteEffect = new SpriteEffect(this.graphicsDevice); _batcher = new SpriteBatcher(); }
/// <summary> /// Immediately releases the unmanaged resources used by this object. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected override void Dispose(bool disposing) { if (!IsDisposed) { if (disposing) { if (_spriteEffect != null) { _spriteEffect.Dispose(); _spriteEffect = null; } } } base.Dispose(disposing); }
/// <summary> /// Constructs a <see cref="SpriteBatch"/>. /// </summary> /// <param name="graphicsDevice">The <see cref="GraphicsDevice"/>, which will be used for sprite rendering.</param> /// <param name="capacity">The initial capacity of the internal array holding batch items (the value will be rounded to the next multiple of 64).</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="graphicsDevice"/> is null.</exception> public SpriteBatch(GraphicsDevice graphicsDevice, int capacity) { if (graphicsDevice == null) { throw new ArgumentNullException("graphicsDevice", FrameworkResources.ResourceCreationWhenDeviceIsNull); } this.GraphicsDevice = graphicsDevice; _spriteEffect = new SpriteEffect(graphicsDevice); _spritePass = _spriteEffect.CurrentTechnique.Passes[0]; _batcher = new SpriteBatcher(graphicsDevice, capacity); _beginCalled = false; }
/// <summary> /// Creates a new SpriteEffect by cloning parameter settings from an existing instance. /// </summary> protected SpriteEffect(SpriteEffect cloneSource) : base(cloneSource) { CacheEffectParameters(); }
protected SpriteEffect(SpriteEffect cloneSource) : base((Effect) cloneSource) { this.CacheEffectParameters(); }
/// <summary> /// Creates a new SpriteEffect by cloning parameter settings from an existing instance. /// </summary> protected SpriteEffect(SpriteEffect cloneSource) : base(cloneSource) { CacheEffectParameters(); }
protected SpriteEffect(SpriteEffect cloneSource) : base((Effect)cloneSource) { this.CacheEffectParameters(); }