VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtInputDevice Class Referenceabstract

Detailed Description

This class provides a common interface for all input devices (gamepad, joystick, keyboard, etc.). Instances are owned by a DtVreInputManager. Derived classes receive input from specific hardware device APIs, map these inputs to DtInputData structures, and then call processInput() in the DtVreInputManager to handle the input events.

#include <inputDevice.h>

Inheritance diagram for makVre::DtInputDevice:
[legend]

Public Member Functions

 DtInputDevice ()
 
virtual ~DtInputDevice ()
 
 DtInputDevice (const DtInputDevice &mapping)=delete
 
DtInputDeviceoperator= (const DtInputDevice &)=delete
 
virtual bool init (DtVreInputManager &mgr)=0
 
virtual void tick (double dt)=0
 
virtual void shutdown ()=0
 
virtual void reportCurrentState ()=0
 

Protected Attributes

DtVreInputManagermyManager
 

Constructor & Destructor Documentation

◆ DtInputDevice() [1/2]

makVre::DtInputDevice::DtInputDevice ( )
inline

Default constructor.

Referenced by DtInputDevice(), and operator=().

◆ ~DtInputDevice()

virtual makVre::DtInputDevice::~DtInputDevice ( )
inlinevirtual

Virtual destructor.

◆ DtInputDevice() [2/2]

makVre::DtInputDevice::DtInputDevice ( const DtInputDevice & mapping)
delete

Copy constructor (deleted)

Input devices cannot be copied due to hardware abstraction requirements

References DtInputDevice().

Member Function Documentation

◆ operator=()

DtInputDevice & makVre::DtInputDevice::operator= ( const DtInputDevice & )
delete

Assignment operator (deleted)

Input devices cannot be assigned due to hardware abstraction requirements

References DtInputDevice().

◆ init()

virtual bool makVre::DtInputDevice::init ( DtVreInputManager & mgr)
pure virtual

Initialize the device with a reference to the input manager.

Sets up the device and prepares it to receive input events from hardware.

Parameters
mgrReference to the input manager that owns this device
Returns
True if initialization succeeded, false if the device failed (e.g., hardware not present)

Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.

◆ tick()

virtual void makVre::DtInputDevice::tick ( double dt)
pure virtual

Update method called each frame by the input manager.

Allows the device to poll for input, handle timing-related events, and perform any per-frame processing needed.

Parameters
dtDelta time in seconds since the last frame

Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.

◆ shutdown()

virtual void makVre::DtInputDevice::shutdown ( )
pure virtual

Shutdown the device and release hardware resources.

Disconnects from the hardware device and stops receiving input events. Should clean up any resources allocated during initialization.

Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.

◆ reportCurrentState()

virtual void makVre::DtInputDevice::reportCurrentState ( )
pure virtual

Report the current state of all buttons, axes, and other inputs.

Sends input events for the current state of all device controls without requiring actual hardware input. Useful for initializing the system with the current device state or for testing.

Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.

Member Data Documentation

◆ myManager

DtVreInputManager* makVre::DtInputDevice::myManager
protected

Pointer to the input manager that owns this device.

Used to send input events to the manager for processing


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