Packing Sprites into a Texture Atlas in MonoGame

While building Vulcard for the Game Programming Lab at ETH Zurich, we accumulated dozens of individual sprite PNGs for icons and UI elements. Loading each as a separate texture works fine early on. It&rsquo;s not how you want to ship, though. Every SpriteBatch.Draw call that switches textures flushes the GPU batch, and 60 sprites can easily mean 60 separate draw calls per frame. The fix is a…