From bcf1e9c00e3959c3db047d2d8b3ac7d6c4853796 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 18 May 2024 17:34:13 +0200 Subject: feat(engine): add Window function to set focus callback --- engine/src/window.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engine/src/window.rs') diff --git a/engine/src/window.rs b/engine/src/window.rs index fde2cca..eed7901 100644 --- a/engine/src/window.rs +++ b/engine/src/window.rs @@ -169,6 +169,13 @@ impl Window { self.inner.set_close_callback(callback); } + + /// Sets the window's focus callback. The callback is called when the window loses or + /// gains input focus. + pub fn set_focus_callback(&self, callback: impl Fn(bool) + 'static) + { + self.inner.set_focus_callback(callback); + } } /// [`Window`] builder. -- cgit v1.2.3-18-g5258