nightshade 0.8.0

A cross-platform data-oriented game engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Gamepad controller input state.

/// Gamepad controller state (requires `gamepad` feature).
#[cfg(feature = "gamepad")]
#[derive(Default)]
pub struct Gamepad {
    /// gilrs library instance.
    pub gilrs: Option<gilrs::Gilrs>,
    /// Currently active gamepad ID.
    pub gamepad: Option<gilrs::GamepadId>,
    /// Pending gamepad events this frame.
    pub events: Vec<gilrs::Event>,
}

/// Stub gamepad state when the `gamepad` feature is disabled.
#[cfg(not(feature = "gamepad"))]
#[derive(Default)]
pub struct Gamepad;