Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
gamepad.hpp File Reference

Gamepad buttons, sticks and triggers, with no SDL type. More...

#include <aegis2d/platform/export.hpp>
#include <array>
#include <bitset>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <span>
#include <string>
#include <string_view>

Go to the source code of this file.

Classes

class  aegis2d::platform::Gamepad
 Buttons held down, and those pressed or released since the start of the frame, with the position of the sticks and triggers. More...
 

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::platform
 Window and input on top of SDL3, independent of the graphics API (client only).
 

Enumerations

enum class  aegis2d::platform::GamepadButton : std::uint8_t {
  aegis2d::platform::South , aegis2d::platform::East , aegis2d::platform::West , aegis2d::platform::North ,
  aegis2d::platform::Back , aegis2d::platform::Guide , aegis2d::platform::Start , aegis2d::platform::LeftStick ,
  aegis2d::platform::RightStick , aegis2d::platform::LeftShoulder , aegis2d::platform::RightShoulder , aegis2d::platform::DpadUp ,
  aegis2d::platform::DpadDown , aegis2d::platform::DpadLeft , aegis2d::platform::DpadRight , aegis2d::platform::LeftTrigger ,
  aegis2d::platform::RightTrigger , aegis2d::platform::LeftStickUp , aegis2d::platform::LeftStickDown , aegis2d::platform::LeftStickLeft ,
  aegis2d::platform::LeftStickRight , aegis2d::platform::RightStickUp , aegis2d::platform::RightStickDown , aegis2d::platform::RightStickLeft ,
  aegis2d::platform::RightStickRight
}
 Buttons of a gamepad, named by their position on the pad. More...
 
enum class  aegis2d::platform::GamepadAxis : std::uint8_t {
  aegis2d::platform::LeftX , aegis2d::platform::LeftY , aegis2d::platform::RightX , aegis2d::platform::RightY ,
  aegis2d::platform::LeftTrigger , aegis2d::platform::RightTrigger
}
 Analog controls of a gamepad. More...
 
enum class  aegis2d::platform::GamepadStyle : std::uint8_t { aegis2d::platform::Xbox , aegis2d::platform::PlayStation , aegis2d::platform::Nintendo }
 Family of a gamepad, which sets the labels printed on its buttons. More...
 

Functions

std::string_view aegis2d::platform::button_name (GamepadButton button) noexcept
 Stable name of a button, as written in settings files.
 
std::optional< GamepadButton > aegis2d::platform::button_from_name (std::string_view name)
 Button whose name is name, ignoring case.
 
std::string aegis2d::platform::button_label (GamepadButton button, GamepadStyle style={})
 Name of a button as printed on a pad of the given family, for a controls reminder.
 

Variables

constexpr std::size_t aegis2d::platform::gamepad_button_count
 Number of GamepadButton values.
 
constexpr std::size_t aegis2d::platform::gamepad_axis_count
 Number of GamepadAxis values.
 

Detailed Description

Gamepad buttons, sticks and triggers, with no SDL type.