MochiEngine
Loading...
Searching...
No Matches
Mochi::Input::SDLGamepadProvider Class Reference

Implementation of IGamepadProvider that uses SDL_GetGamepadAxis and SDL_GetGamepadButton to retrieve gamepad data. More...

#include <SDLGamepadProvider.h>

Inheritance diagram for Mochi::Input::SDLGamepadProvider:
Mochi::Input::IGamepadProvider

Public Member Functions

 SDLGamepadProvider (Event::EventBus *eventBus)
virtual GamepadData GetData (const unsigned int &player) const override
 Gets data of the gamepad in the selected slot for this frame.
virtual bool HasGamepad (const unsigned int &player) const override
 Checks if there is a gamepad connected in the specified player slot.

Detailed Description

Implementation of IGamepadProvider that uses SDL_GetGamepadAxis and SDL_GetGamepadButton to retrieve gamepad data.

Member Function Documentation

◆ GetData()

GamepadData Mochi::Input::SDLGamepadProvider::GetData ( const unsigned int & player) const
overridevirtual

Gets data of the gamepad in the selected slot for this frame.

Parameters
playerThe slot to get the data from.
Returns
GamepadData of the selected slot for this frame.

Implements Mochi::Input::IGamepadProvider.

◆ HasGamepad()

bool Mochi::Input::SDLGamepadProvider::HasGamepad ( const unsigned int & player) const
overridevirtual

Checks if there is a gamepad connected in the specified player slot.

Parameters
playerThe slot to check.
Returns
True if the slot has a gamepad connected.

Implements Mochi::Input::IGamepadProvider.


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