 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
25 #ifndef RAYLIB_CPP_INCLUDE_GAMEPAD_HPP_
26 #define RAYLIB_CPP_INCLUDE_GAMEPAD_HPP_
30 #include "./raylib.hpp"
31 #include "./raylib-cpp-utils.hpp"
53 operator int()
const {
return number; }
59 return ::IsGamepadAvailable(
number);
66 return ::IsGamepadAvailable(
number);
72 inline bool IsName(
const std::string& name)
const {
73 return ::IsGamepadName(
number, name.c_str());
80 return ::GetGamepadName(
number);
86 operator std::string()
const {
94 return ::IsGamepadButtonPressed(
number, button);
101 return ::IsGamepadButtonDown(
number, button);
108 return ::IsGamepadButtonReleased(
number, button);
115 return ::IsGamepadButtonUp(
number, button);
122 return ::GetGamepadButtonPressed();
129 return ::GetGamepadAxisCount(
number);
136 return ::GetGamepadAxisMovement(
number, axis);
140 inline void set(
int gamepadNumber) {
146 #endif // RAYLIB_CPP_INCLUDE_GAMEPAD_HPP_
Provides all the classes associated with raylib-cpp.
float GetAxisMovement(int axis) const
Return axis movement value for a gamepad axis.
bool IsButtonReleased(int button) const
Detect if a gamepad button has been released once.
Gamepad(int gamepadNumber=0)
bool IsButtonUp(int button) const
Detect if a gamepad button is NOT being pressed.
void set(int gamepadNumber)
std::string GetName() const
Return gamepad internal name id.
bool IsButtonPressed(int button) const
Detect if a gamepad button has been pressed once.
Gamepad & operator=(int gamepadNumber)
bool IsButtonDown(int button) const
Detect if a gamepad button is being pressed.
int GetButtonPressed() const
Get the last gamepad button pressed.
bool IsAvailable() const
Detect if a gamepad is available.
bool IsName(const std::string &name) const
Check gamepad name (if available)
int GetAxisCount() const
Return gamepad axis count for a gamepad.
static bool IsAvailable(int number)
Detect if a gamepad is available.