2

我想画一个场景并依次添加线条。但是 pyglet 在不受控制的情况下不断更新 :( ,所以我得到的只是眨眼

from pyglet.gl import *

window=pyglet.window.Window()

def drawline():
    ...

@window.event
def on_draw():
    drawline()

pyglet.app.run()

我应该更改装饰器(如果存在选项)还是什么?谢谢!

4

1 回答 1

2

You'll need to draw your lines each time the window is redrawn as they won't be retained. You're probably better off using batches of vertex lists and adding to them. See here and here for details.

于 2009-11-14T18:48:53.550 回答