As far as I know, pyglet loop is event based, so it will only call draw
when window is considered dirty.
I suggest making your own render loop, if you want performance over cpu
usage (which you want for games for instance).


2012/12/22 Ricky Christie <[email protected]>

> So I was trying out pyglet1.2alpha in my Snow Leopard.
> Either the pyglet.clock.tick() method doesn't get called periodically or
> the draw method doesn't.
> I wrote a code that should display incrementing number on each draw. It
> does increment but only after a long while.
>
> import pyglet
>
> class TestTick(object):
>     def start(self):
>         self.x = 1
>         window = pyglet.window.Window()
>
>         @window.event
>         def on_draw():
>             window.clear()
>             self.x += 1
>             label = pyglet.text.Label('Hello, world ' + str(self.x))
>             label.draw()
>             print('draw called')
>
>         pyglet.app.run()
>
> test = TestTick()
> test.start()
>
> Am I using it wrong here?
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pyglet-users/-/w0NpkVNdZe0J.
> 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.
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk

-- 
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.

Reply via email to