On Fri, May 1, 2009 at 5:22 PM, Alex Holkner <[email protected]> wrote:

>
> On Sat, May 2, 2009 at 6:47 AM, Tristam MacDonald <[email protected]>
> wrote:
> > Is the idea behind the window.invalid flag that I set it to False when I
> > create the window, and then manually flip in my update loop?
>
> You must set window.invalid to False after the window is repainted
> (i.e., when its content is valid), and True when it needs to be
> repainted.


Roughly speaking, my application looks like this:

@window.event
def on_draw():
 window.clear()
 ...
 window.invalid = False

def update(dt):
...
 window.invalid = True

pyglet.clock.schedule_interval(update, 1/30.0)

pyglet.app.run()

However, this now updates between 2-4x the rate I have specified for
schedule_interval, and is highly variable in the presence of mouse events.
Do I also need to set window.invalid = False in all of the event handlers?

I haven't had a chance to try this on Windows - perhaps the Mac is behaving
oddly?

-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

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