public SpriteBatch(GraphicsDevice graphicsDevice, int maxBatchSize = 1024) { this.graphicsDevice = graphicsDevice; spriteInfoList = new SpriteInfo[maxBatchSize]; for (int i = 0; i < spriteInfoList.Length; i++) { spriteInfoList[i] = new SpriteInfo(); } spriteBatcher = new SpriteBatcher(graphicsDevice, maxBatchSize); }
public void AddSpriteInfo(SpriteInfo spriteInfo, ref int ptr) { spriteList.Add(spriteInfo); if (spriteList.Count >= maxBatchSize) { Draw(); PrepareForRendering(); ptr = 0; } }