The Reset
method confgures the drawing routine for the specific render target and tarnsform. The DrawQuad
call will batch a sprite as long as the texture doesn't change. Once a DrawQuad
call is made where there is a new texture, the End
method is called which dumps the current buffer into the engine draw to get data on the screen and then the buffer pointer is reset to 0.
If the buffer is set for 1000 verticies, which gives you 250 sprite draws. However, there is an internal limit set at 800 (200 sprites) that once the batcher hits this, the buffer is resized by a small percentage and the internal limit raised. This ensures you never reach the limit of sprites and it grows as much as needed. The sprite draws just mentioned are only for batching. You have 200 batch draws of the same texture until it starts growing. Remember, as soon as you change sprite texture, the batcher restarts.
This code was written for SadConsole; I tried to clean this up as much as possible to make it generic. Hope it helps.