Replies: 2 comments 2 replies
-
Can you provide more details about this? I don't follow. I might be missing the requisite knowledge to understand the question. All the reactive mode does is tell winit to wait until an event is received before running the next frame. If event(s) have been received since the last frame was started, the loop will run immediately and report the list of events received since last time. If I understand what you are requesting, you probably want to run your app in continuous mode, and block the main thread with spin_sleep if needed. You can put this system in the CoreStage::First stage to make sure it runs first. Alternatively, you can define your own runner if you need even more control: https://github.com/bevyengine/bevy/blob/main/examples/app/custom_loop.rs |
Beta Was this translation helpful? Give feedback.
-
More specific description of my requirement: From https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues
I'm using the fact that the return timing of |
Beta Was this translation helpful? Give feedback.
-
Specifically, on Windows there is
PeekMessage()
andGetMessage()
.I am relying on using the latter to obtain precise timestamps of when the OS unblocks the function by making a QueryPerformanceCounter call as the very first thing that the message loop does upon returning.
Pretty much the majority of game engine or frameworks like SDL2 provides a "fake" wait_message equivalent, where they simply use the polling counterpart instead with a cooldown, purely for the purpose of "saving power".
For my purpose, however, I need the blocking behaviour not to save power but to characterize precise timestamps. Does Bevy's reactive update mode use the "real" message fetcher? If so, how may I be able to insert the timestamping action as the very first thing it does after returning? I would like to have the events dispatched by Bevy to have these accurate timestamps available.
They need to be implement in the message loop directly, otherwise the whole purpose is lost if I simply add in a timestamper after it has already been processed and forwarded by Bevy
On an entirely unrelated note, I would also like to have the
GetMessagePos()
information available for my incoming messages forwarded by Bevy. Also the mouse motion events seems to only include the deltaX/Y data, there don't seem to be any way to query the device handle that sent those individual raw device reports?Beta Was this translation helpful? Give feedback.
All reactions