I may have created some confusion by mixing terms without explaining.
I was mostly talking about OpenGL vertex buffers, not necessarily
pylget's classes.
A pyglet Batch is implemented in terms of an OpenGL vertex buffer, so
they should be roughly equivalent in terms of overhead and rendercalls
needed (though the Batch class does a few additional things).
Pyglet's Batch class allows to manage several separate (to the
programmer) list of vertices inside of a single OpenGL vertex buffer
object. This allows for more efficient rendering than using a seperate
vertex buffer for each list of vertices (because switching vertex
buffers is somewhat expensive). You can use pyglet's Group classes to
use e.g. different shaders while drawing one batch. Of course this
results in multiple draw calls internally, but keeps the advantage of
not switching vertex buffers. So basically, a Batch in pyglet is a
convenience class to manage multiple objects within a single OpenGL
vertex buffer.
If you want to render a single object multiple times, the best
OpenGL-way would be to use instanced rendering, but there is no pyglet
class which exposes this, you have to use the according OpenGL
functions directly.
In your example you have one Batch containing one object and you're
drawing this Batch multiple times. This does not exploit any of the
advantages of the Batch class, because for each draw call, the
underlying OpenGL vertex buffer is first bound, then rendered and
finally unbound again.
To take advantage of the Batch class, you can add the object multiple
times to the batch (at different positions), and render them using one
batch.draw() call. This way, the OpenGL vertex buffer is only bound
and unbound once (and everything is rendered in one draw call, except
if you use Groups for different shaders etc.).
If you only have one object and don't want to add it multiple times to
a Batch, then the Batch class is probably too much overhead because it
is designed to manage multiple objects in one OpenGL vertex buffer.
I hope that clears up any misconceptions I may have created. :-)
On Sun, Sep 9, 2012 at 1:21 PM, Adam Griffiths