For what it's worth, I second the idea for using something like set_frame_rate() to initiate a fixed rate of window updating. I know it is possible to manually do this at the moment, either by overriding the EventLoop.idle() or using window.invalid=False, but I think neither method is particularly clear to people new to Pyglet.
The use of window.invalid=False is still very confusing to me, being a double-negative - I think this could be a lot clearer for the particular purpose of handling window updates manually. Perhaps another property could be exposed that would make it easy for users to stop the window being updated in idle(), something like window.manual_draw. If true, the window is not drawn to automatically. This property could be simply the opposite of whatever window.invalid is set to, but its purpose is clearer to the end-user. Padraig On 3 May 2009, at 08:35, Greg Ewing wrote: > > Alex Holkner wrote: > >> This is the easiest development model for an application/game >> developer (it avoids bugs in which the developer forgets to >> invalidate >> the window). > > Seems to me there are two quite different ways of handling > window refresh depending on the style of game: > > 1) There are no regularly sheduled updates; all changes > in game state are driven by user input. In that case it > makes sense to refresh the window every time an input > event occurs. > > 2) Updates occur at a fixed rate driven by a clock. In > that case, there is no need to refresh the window as soon > as an input event occurs, because it will get refreshed > on the next clock tick. > > It sounds like Pyglet is mixing up these two models, or > at least making it easy for the programmer to confuse > them. > > Perhaps there should be something explicit in the API > for choosing between these two models, e.g. a > set_frame_rate() call that simultaneously turns on > regular update events and turns off automatic refreshing > on every event. > > -- > Greg > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
