On Sat, May 2, 2009 at 9:07 PM, Tristam MacDonald <[email protected]> wrote:
> 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?

No, but IIRC there is no need to set invalid = False in the scheduled
clock function, as this happens always.  Perhaps you have some other
scheduled events that you didn't intend to repaint the window? (If so,
then you can consider this a feature limitation or bug in pyglet).

Alex.

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