How exactly does XNA's SpriteBatch work?
- by David Gouveia
To be more precise, if I needed to recreate this functionality from scratch in another API (e.g. in OpenGL) what would it need to be capable of doing?
I do have a general idea of some of the steps, such as how it prepares an orthographic projection matrix and creates a quad for each draw call.
I'm not too familiar, however, with the batching process itself. Are all quads stored in the same vertex buffer? Does it need an index buffer? How are different textures handled?
If possible I'd be grateful if you could guide me through the process from when SpriteBatch.Begin() is called until SpriteBatch.End(), at least when using the default Deferred mode.