libgui 3.00
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
OgcInputDriver Class Reference

GameCube InputDriver, and the base of WiiInputDriver: PAD (GameCube), the per-frame channel loop, merging the per-hardware state, and menu rumble. More...

#include <OgcInputDriver.h>

Inheritance diagram for OgcInputDriver:
[legend]

Public Member Functions

void init () override
 Initializes the controller subsystem.
 
void shutdown () override
 Shuts the controller subsystem down.
 
void update () override
 Polls the hardware and dispatches InputPadData payloads to the UI.
 
void setRumble (int channel, bool rumble) override
 Requests a rumble event on the specified controller channel.
 
void setContinuousRumble (int channel, bool continuous) override
 Holds a channel's motor on (or releases it) until changed. Drivers cap an unbroken run and insert a short gap so the motor is not driven continuously.
 
- Public Member Functions inherited from InputDriver
void setRumbleEnabled (bool enabled)
 Globally enables or disables rumble requested through setRumble().
 
bool isRumbleEnabled () const
 
void setWiimoteOrientation (int orientation)
 
int getWiimoteOrientation () const
 

Protected Member Functions

virtual void initHardware ()
 Extension points for a console with more input hardware than GameCube pads.
 
virtual void scanHardware ()
 Called once per frame before the channels are read: poll the extra hardware.
 
virtual void readChannel (int channel, InputPadData &pad)
 Called once per channel per frame: add the extra hardware's state for channel to pad (each device in the slot of its own hardware profile)
 
virtual bool isSystemRumbleAllowed () const
 False if the console's own settings disable controller rumble.
 
virtual void driveRumble (int channel, bool on)
 Drives the rumble motor of any controller other than the GameCube pad on channel; called every frame (and with false on shutdown)
 

Additional Inherited Members

- Protected Attributes inherited from InputDriver
bool rumbleEnabled = true
 see setRumbleEnabled()
 
int wiimoteOrientation = WIIMOTE_ORIENTATION_VERTICAL
 see setWiimoteOrientation()
 

Detailed Description

GameCube InputDriver, and the base of WiiInputDriver: PAD (GameCube), the per-frame channel loop, merging the per-hardware state, and menu rumble.

Consoles with more hardware (the Wii) derive from it and use the protected hooks.

Definition at line 20 of file OgcInputDriver.h.

Constructor & Destructor Documentation

◆ OgcInputDriver()

OgcInputDriver::OgcInputDriver ( )

Definition at line 43 of file OgcInputDriver.cpp.

◆ ~OgcInputDriver()

OgcInputDriver::~OgcInputDriver ( )
override

Definition at line 50 of file OgcInputDriver.cpp.

Member Function Documentation

◆ driveRumble()

virtual void OgcInputDriver::driveRumble ( int channel,
bool on )
inlineprotectedvirtual

Drives the rumble motor of any controller other than the GameCube pad on channel; called every frame (and with false on shutdown)

Reimplemented in WiiInputDriver.

Definition at line 51 of file OgcInputDriver.h.

◆ init()

void OgcInputDriver::init ( )
overridevirtual

Initializes the controller subsystem.

Implements InputDriver.

Definition at line 54 of file OgcInputDriver.cpp.

◆ initHardware()

virtual void OgcInputDriver::initHardware ( )
inlineprotectedvirtual

Extension points for a console with more input hardware than GameCube pads.

The defaults do nothing, which is exactly a GameCube. Called from init() after the GameCube pads are up

Reimplemented in WiiInputDriver.

Definition at line 37 of file OgcInputDriver.h.

◆ isSystemRumbleAllowed()

virtual bool OgcInputDriver::isSystemRumbleAllowed ( ) const
inlineprotectedvirtual

False if the console's own settings disable controller rumble.

Reimplemented in WiiInputDriver.

Definition at line 47 of file OgcInputDriver.h.

◆ readChannel()

virtual void OgcInputDriver::readChannel ( int channel,
InputPadData & pad )
inlineprotectedvirtual

Called once per channel per frame: add the extra hardware's state for channel to pad (each device in the slot of its own hardware profile)

Reimplemented in WiiInputDriver.

Definition at line 44 of file OgcInputDriver.h.

◆ scanHardware()

virtual void OgcInputDriver::scanHardware ( )
inlineprotectedvirtual

Called once per frame before the channels are read: poll the extra hardware.

Reimplemented in WiiInputDriver.

Definition at line 40 of file OgcInputDriver.h.

◆ setContinuousRumble()

void OgcInputDriver::setContinuousRumble ( int channel,
bool continuous )
overridevirtual

Holds a channel's motor on (or releases it) until changed. Drivers cap an unbroken run and insert a short gap so the motor is not driven continuously.

Implements InputDriver.

Definition at line 75 of file OgcInputDriver.cpp.

◆ setRumble()

void OgcInputDriver::setRumble ( int channel,
bool rumble )
overridevirtual

Requests a rumble event on the specified controller channel.

Implements InputDriver.

Definition at line 69 of file OgcInputDriver.cpp.

◆ shutdown()

void OgcInputDriver::shutdown ( )
overridevirtual

Shuts the controller subsystem down.

Implements InputDriver.

Definition at line 60 of file OgcInputDriver.cpp.

◆ update()

void OgcInputDriver::update ( )
overridevirtual

Polls the hardware and dispatches InputPadData payloads to the UI.

Implements InputDriver.

Definition at line 79 of file OgcInputDriver.cpp.


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