Sleeping Wombat GUI
0.100
swGUI
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
swInputLibrary
InputCore
JoystickDevice.h
Go to the documentation of this file.
1
#pragma once
2
8
#include "
Device.h
"
9
10
#include "
JoystickState.h
"
11
#include "
InputDeviceInfo.h
"
12
#include "
InputDeviceEvent.h
"
13
14
#include "
EventQueue.h
"
15
16
#include <vector>
17
18
19
namespace
sw
{
20
namespace
input
21
{
22
23
27
class
JoystickDevice
:
public
Device
28
{
29
private
:
30
31
InputDeviceInfo
m_info
;
32
JoystickState
m_state
;
33
34
EventQueue< DeviceEvent >
m_events
;
35
36
protected
:
37
public
:
38
explicit
JoystickDevice
() =
default
;
39
~JoystickDevice
() =
default
;
40
41
42
const
InputDeviceInfo
&
GetInfo
()
const
{
return
m_info
; }
43
const
JoystickState
&
GetState
()
const
{
return
m_state
; }
44
45
void
ApplyAllEvents
();
46
DeviceEvent
ApplyNextEvent
();
47
Timestamp
GetNextEvtTimestamp
();
48
49
void
RemoveEvents
();
50
51
EventQueue< DeviceEvent >
&
GetEventsQueue
() {
return
m_events
; }
52
};
53
54
DEFINE_OPTR_TYPE
( JoystickDevice );
55
56
57
//====================================================================================//
58
// Inline implementation
59
//====================================================================================//
60
61
62
// ================================ //
63
//
64
inline
void
JoystickDevice::ApplyAllEvents
()
65
{
66
while
( !
m_events
.NoMoreEvents() )
67
{
68
auto
&
event
=
m_events
.PopEvent();
69
//m_state.ApplyEvent( event );
70
}
71
}
72
73
// ================================ //
74
// @todo Implement
75
inline
DeviceEvent
JoystickDevice::ApplyNextEvent
()
76
{
77
m_events
.PopEvent();
78
return
DeviceEvent
();
79
}
80
81
// ================================ //
82
// @todo implment
83
inline
Timestamp
JoystickDevice::GetNextEvtTimestamp
()
84
{
85
return
std::numeric_limits< Timestamp >::max();
86
}
87
88
// ================================ //
89
//
90
inline
void
JoystickDevice::RemoveEvents
()
91
{
92
m_state
.
RemoveEvents
();
93
m_events
.ClearReadEvents();
94
}
95
96
97
98
}
// input
99
}
// sw
100
101
InputDeviceInfo
Information about device. For future use.
Definition:
InputDeviceInfo.h:14
Device.h
sw::input::Timestamp
uint16 Timestamp
Definition:
InputDeviceEvent.h:19
sw
Definition:
DirectInputModule.cpp:11
sw::input::JoystickDevice::GetEventsQueue
EventQueue< DeviceEvent > & GetEventsQueue()
Definition:
JoystickDevice.h:51
sw::input::JoystickState::RemoveEvents
void RemoveEvents()
Definition:
JoystickState.h:44
sw::input::JoystickDevice::~JoystickDevice
~JoystickDevice()=default
sw::input::DeviceEvent
KeyStates changed events.
Definition:
InputDeviceEvent.h:313
sw::input::JoystickDevice::ApplyNextEvent
DeviceEvent ApplyNextEvent()
Definition:
JoystickDevice.h:75
sw::input::Device
Interface class for input devices.
Definition:
Device.h:21
sw::input::JoystickDevice::GetState
const JoystickState & GetState() const
Definition:
JoystickDevice.h:43
JoystickState.h
sw::input::JoystickDevice::RemoveEvents
void RemoveEvents()
Definition:
JoystickDevice.h:90
sw::input::JoystickState
State of joystick device or other controllers which aren't mouse and keyboard.
Definition:
JoystickState.h:19
InputDeviceEvent.h
sw::input::JoystickDevice::m_state
JoystickState m_state
Definition:
JoystickDevice.h:32
sw::input::JoystickDevice::JoystickDevice
JoystickDevice()=default
sw::input::JoystickDevice::GetNextEvtTimestamp
Timestamp GetNextEvtTimestamp()
Definition:
JoystickDevice.h:83
sw::input::JoystickDevice::GetInfo
const InputDeviceInfo & GetInfo() const
Definition:
JoystickDevice.h:42
sw::input::EventQueue
Abstraction of event queue.
Definition:
EventQueue.h:26
EventQueue.h
InputDeviceInfo.h
sw::input::DEFINE_OPTR_TYPE
DEFINE_OPTR_TYPE(Device)
sw::input::JoystickDevice::ApplyAllEvents
void ApplyAllEvents()
Definition:
JoystickDevice.h:64
sw::input::JoystickDevice
Joystick or other controller state and events.
Definition:
JoystickDevice.h:27
sw::input::JoystickDevice::m_info
InputDeviceInfo m_info
Definition:
JoystickDevice.h:31
sw::input::JoystickDevice::m_events
EventQueue< DeviceEvent > m_events
Definition:
JoystickDevice.h:34
Generated on Tue May 9 2017 15:46:02 for Sleeping Wombat GUI by
1.8.9.1