ImagoEngine
A C++ 2D game engine built on a sparse-set ECS, with scenes, scheduled systems, events, and action-based input
Loading...
Searching...
No Matches
InputSource.hpp File Reference

Defines the raw inputs that drive an action. More...

#include <SFML/Window/Keyboard.hpp>
#include <SFML/Window/Mouse.hpp>
#include <variant>
#include <cstdint>
Include dependency graph for InputSource.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Imago::Engine::KeySource
 A keybaord key that drives an action. Reads as 0 or 1. (pressed or not pressed). More...
struct  Imago::Engine::MouseButtonSource
 A mouse button that drives an action. Reads as 0 or 1. (pressed or not pressed). More...
struct  Imago::Engine::GamepadButtonSource
 A gamepad button that drives an action. Reads as 0 or 1. (pressed or not pressed). More...
struct  Imago::Engine::GamepadAxisSource
 A gamepad axis motion that drives an action. Reads as a strength rescaled to a dead zone and scaled to a magnitude between 0-1. More...

Typedefs

using Imago::Engine::InputSource = std::variant<KeySource, MouseButtonSource, GamepadButtonSource, GamepadAxisSource>
 Any single raw input that can drive an action. Is a std::variant of all the InputSource types.

Enumerations

enum class  GamepadButton : uint8_t {
  FaceLeft , FaceRight , FaceUp , FaceDown ,
  Back , Guide , Start , LeftStick ,
  RightStick , LeftShoulder , RightShoulder , DPadLeft ,
  DPadRight , DPadUp , DPadDown , Unknown
}
enum class  GamepadAxis : uint8_t {
  LeftStickLeft , LeftStickRight , LeftStickUp , LeftStickDown ,
  RightStickLeft , RightStickRight , RightStickUp , RightStickDown ,
  LeftTrigger , RightTrigger , Unknown
}

Functions

constexpr bool Imago::Engine::operator== (const KeySource &a, const KeySource &b)
constexpr bool Imago::Engine::operator!= (const KeySource &a, const KeySource &b)
constexpr bool Imago::Engine::operator== (const MouseButtonSource &a, const MouseButtonSource &b)
constexpr bool Imago::Engine::operator!= (const MouseButtonSource &a, const MouseButtonSource &b)
constexpr bool Imago::Engine::operator== (const GamepadButtonSource &a, const GamepadButtonSource &b)
constexpr bool Imago::Engine::operator!= (const GamepadButtonSource &a, const GamepadButtonSource &b)
constexpr bool Imago::Engine::operator== (const GamepadAxisSource &a, const GamepadAxisSource &b)
constexpr bool Imago::Engine::operator!= (const GamepadAxisSource &a, const GamepadAxisSource &b)

Detailed Description

Defines the raw inputs that drive an action.

Author
Shane David