Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void AddSpriteInfo(SpriteInfo spriteInfo, ref int ptr)
        {
            spriteList.Add(spriteInfo);

            if (spriteList.Count >= maxBatchSize)
            {
                Draw();
                PrepareForRendering();
                ptr = 0;
            }
        }