载入中...
搜索中...
未找到
Pad.h
浏览该文件的文档.
One connected (or previously connected) joystick / gamepad device. Gamepad axis/button names follow S...
Definition Pad.h:13
virtual bool isGamepadDown(const std::vector< std::string > &buttons) const =0
True if any of the named gamepad buttons is pressed.
virtual bool isDown(int button) const =0
True if the raw button index is currently pressed.
virtual std::string getGamepadMappingString() const =0
Current SDL GameController mapping string for this device.
virtual bool isGamepadDown(const std::string &button) const =0
True if the named gamepad button is pressed.
virtual bool isVibrationSupported()=0
True when haptic/rumble output is available.
virtual float getAxis(int axisindex) const =0
Normalized axis value in [-1, 1] for a raw axis index.
virtual int getButtonCount() const =0
Number of raw joystick buttons.
virtual bool setVibration(float left, float right, float duration=-1.0f)=0
Starts rumble; duration < 0 means until stopped.
virtual void * getHandle() const =0
Native handle (SDL_Joystick* / implementation-defined).
virtual float getGamepadAxis(const std::string &axis) const =0
Named gamepad axis value (SDL GameController axis string).
virtual std::string getHat(int hatindex) const =0
Hat direction string for a hat index (see class brief).
virtual std::string getGUID() const =0
Stable GUID string for mapping lookup.
virtual bool open(int deviceindex)=0
Opens the device by SDL joystick device index.
virtual bool isDown(const std::vector< int > &buttons) const =0
True if any of the raw button indices is currently pressed.
virtual bool openGamepad(int deviceindex)=0
Opens the device as an SDL GameController.
virtual int getID() const =0
Engine-side stable pad id assigned at construction.
virtual std::vector< float > getAxes() const =0
Snapshot of all raw axis values.
virtual void getDeviceInfo(int &vendorID, int &productID, int &productVersion) const =0
USB/HID vendor, product, and version ids when available.
virtual std::string getName() const =0
Human-readable device name from the OS/driver.
virtual ~Pad()=default
Releases device handles; safe to call when already closed.
virtual void getVibration(float &left, float &right)=0
Reads the last requested left/right rumble strengths.
virtual bool isGamepad() const =0
True when a GameController mapping is active for this pad.
virtual bool isConnected() const =0
True while the underlying device is still connected.
virtual int getInstanceID() const =0
SDL instance id that stays unique while the device is open.
Definition Joystick.cpp:8