mayasky
mayasky

Reputation: 1035

How to keep pyglet from clearing the screen?

I want to draw a scene and sequentially add lines to it. But pyglet keeps updating without control :( , so all I get is blinks

from pyglet.gl import *

window=pyglet.window.Window()

def drawline():
    ...

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

pyglet.app.run()

should I change the decorator(if there exist options) or what? Thanks!

Upvotes: 2

Views: 472

Answers (1)

R Hyde
R Hyde

Reputation: 10409

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.

Upvotes: 2

Related Questions