How exactly does XNA's SpriteBatch work?

Posted by David Gouveia on Game Development See other posts from Game Development or by David Gouveia
Published on 2011-12-17T13:23:36Z Indexed on 2012/09/04 21:52 UTC
Read the original article Hit count: 307

Filed under:
|

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.

© Game Development or respective owner

Related posts about XNA

Related posts about spritebatch