sfml_impl 0.1.0
Vendor SFML 3.0.2 : IGraphic2Module / IAudioModule
Loading...
Searching...
No Matches
SfmlGamepad Class Reference

Unlike raylib's GamepadButton (normalized Xbox-style layout), sf::Joystick exposes raw numbered buttons/axes with no guaranteed meaning across controllers/platforms. This uses the common Xbox- style button ordering (0=A,1=B,2=X,3=Y) most drivers report, but it isn't guaranteed the way raylib's mapping is. More...

#include <SfmlGamepad.hpp>

Inheritance diagram for SfmlGamepad:
Collaboration diagram for SfmlGamepad:

Public Member Functions

 SfmlGamepad (const SfmlWindow &window, unsigned int index=0)
 
 ~SfmlGamepad () override=default
 
bool isAvailable () const override
 
bool isButtonPressed (Button button) const override
 
bool isButtonReleased (Button button) const override
 
bool isButtonDown (Button button) const override
 
bool isButtonUp (Button button) const override
 
float getAxisMovement (Axis axis) const override
 

Detailed Description

Unlike raylib's GamepadButton (normalized Xbox-style layout), sf::Joystick exposes raw numbered buttons/axes with no guaranteed meaning across controllers/platforms. This uses the common Xbox- style button ordering (0=A,1=B,2=X,3=Y) most drivers report, but it isn't guaranteed the way raylib's mapping is.

Axes are reported as a percentage in [-100, 100] : divided by 100 to yield the contract's [-1, 1], with no dead zone - a dead zone is a gameplay choice and belongs to the game.

Constructor & Destructor Documentation

◆ SfmlGamepad()

SfmlGamepad::SfmlGamepad ( const SfmlWindow window,
unsigned int  index = 0 
)
inline

◆ ~SfmlGamepad()

SfmlGamepad::~SfmlGamepad ( )
overridedefault

Member Function Documentation

◆ getAxisMovement()

float SfmlGamepad::getAxisMovement ( Axis  axis) const
inlineoverride

◆ isAvailable()

bool SfmlGamepad::isAvailable ( ) const
inlineoverride

The documentation for this class was generated from the following files: