libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::SDLAxisDirectionToAnyMapping Class Reference

Base class for mappings that bind an SDL gamepad axis direction to any controller input. More...

#include <SDLAxisDirectionToAnyMapping.h>

Inheritance diagram for Ship::SDLAxisDirectionToAnyMapping:
[legend]
Collaboration diagram for Ship::SDLAxisDirectionToAnyMapping:
[legend]

Public Member Functions

 SDLAxisDirectionToAnyMapping (int32_t sdlControllerAxis, int32_t axisDirection)
 Constructs an SDL axis-direction mapping.
 
virtual ~SDLAxisDirectionToAnyMapping ()
 Destructor.
 
std::string GetPhysicalInputName () override
 Returns the human-readable name of the bound axis and direction.
 
std::string GetPhysicalDeviceName () override
 Returns the human-readable name of the SDL gamepad device.
 
bool AxisIsTrigger ()
 Tests whether this axis represents a trigger (e.g. LT / RT).
 
bool AxisIsStick ()
 Tests whether this axis represents an analog stick axis.
 
- Public Member Functions inherited from Ship::ControllerInputMapping
 ControllerInputMapping (PhysicalDeviceType physicalDeviceType)
 Constructs a ControllerInputMapping for the given physical device type.
 
 ~ControllerInputMapping ()
 
- Public Member Functions inherited from Ship::ControllerMapping
 ControllerMapping (PhysicalDeviceType physicalDeviceType)
 Constructs a ControllerMapping for the given physical device type.
 
 ~ControllerMapping ()
 
PhysicalDeviceType GetPhysicalDeviceType ()
 Returns the physical device type for this mapping.
 

Protected Attributes

SDL_GameControllerAxis mControllerAxis
 
AxisDirection mAxisDirection
 
- Protected Attributes inherited from Ship::ControllerMapping
PhysicalDeviceType mPhysicalDeviceType
 

Detailed Description

Base class for mappings that bind an SDL gamepad axis direction to any controller input.

Provides shared axis-direction storage, physical device/input name reporting, and helpers to determine whether the axis is a trigger or stick.

Constructor & Destructor Documentation

◆ SDLAxisDirectionToAnyMapping()

Ship::SDLAxisDirectionToAnyMapping::SDLAxisDirectionToAnyMapping ( int32_t  sdlControllerAxis,
int32_t  axisDirection 
)

Constructs an SDL axis-direction mapping.

Parameters
sdlControllerAxisThe SDL controller axis index.
axisDirectionThe axis half to bind (NEGATIVE or POSITIVE).

◆ ~SDLAxisDirectionToAnyMapping()

virtual Ship::SDLAxisDirectionToAnyMapping::~SDLAxisDirectionToAnyMapping ( )
virtual

Destructor.

Member Function Documentation

◆ AxisIsStick()

bool Ship::SDLAxisDirectionToAnyMapping::AxisIsStick ( )

Tests whether this axis represents an analog stick axis.

Returns
true if the axis is a stick.

◆ AxisIsTrigger()

bool Ship::SDLAxisDirectionToAnyMapping::AxisIsTrigger ( )

Tests whether this axis represents a trigger (e.g. LT / RT).

Returns
true if the axis is a trigger.

◆ GetPhysicalDeviceName()

std::string Ship::SDLAxisDirectionToAnyMapping::GetPhysicalDeviceName ( )
overridevirtual

Returns the human-readable name of the SDL gamepad device.

Reimplemented from Ship::ControllerMapping.

Reimplemented in Ship::SDLAxisDirectionToAxisDirectionMapping, and Ship::SDLAxisDirectionToButtonMapping.

◆ GetPhysicalInputName()

std::string Ship::SDLAxisDirectionToAnyMapping::GetPhysicalInputName ( )
overridevirtual

Returns the human-readable name of the bound axis and direction.

Reimplemented from Ship::ControllerInputMapping.

Reimplemented in Ship::SDLAxisDirectionToAxisDirectionMapping, and Ship::SDLAxisDirectionToButtonMapping.

Member Data Documentation

◆ mAxisDirection

AxisDirection Ship::SDLAxisDirectionToAnyMapping::mAxisDirection
protected

◆ mControllerAxis

SDL_GameControllerAxis Ship::SDLAxisDirectionToAnyMapping::mControllerAxis
protected

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