|
ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
|
Typedefs | |
| using | ControllerState |
| Data structure for controller state, including button states and axis values. | |
Functions | |
| float | rescale_dead_zone (float magnitude, float dead_zone) |
| Rescale a value past the dead zone so it starts from zero. | |
| asw::Vec2< float > | read_stick (const ControllerState &cont, asw::input::ControllerStick stick) |
| Read a stick with a radial dead zone. | |
| float | read_axis (const ControllerState &cont, asw::input::ControllerAxis axis) |
| Read one axis with the dead zone applied. | |
| template<typename Pred > | |
| bool | any_controller (uint32_t index, Pred pred) |
| Check a button on one controller, or on any when index is ANY_CONTROLLER. | |
| template<typename Action > | |
| bool | each_controller (uint32_t index, Action action) |
| Run an action on one controller, or on all when index is ANY_CONTROLLER. | |
| uint16_t | to_motor_intensity (float intensity) |
| Convert an intensity between 0 and 1 to SDL's motor range. | |
| bool | has_capability (const ControllerState &cont, const char *property) |
| Read a boolean capability from a controller's properties. | |
| std::string | pad_identity (SDL_JoystickID id, SDL_Gamepad *pad) |
| What tells a pad apart when it is plugged back in: its serial number, or its model when it has none. Two pads of one model with no serial look the same. | |
| bool | slot_empty (std::size_t index) |
| std::size_t | pick_slot (const std::string &identity) |
| Pick the slot for a pad that just connected. | |
| SDL_WindowID | simulated_window_id () |
| void | push_simulated_key (asw::input::Key key, bool down) |
| void | push_simulated_mouse_button (asw::input::MouseButton button, bool down) |
Variables | |
| std::array< SDL_Cursor *, asw::input::NUM_CURSORS > | cursors { nullptr } |
| Active cursor stores the current active cursor. It is updated by the core. | |
| std::vector< ControllerState > | controller { } |
| Global controller state. A slot stays at its index while its pad is unplugged, and the pad gets it back when plugged in again, so bindings keep reading the same physical pad. | |
| std::vector< std::string > | slot_owner { } |
| The pad each slot last held, by pad_identity(). Kept after the pad is unplugged and after its slot is dropped from the end of controller, so the pad can get its slot back. | |
| float | default_dead_zone { 0.25F } |
| Dead zone given to pads when they connect. | |
| std::unordered_map< SDL_JoystickID, uint32_t > | controller_id_map { } |
| Map of SDL_JoystickID to controller index in the controller vector. | |
| asw::input::KeyState | keyboard { } |
| asw::input::MouseState | mouse { } |
| std::string | text_input |
| asw::input::InputDevice | last_device { asw::input::InputDevice::KeyboardMouse } |
| using anonymous_namespace{input.cpp}::ControllerState |
Data structure for controller state, including button states and axis values.
| bool anonymous_namespace{input.cpp}::any_controller | ( | uint32_t | index, |
| Pred | pred ) |
| bool anonymous_namespace{input.cpp}::each_controller | ( | uint32_t | index, |
| Action | action ) |
| bool anonymous_namespace{input.cpp}::has_capability | ( | const ControllerState & | cont, |
| const char * | property ) |
| std::string anonymous_namespace{input.cpp}::pad_identity | ( | SDL_JoystickID | id, |
| SDL_Gamepad * | pad ) |
| std::size_t anonymous_namespace{input.cpp}::pick_slot | ( | const std::string & | identity | ) |
| void anonymous_namespace{input.cpp}::push_simulated_key | ( | asw::input::Key | key, |
| bool | down ) |
| void anonymous_namespace{input.cpp}::push_simulated_mouse_button | ( | asw::input::MouseButton | button, |
| bool | down ) |
| float anonymous_namespace{input.cpp}::read_axis | ( | const ControllerState & | cont, |
| asw::input::ControllerAxis | axis ) |
| asw::Vec2< float > anonymous_namespace{input.cpp}::read_stick | ( | const ControllerState & | cont, |
| asw::input::ControllerStick | stick ) |
| float anonymous_namespace{input.cpp}::rescale_dead_zone | ( | float | magnitude, |
| float | dead_zone ) |
| SDL_WindowID anonymous_namespace{input.cpp}::simulated_window_id | ( | ) |
| bool anonymous_namespace{input.cpp}::slot_empty | ( | std::size_t | index | ) |
| uint16_t anonymous_namespace{input.cpp}::to_motor_intensity | ( | float | intensity | ) |
| std::vector<ControllerState> anonymous_namespace{input.cpp}::controller { } |
| std::unordered_map<SDL_JoystickID, uint32_t> anonymous_namespace{input.cpp}::controller_id_map { } |
| std::array<SDL_Cursor*, asw::input::NUM_CURSORS> anonymous_namespace{input.cpp}::cursors { nullptr } |
| float anonymous_namespace{input.cpp}::default_dead_zone { 0.25F } |
| asw::input::KeyState anonymous_namespace{input.cpp}::keyboard { } |
| asw::input::InputDevice anonymous_namespace{input.cpp}::last_device { asw::input::InputDevice::KeyboardMouse } |
| asw::input::MouseState anonymous_namespace{input.cpp}::mouse { } |
| std::vector<std::string> anonymous_namespace{input.cpp}::slot_owner { } |
The pad each slot last held, by pad_identity(). Kept after the pad is unplugged and after its slot is dropped from the end of controller, so the pad can get its slot back.