from pyglet.gl import *
window = pyglet.window.Window(resizable=True)
the_batch = pyglet.graphics.Batch()# batch creation
the_
batch.add_indexed(3, pyglet.gl.GL_TRIANGLES, None,
(0, 1, 2),
('v2f', (10, 10, 10, 100, 100, 10)),
('c3B', (255, 0, 0) * 3))
# ##########################
# Now I want delete all vertex list inside batch
# ##########################
the_
batch = pyglet.graphics.Batch() # batch re-creation
(empty old, create new)
the_
batch.add_indexed(3, pyglet.gl.GL_TRIANGLES, None,
(0, 1, 2),
('v2f', (10, 10, 70, 200, 200, 70)),
('c3B', (0, 255, 0) * 3))
@window.event
def on_draw():
window.clear()
the_
batch.draw()
pyglet.app.run()