Move input_manager and camera as resource
This commit is contained in:
parent
6ba61e040e
commit
07056fc0ce
5 changed files with 72 additions and 68 deletions
|
@ -141,18 +141,6 @@ impl WindowContext {
|
|||
f(&mut gui)
|
||||
}
|
||||
|
||||
/// Méthode utilitaire pour accéder à l'input manager de manière thread-safe
|
||||
pub fn with_input_manager<T, F>(&self, f: F) -> T
|
||||
where
|
||||
F: FnOnce(&InputManager) -> T,
|
||||
{
|
||||
let input_manager = self
|
||||
.input_manager
|
||||
.read()
|
||||
.expect("Failed to lock input_manager");
|
||||
f(&input_manager)
|
||||
}
|
||||
|
||||
/// Méthode utilitaire pour accéder au timer de manière thread-safe
|
||||
pub fn with_timer<T, F>(&self, f: F) -> T
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue