-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render events #18517
base: main
Are you sure you want to change the base?
Render events #18517
Conversation
The generated |
Quickly leaving my thoughts, I don't love the events naming. It has nothing to do with events about rendering, but is just an arbitrary channel for sending data back to the main world, right? Not sure what a better name is though, and again haven't looked at the PR to deeply yet. |
They are events from the render world. I think it's fair to call them render event. Presumably, users will need this to send events in the context of rendering. Otherwise they wouldn't need events sent from the render world. Maybe specify render world event just to remove any possible ambiguity, but I'm not sure what kind of ambiguity there could be. |
Objective
fix #18491 (comment)
Sometimes users want to send events from the render world to the main world. While not often advised, some advanced use-cases like readback use a similar pattern, which often requires setting up a channel and relaying events manually.
Solution
Add a simple abstraction (
App::init_render_event
) to set up the channel and relay events to the main world, retaining caller information.Note: this pr makes
Events::send_with_caller
public, but does not add a similar public method onEventWriter
Testing
Ran example