VR-Engage
2.2
Loading...
Searching...
No Matches
inputDevice.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2025 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
6
//! \file
7
//! \brief Abstract base class for input device implementations
8
9
#pragma once
10
11
#include "
vreInput/export.h
"
12
13
namespace
makVre
14
{
15
//! Forward declarations
16
class
DtVreInputManager
;
17
18
//! \brief Abstract base class for hardware input device implementations
19
//!
20
//! This class provides a common interface for all input devices (gamepad, joystick, keyboard, etc.).
21
//! Instances are owned by a DtVreInputManager. Derived classes receive input from specific hardware
22
//! device APIs, map these inputs to DtInputData structures, and then call processInput() in the
23
//! DtVreInputManager to handle the input events.
24
class
VREINPUT_DLL
DtInputDevice
25
{
26
public
:
27
//! \brief Default constructor
28
DtInputDevice
() {};
29
//! \brief Virtual destructor
30
virtual
~DtInputDevice
() {};
31
32
//! \brief Copy constructor (deleted)
33
//!
34
//! Input devices cannot be copied due to hardware abstraction requirements
35
DtInputDevice
(
const
DtInputDevice
& mapping) =
delete
;
36
37
//! \brief Assignment operator (deleted)
38
//!
39
//! Input devices cannot be assigned due to hardware abstraction requirements
40
DtInputDevice
&
operator=
(
const
DtInputDevice
&) =
delete
;
41
42
//! \brief Initialize the device with a reference to the input manager
43
//!
44
//! Sets up the device and prepares it to receive input events from hardware.
45
//!
46
//! \param mgr Reference to the input manager that owns this device
47
//! \return True if initialization succeeded, false if the device failed (e.g., hardware not present)
48
virtual
bool
init
(
DtVreInputManager
& mgr) = 0;
49
50
//! \brief Update method called each frame by the input manager
51
//!
52
//! Allows the device to poll for input, handle timing-related events,
53
//! and perform any per-frame processing needed.
54
//!
55
//! \param dt Delta time in seconds since the last frame
56
virtual
void
tick
(
double
dt) = 0;
57
58
//! \brief Shutdown the device and release hardware resources
59
//!
60
//! Disconnects from the hardware device and stops receiving input events.
61
//! Should clean up any resources allocated during initialization.
62
virtual
void
shutdown
() = 0;
63
64
//! \brief Report the current state of all buttons, axes, and other inputs
65
//!
66
//! Sends input events for the current state of all device controls without
67
//! requiring actual hardware input. Useful for initializing the system with
68
//! the current device state or for testing.
69
virtual
void
reportCurrentState
() = 0;
70
71
protected
:
72
//! \brief Pointer to the input manager that owns this device
73
//!
74
//! Used to send input events to the manager for processing
75
DtVreInputManager
*
myManager
;
76
};
77
78
}
// namespace makVre
makVre::DtInputDevice::reportCurrentState
virtual void reportCurrentState()=0
Report the current state of all buttons, axes, and other inputs.
makVre::DtInputDevice::shutdown
virtual void shutdown()=0
Shutdown the device and release hardware resources.
makVre::DtInputDevice::tick
virtual void tick(double dt)=0
Update method called each frame by the input manager.
makVre::DtInputDevice::DtInputDevice
DtInputDevice(const DtInputDevice &mapping)=delete
Copy constructor (deleted)
makVre::DtInputDevice::DtInputDevice
DtInputDevice()
Default constructor.
Definition
inputDevice.h:28
makVre::DtInputDevice::init
virtual bool init(DtVreInputManager &mgr)=0
Initialize the device with a reference to the input manager.
makVre::DtInputDevice::~DtInputDevice
virtual ~DtInputDevice()
Virtual destructor.
Definition
inputDevice.h:30
makVre::DtInputDevice::operator=
DtInputDevice & operator=(const DtInputDevice &)=delete
Assignment operator (deleted)
makVre::DtInputDevice::myManager
DtVreInputManager * myManager
Pointer to the input manager that owns this device.
Definition
inputDevice.h:75
makVre::DtVreInputManager
Central manager for input device handling, action mapping, and input processing.
Definition
vreInputManager.h:81
export.h
Defines DLL export/import macros for the vreInput library.
VREINPUT_DLL
#define VREINPUT_DLL
DLL export/import macro for the vreInput library.
Definition
export.h:25
makVre
Include export definitions for this library.
Definition
glsVreMessageUtil.h:49
Generated on 2026-01-13 from SVN revision 282860 - Copyright © 2005-2026 MAK Technologies. All Rights Reserved.