This was changed in 2.0, on request, due to confusion about events being tied to the draw. They wanted constant FPS regardless of what events were taking place without having to schedule an update.
On Tuesday, April 18, 2023 at 8:00:06 AM UTC-5 Matan wrote: > Hi, > > Just wondering why does pyglet keep calling `on_draw` even when no updates > are made in user code (even when no user `on_update` callback is > registered) and no keyboard, mouse events are happening nor any desktop > events such as windows moving on top the pyglet window or anything. > > When the desktop is idle of any user interaction or windows moving, > `on_draw` is called continuously. > > Is that expected behavior? > > I was under impression that `on_draw` is called only when there is a > reason to redraw, and if we assumed that all updates affecting a draw occur > either on the user `on_update` callback or due to desktop events .... > > I was just going to implement something akin to a video player where I > would control the intervals by always scheduling the next update according > to the time of the next "frame" at a variable rate when I bumped into this > behavior when stripping away my update callback. > > Made me think about its frequency in general. > > This is on Ubuntu. > > Thanks for your comment, > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/pyglet-users/50e519dc-d8ac-4a70-818a-02949fba2e35n%40googlegroups.com.