コード例 #1
0
ファイル: Renderer.cs プロジェクト: Vengarioth/XUI
        public void AddBatch(SpriteBatch spriteBatch)
        {
            if (spriteBatchBufferList.ContainsKey(spriteBatch))
                throw new Exception("Batch already present!");

            spriteBatchBufferGenerator.Clear();
            foreach (var operation in spriteBatch.GetOperations())
            {
                spriteBatchBufferGenerator.AddRectangle(operation.SourceX, operation.SourceY, operation.SourceWidth, operation.SourceHeight,
                    operation.TargetX, operation.TargetY, operation.TargetWidth, operation.TargetHeight);
            }

            var spriteBatchBuffer = spriteBatchBufferGenerator.GetBuffer();
            spriteBatchBufferList.Add(spriteBatch, spriteBatchBuffer);
        }