Skip to content

Commit

Permalink
error on gamepad creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikaël Fourrier committed Aug 21, 2021
1 parent 3dfb529 commit 19c6b3b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ impl Engine {
gyro: Gyro::new(&settings, calibration),
settings,
#[cfg(feature = "vgamepad")]
// TODO: Conditional virtual gamepad creation
// Only create if option is enabled
gamepad: virtual_gamepad::new(virtual_gamepad::GamepadType::DS4)
.map(|vg| -> Box<dyn virtual_gamepad::Backend> { Box::new(vg) })
.map_err(|e| {
eprintln!("Error initializing the virtual gamepad: {}", e);
e
})
.ok(),
})
}
Expand Down

0 comments on commit 19c6b3b

Please sign in to comment.