7std::array<asw::input::ControllerState, asw::input::MAX_CONTROLLERS>
16 k_state.anyPressed =
false;
17 k_state.lastPressed = -1;
19 for (
auto& pressed : k_state.pressed) {
23 for (
auto& released : k_state.released) {
28 m_state.anyPressed =
false;
33 for (
auto& pressed : m_state.pressed) {
37 for (
auto& released : m_state.released) {
42 for (
auto& cont : c_state) {
43 cont.anyPressed =
false;
44 cont.lastPressed = -1;
46 for (
auto& button : cont.pressed) {
50 for (
auto& button : cont.released) {
57 return mouse.down[
static_cast<int>(button)];
61 return mouse.pressed[
static_cast<int>(button)];
65 return mouse.released[
static_cast<int>(button)];
69 return keyboard.down[
static_cast<int>(key)];
73 return keyboard.pressed[
static_cast<int>(key)];
77 return keyboard.released[
static_cast<int>(key)];
81 auto cursor_int =
static_cast<unsigned int>(cursor);
83 if (cursor_int < 0 || cursor_int >= cursors.size()) {
87 if (cursors[cursor_int] ==
nullptr) {
89 SDL_CreateSystemCursor(
static_cast<SDL_SystemCursor
>(cursor_int));
92 SDL_SetCursor(cursors[cursor_int]);
97 return controller[index].down[
static_cast<int>(button)];
103 return controller[index].pressed[
static_cast<int>(button)];
109 return controller[index].released[
static_cast<int>(button)];
114 return controller[index].axis[
static_cast<int>(axis)];
122 int* count =
nullptr;
123 SDL_GetJoysticks(count);
124 if (count ==
nullptr) {
132 return SDL_GetJoystickNameForID(index);