-
-
Notifications
You must be signed in to change notification settings - Fork 50
Description
@Korijn mentioned in a comment in a pygfx, that game engines usually run a tight loops with the following steps:
- Query input device state (joysticks, buttons, mice, etc)
- Update world state
- Render frame
That got me thinking. Right now, when a mouse event happens, this causes certain state to be changed. If two (or more) such events happen in between two draws, the state is updated twice, but we only see the final state.
We already do some event throttling to reduce this, but we could also aggregate the events and only dispatch them right before doing the draw, which could potentially result in more performance because it avoids calculating stuff that is never shown anyway.
One problem with this is that right now, if nothing changes, there are also no new draws, which is nice to avoid depleting your battery, and safes network traffic when using the notebook. We'd have to dispatch the events on a regular interval. I'm not sure what happens if we ask the GUI to schedule a draw and then not draw it.
Any other caveats?