summaryrefslogtreecommitdiff
path: root/engine/src/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/window.rs')
-rw-r--r--engine/src/window.rs7
1 files changed, 7 insertions, 0 deletions
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.