P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
SdlGamepad Class Reference

La manette numero _index, ouverte a la construction. More...

#include <SdlGamepad.hpp>

Inheritance diagram for SdlGamepad:
Collaboration diagram for SdlGamepad:

Public Member Functions

 SdlGamepad (const SdlWindow &window, int index=0)
 ~SdlGamepad () override
bool isAvailable () const override
 notice if a gamepad is actually plugged in
bool isButtonPressed (Button button) const override
 notice if the button is pressed
bool isButtonReleased (Button button) const override
 notice if the button is released
bool isButtonDown (Button button) const override
 notice if the button is down
bool isButtonUp (Button button) const override
 notice if the button is up
float getAxisMovement (Axis axis) const override
 the movement of an axis, in [-1, 1]
 SdlGamepad (const SdlWindow &window, int index=0)
 ~SdlGamepad () override
bool isAvailable () const override
 notice if a gamepad is actually plugged in
bool isButtonPressed (Button button) const override
 notice if the button is pressed
bool isButtonReleased (Button button) const override
 notice if the button is released
bool isButtonDown (Button button) const override
 notice if the button is down
bool isButtonUp (Button button) const override
 notice if the button is up
float getAxisMovement (Axis axis) const override
 the movement of an axis, in [-1, 1]
Public Member Functions inherited from graphic::IGamepad
virtual ~IGamepad ()=default
 Destroy the IGamepad object.

Friends

class SdlWindow

Additional Inherited Members

Public Types inherited from graphic::IGamepad
enum  Button {
  BUTTON_UNKNOWN = -1 , BUTTON_A , BUTTON_B , BUTTON_X ,
  BUTTON_Y , BUTTON_LEFT_BUMPER , BUTTON_RIGHT_BUMPER , BUTTON_BACK ,
  BUTTON_START , BUTTON_LEFT_THUMB , BUTTON_RIGHT_THUMB , BUTTON_DPAD_UP ,
  BUTTON_DPAD_RIGHT , BUTTON_DPAD_DOWN , BUTTON_DPAD_LEFT , BUTTON_LENGTH
}
enum  Axis {
  AXIS_LEFT_X , AXIS_LEFT_Y , AXIS_RIGHT_X , AXIS_RIGHT_Y ,
  AXIS_LEFT_TRIGGER , AXIS_RIGHT_TRIGGER , AXIS_LENGTH
}

Detailed Description

La manette numero _index, ouverte a la construction.

SDL_GameController normalise deja les boutons : pas de table d'indices bruts a deviner comme chez sfml, l'enum du contrat se pose dessus presque un pour un.

SDL_Gamepad normalise deja les boutons : pas de table d'indices bruts a deviner comme chez sfml, l'enum du contrat se pose dessus presque un pour un.

Constructor & Destructor Documentation

◆ SdlGamepad() [1/2]

SdlGamepad::SdlGamepad ( const SdlWindow & window,
int index = 0 )
inline

◆ ~SdlGamepad() [1/2]

SdlGamepad::~SdlGamepad ( )
inlineoverride

◆ SdlGamepad() [2/2]

SdlGamepad::SdlGamepad ( const SdlWindow & window,
int index = 0 )
inline

◆ ~SdlGamepad() [2/2]

SdlGamepad::~SdlGamepad ( )
inlineoverride

Member Function Documentation

◆ getAxisMovement() [1/2]

float SdlGamepad::getAxisMovement ( Axis axis) const
inlineoverridevirtual

the movement of an axis, in [-1, 1]

Parameters
axis
Returns
float

Implements graphic::IGamepad.

◆ getAxisMovement() [2/2]

float SdlGamepad::getAxisMovement ( Axis axis) const
inlineoverridevirtual

the movement of an axis, in [-1, 1]

Parameters
axis
Returns
float

Implements graphic::IGamepad.

◆ isAvailable() [1/2]

bool SdlGamepad::isAvailable ( ) const
inlineoverridevirtual

notice if a gamepad is actually plugged in

Returns
bool

Implements graphic::IGamepad.

◆ isAvailable() [2/2]

bool SdlGamepad::isAvailable ( ) const
inlineoverridevirtual

notice if a gamepad is actually plugged in

Returns
bool

Implements graphic::IGamepad.

◆ isButtonDown() [1/2]

bool SdlGamepad::isButtonDown ( Button button) const
inlineoverridevirtual

notice if the button is down

Parameters
button
Returns
bool

Implements graphic::IGamepad.

◆ isButtonDown() [2/2]

bool SdlGamepad::isButtonDown ( Button button) const
inlineoverridevirtual

notice if the button is down

Parameters
button
Returns
bool

Implements graphic::IGamepad.

◆ isButtonPressed()

bool SdlGamepad::isButtonPressed ( Button button) const
overridevirtual

notice if the button is pressed

Parameters
button
Returns
bool

Implements graphic::IGamepad.

◆ isButtonReleased()

bool SdlGamepad::isButtonReleased ( Button button) const
overridevirtual

notice if the button is released

Parameters
button
Returns
bool

Implements graphic::IGamepad.

◆ isButtonUp() [1/2]

bool SdlGamepad::isButtonUp ( Button button) const
inlineoverridevirtual

notice if the button is up

Parameters
button
Returns
bool

Implements graphic::IGamepad.

◆ isButtonUp() [2/2]

bool SdlGamepad::isButtonUp ( Button button) const
inlineoverridevirtual

notice if the button is up

Parameters
button
Returns
bool

Implements graphic::IGamepad.

◆ SdlWindow

SdlWindow
friend

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