1
0
Fork 0
forked from wry/wry

metal: emulate vblank events on the nvidia driver

This commit is contained in:
Julian Orth 2024-10-03 08:54:15 +02:00
parent d2b6831ce4
commit ed65fa07a4
7 changed files with 41 additions and 4 deletions

View file

@ -30,6 +30,14 @@ impl<T: ?Sized> EventSource<T> {
iter: self.listeners.iter(),
}
}
pub fn has_listeners(&self) -> bool {
self.listeners.is_not_empty()
}
pub fn on_attach(&self, f: Box<dyn FnOnce()>) {
self.on_attach.set(Some(f));
}
}
pub struct EventSourceIter<T: ?Sized> {