I've been trying to make a small test case for glMultiDrawElements and
I think I have something:

import pyglet
from pyglet.gl import *

w = pyglet.window.Window(400, 400)
b = pyglet.graphics.Batch()

vdata = ('v2f', [10, 10, 390, 10, 390, 390, 10, 390, 200, 200])
cdata1 = ('c4B', [255, 0, 0, 0] * 5)
cdata2 = ('c4B', [0, 255, 0, 0] * 5)
cdata3 = ('c4B', [0, 0, 255, 0] * 5)

b.add_indexed(5, GL_TRIANGLES, None, (0, 1, 2), vdata, cdata1)
vl = b.add_indexed(5, GL_TRIANGLES, None, (0, 4, 3), vdata, cdata2)
b.add_indexed(5, GL_TRIANGLES, None, (4, 2, 3), vdata, cdata3)
vl.delete()

@w.event
def on_draw():
    w.clear()
    b.draw()

pyglet.app.run()

Without the vl.delete() it draws three triangles as expected, with it
we only see the red triangle. This was on an early '09 MacBook and the
latest 1.1 maintenance. Can anyone confirm this on other hardware?

Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to