Cogs.Core
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Cogs::Platform::GamepadHandler Class Reference

Public Member Functions

void initialize (Core::ViewContext *viewContext)
 
void update ()
 
void initialize (Core::ViewContext *viewContext)
 
void update ()
 
void initialize (Core::ViewContext *viewContext)
 
void update ()
 
void initialize (Core::ViewContext *viewContext)
 
void update ()
 

Public Attributes

const int axisMapping [6]
 
const float axisMultiplier [6]
 
const int buttonMapping [16]
 

Private Member Functions

void scanForDevices ()
 

Private Attributes

Core::ViewContextview = nullptr
 
std::array< XID, maxDevices > deviceID
 
double nextScanTime = 0.0
 
const int Disconnected = -1
 
const int NoMapping = 0
 
const int Connected = 1
 
const double checkInterval = 1.0
 
std::array< size_t, 4 > mapping = {}
 
std::array< double, 4 > checkedTime = {}
 

Static Private Attributes

static constexpr double scanInterval = 2.0
 
static constexpr int maxDevices = 4
 

Detailed Description

Definition at line 18 of file EmscriptenGamepad.h.

Member Function Documentation

◆ initialize()

void Cogs::Platform::GamepadHandler::initialize ( Core::ViewContext viewContext)
inline

Definition at line 21 of file EmscriptenGamepad.h.

◆ scanForDevices()

void Cogs::Platform::GamepadHandler::scanForDevices ( )
private

Definition at line 28 of file LinuxGamepad.cpp.

◆ update()

void Cogs::Platform::GamepadHandler::update ( )
inline

Definition at line 66 of file EmscriptenGamepad.h.

Member Data Documentation

◆ axisMapping

const int Cogs::Platform::GamepadHandler::axisMapping[6]
Initial value:
= {
Gamepad::AxisNo::StickLeftX,
Gamepad::AxisNo::StickLeftY,
Gamepad::AxisNo::StickRightX,
Gamepad::AxisNo::StickRightY,
Gamepad::AxisNo::TriggerLeft,
Gamepad::AxisNo::TriggerRight,
}

Definition at line 29 of file EmscriptenGamepad.h.

◆ axisMultiplier

const float Cogs::Platform::GamepadHandler::axisMultiplier[6]
Initial value:
= {
1.0f,
-1.0f,
1.0f,
-1.0f,
1.0f,
1.0f
}

Definition at line 38 of file EmscriptenGamepad.h.

◆ buttonMapping

const int Cogs::Platform::GamepadHandler::buttonMapping[16]
Initial value:
= {
Gamepad::ButtonNo::A,
Gamepad::ButtonNo::B,
Gamepad::ButtonNo::Y,
Gamepad::ButtonNo::X,
Gamepad::ButtonNo::LeftShoulder,
Gamepad::ButtonNo::RightShoulder,
Gamepad::ButtonNo::PlaceHolder0,
Gamepad::ButtonNo::PlaceHolder1,
Gamepad::ButtonNo::Back,
Gamepad::ButtonNo::Start,
Gamepad::ButtonNo::LeftThumb,
Gamepad::ButtonNo::RightThumb,
Gamepad::ButtonNo::DPadUp,
Gamepad::ButtonNo::DPadDown,
Gamepad::ButtonNo::DPadLeft,
Gamepad::ButtonNo::DPadRight,
}

Definition at line 47 of file EmscriptenGamepad.h.

◆ checkedTime

std::array<double, 4> Cogs::Platform::GamepadHandler::checkedTime = {}
private

Definition at line 24 of file WindowsGamepad.h.

◆ checkInterval

const double Cogs::Platform::GamepadHandler::checkInterval = 1.0
private

Definition at line 21 of file WindowsGamepad.h.

◆ Connected

const int Cogs::Platform::GamepadHandler::Connected = 1
private

Definition at line 19 of file WindowsGamepad.h.

◆ deviceID

std::array<XID, maxDevices> Cogs::Platform::GamepadHandler::deviceID
private

Definition at line 28 of file LinuxGamepad.h.

◆ Disconnected

const int Cogs::Platform::GamepadHandler::Disconnected = -1
private

Definition at line 17 of file WindowsGamepad.h.

◆ mapping

std::array<size_t, 4> Cogs::Platform::GamepadHandler::mapping = {}
private

Definition at line 23 of file WindowsGamepad.h.

◆ maxDevices

constexpr int Cogs::Platform::GamepadHandler::maxDevices = 4
staticconstexprprivate

Definition at line 26 of file LinuxGamepad.h.

◆ nextScanTime

double Cogs::Platform::GamepadHandler::nextScanTime = 0.0
private

Definition at line 29 of file LinuxGamepad.h.

◆ NoMapping

const int Cogs::Platform::GamepadHandler::NoMapping = 0
private

Definition at line 18 of file WindowsGamepad.h.

◆ scanInterval

constexpr double Cogs::Platform::GamepadHandler::scanInterval = 2.0
staticconstexprprivate

Definition at line 25 of file LinuxGamepad.h.

◆ view

Core::ViewContext * Cogs::Platform::GamepadHandler::view = nullptr
private

Definition at line 96 of file EmscriptenGamepad.h.


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