Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
Public Member Functions | Public Attributes | List of all members
GamepadInfo Struct Reference

#include <input_manager.h>

Public Member Functions

 GamepadInfo ()=default
 
 ~GamepadInfo ()
 
bool is_connected () const
 
float get_axis_value (int axis) const
 
glm::vec2 get_stick_value (int stick_index) const
 

Public Attributes

SDL_Joystick * joystick = nullptr
 
SDL_Gamepad * controller = nullptr
 
SDL_JoystickID instance_id
 
std::string name
 
bool is_controller = false
 
std::unordered_map< int, InputStatebutton_states
 
std::unordered_map< int, bool > prev_button_states
 
std::vector< float > axis_values
 
float deadzone = 0.15f
 

Constructor & Destructor Documentation

◆ GamepadInfo()

GamepadInfo::GamepadInfo ( )
default

◆ ~GamepadInfo()

GamepadInfo::~GamepadInfo ( )

Member Function Documentation

◆ get_axis_value()

float GamepadInfo::get_axis_value ( int  axis) const

◆ get_stick_value()

glm::vec2 GamepadInfo::get_stick_value ( int  stick_index) const

◆ is_connected()

bool GamepadInfo::is_connected ( ) const
inline

Member Data Documentation

◆ axis_values

std::vector<float> GamepadInfo::axis_values

◆ button_states

std::unordered_map<int, InputState> GamepadInfo::button_states

◆ controller

SDL_Gamepad* GamepadInfo::controller = nullptr

◆ deadzone

float GamepadInfo::deadzone = 0.15f

◆ instance_id

SDL_JoystickID GamepadInfo::instance_id

◆ is_controller

bool GamepadInfo::is_controller = false

◆ joystick

SDL_Joystick* GamepadInfo::joystick = nullptr

◆ name

std::string GamepadInfo::name

◆ prev_button_states

std::unordered_map<int, bool> GamepadInfo::prev_button_states

The documentation for this struct was generated from the following files: