Hello,
I draw some quads on to the screen with pyglet.graphics.draw, and each
frame I change the color slightly to make it look as though they are
'fading in'. However, while this is happening, pyglet is only
rendering at about 4 FPS, causing it to look . It will render faster
if I wiggle my mouse around in the window, which makes me think that
it's a performance optimization. Is there any way I can get around
this?
This program replicates the problem:
import pyglet
import threading
window = pyglet.window.Window()
fps = pyglet.clock.ClockDisplay()
color = (0, 0, 0)
def fade_in():
global color
c = 0
while c < 250:
color = (c, c, c)
c += 10
threading.Event().wait(0.1)
def on_draw():
global color
window.clear()
pyglet.graphics.draw(4, pyglet.gl.GL_QUADS,
('v2i', (0, 0,
100, 0,
100, 100,
0, 100)),
('c3B', color * 4))
fps.draw()
window.on_draw = on_draw
threading.Thread(target = fade_in).start()
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.