nannou
nannou copied to clipboard
Pass window id to event functions
This allows the event
and raw_event
handler functions to access the id of the window the event is being fired on.
This is useful for supporting multiple windows and being able to handle their events separately. Unless I'm missing something I don't think there is any other way to do this.
Event handlers would look like:
fn raw_window_event(app: &App, model: &mut Model, event: &ui::RawWindowEvent, id: WindowId) {
...
}
fn window_event(app: &App, model: &mut Model, event: &ui::RawWindowEvent, id: WindowId) {
...
}
These ids can be used to index into a hash map that contains specific window information.