ImmutableOctet / glare

Glare: Open Source Game Engine written in Modern C++
MIT License
0 stars 0 forks source link

Implement exhaustive event handling for Fiber/Script-based Entity Threads #83

Closed ImmutableOctet closed 1 month ago

ImmutableOctet commented 1 month ago

Our current approach for event handling is to capture a single eligible event object in one pass, then handle the event in a once-per-frame 'step' of the Entity Thread. -- Instead, we should provide the ability to handle multiple events in a single frame, updating scripts as events are dequeued, rather than deferring the work.

Threads using this exhaustive approach could then use

co_await next_frame;

or similar, if this exhaustive capturing behavior was not intended. -- e.g. to prevent handling multiple input events on a single frame.

ImmutableOctet commented 1 month ago

Implemented initial support for this. We'll need to revisit this when script coroutines become scheduled, rather than executing on the main thread.