 |
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);
63 return ::IsGamepadAvailable(
number);
69 inline bool IsName(
const std::string& name)
const {
70 return ::IsGamepadName(
number, name.c_str());
77 return ::GetGamepadName(
number);
83 operator std::string()
const {
91 return ::IsGamepadButtonPressed(
number, button);
98 return ::IsGamepadButtonDown(
number, button);
105 return ::IsGamepadButtonReleased(
number, button);
112 return ::IsGamepadButtonUp(
number, button);
119 return ::GetGamepadButtonPressed();
126 return ::GetGamepadAxisCount(
number);
133 return ::GetGamepadAxisMovement(
number, axis);
137 inline void set(
int gamepadNumber) {
143 #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)