My machine apparently won't draw vertex lists in pyglet. The following code renders two identical shapes at different positions in the window, one using a vertex list and the other using a straight draw()
. The one that's drawn directly renders fine, while the vertex list doesn't render at all.
import pyglet
window = pyglet.window.Window()
w, h = window.get_size()
vl = pyglet.graphics.vertex_list( 4,
('v2i', (100,0, 100,h, 200,h, 200,0)),
('c3B', (255,255,255, 255,0,0,
0,255,0, 0,0,255)) )
@window.event
def on_draw():
window.clear()
vl.draw( pyglet.gl.GL_QUADS )
pyglet.graphics.draw( 4, pyglet.gl.GL_QUADS,
('v2i', (300,0, 300,h, 400,h, 400,0)),
('c3B', (255,255,255, 255,0,0,
0,255,0, 0,0,255)) )
pyglet.app.run()
This is pyglet 1.1.2 in Ubuntu Lucid, using an AMD Radeon HD 6450 card with the newest Catalyst 12.1 driver. I imagine it must be something to do with the drivers, etc., because this code worked three years ago on several NVIDIA cards, and it's almost direct from the pyglet documentation. Anybody know what setting I need to futz with, or if a particular driver version works right?