libgui
2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
Loading...
Searching...
No Matches
InputDriver.h
1
/****************************************************************************
2
* Platform Abstraction Layer
3
* Daryl Borth 2026
4
* InputDriver.h
5
*
6
* Platform input backend GuiElements delegate to.
7
* Exactly one driver implements this and assigns the single global instance.
8
***************************************************************************/
9
#pragma once
10
11
enum
{
12
WIIMOTE_ORIENTATION_VERTICAL = 0,
13
WIIMOTE_ORIENTATION_HORIZONTAL,
14
WIIMOTE_ORIENTATION_LENGTH
15
};
16
21
class
InputDriver
22
{
23
public
:
24
virtual
~InputDriver
() =
default
;
25
27
virtual
void
init
() = 0;
29
virtual
void
shutdown
() = 0;
30
32
virtual
void
update
() = 0;
33
35
virtual
void
setRumble
(
int
channel,
bool
rumble) = 0;
37
virtual
void
setContinuousRumble
(
int
channel,
bool
continuous) = 0;
38
40
void
setRumbleEnabled
(
bool
enabled) {
rumbleEnabled
= enabled; }
42
bool
isRumbleEnabled
()
const
{
return
rumbleEnabled
; }
44
void
setWiimoteOrientation
(
int
orientation) {
wiimoteOrientation
= orientation; }
46
int
getWiimoteOrientation
()
const
{
return
wiimoteOrientation
; }
47
48
protected
:
49
bool
rumbleEnabled
=
true
;
50
int
wiimoteOrientation
= WIIMOTE_ORIENTATION_VERTICAL;
51
};
InputDriver
Platform input backend GuiElements delegate to, via the per-channel InputController objects update() ...
Definition
InputDriver.h:22
InputDriver::update
virtual void update()=0
Polls the hardware and dispatches InputPadData payloads to the UI.
InputDriver::setRumble
virtual void setRumble(int channel, bool rumble)=0
Requests a rumble event on the specified controller channel.
InputDriver::isRumbleEnabled
bool isRumbleEnabled() const
Definition
InputDriver.h:42
InputDriver::shutdown
virtual void shutdown()=0
Shuts the controller subsystem down.
InputDriver::getWiimoteOrientation
int getWiimoteOrientation() const
Definition
InputDriver.h:46
InputDriver::setRumbleEnabled
void setRumbleEnabled(bool enabled)
Globally enables or disables rumble requested through setRumble().
Definition
InputDriver.h:40
InputDriver::rumbleEnabled
bool rumbleEnabled
see setRumbleEnabled()
Definition
InputDriver.h:49
InputDriver::setWiimoteOrientation
void setWiimoteOrientation(int orientation)
Definition
InputDriver.h:44
InputDriver::wiimoteOrientation
int wiimoteOrientation
see setWiimoteOrientation()
Definition
InputDriver.h:50
InputDriver::setContinuousRumble
virtual void setContinuousRumble(int channel, bool continuous)=0
Holds a channel's motor on (or releases it) until changed. Drivers cap an unbroken run and insert a s...
InputDriver::init
virtual void init()=0
Initializes the controller subsystem.
source
drivers
InputDriver.h
Generated by
1.13.2