The problem is that it's rendering black shapes onto a black
background. Put 'glClearColor(0.5, 0.5, 0.5, 1.0)' before your clear
call and you'll see what is happening. It's often a good idea to use a
non-black clear colour for debugging!
What I don't understand is why pyglet is neither using the supplied
colour values or raising some sort of error. This smaller example
demonstrates the same problem.
#!/usr/bin/python
import pyglet
import pyglet.graphics
from pyglet.gl import *
class myWindow(pyglet.window.Window):
def on_draw(self):
glClearColor(0.5, 0.5, 0.5, 1.0)
self.clear()
verts = (0, 0, 100, 0, 100, 100)
cols = (255, 255, 255, 255, 255, 255, 255, 255, 255)
vertex_list = pyglet.graphics.vertex_list(3,
('v2i', verts),
('c3i', cols) )
vertex_list.draw(pyglet.gl.GL_TRIANGLES)
win = myWindow()
pyglet.app.run()
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---