SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLInputManager.h
Go to the documentation of this file.
1
2
3
#ifndef SLINPUTMANAGER_H
4
#define SLINPUTMANAGER_H
5
6
#include <mutex>
7
#include <
SLInputDevice.h
>
8
#include <
SLInputEvent.h
>
9
10
class
SLSceneView
;
11
//-----------------------------------------------------------------------------
12
//! SLInputManager. manages system input and custom input devices.
13
/*! One static instance of SLInputManager is used in AppCommon. Every user
14
input has to go through the SLInputManager. System event's like touch, mouse,
15
character input will be encapsulated in SLInputEvent subclasses and will be
16
queued up before being sent to the relevant SLSceneView.
17
Custom SLInputDevices can also be created. The SLInputDevices are guaranteed to
18
receive a call to their poll() function whenever the SLInputManager requires
19
them to send out new events. The method pollAndProcessEvents is called every
20
frame in SLScene::onUpdate.
21
*/
22
class
SLInputManager
23
{
24
friend
class
SLInputDevice
;
25
26
public
:
27
SLInputManager
() { ; }
28
29
SLbool
pollAndProcessEvents
(
SLSceneView
*
sv
);
30
void
queueEvent
(
const
SLInputEvent
* e);
31
SLVInputDevice
&
devices
() {
return
_devices
; }
32
33
private
:
34
SLQInputEvent
_systemEvents
;
//!< queue for known system events
35
SLVInputDevice
_devices
;
//!< list of activated SLInputDevices
36
37
SLbool
processQueuedEvents
(
SLSceneView
*
sv
);
38
};
39
//-----------------------------------------------------------------------------
40
#endif
SLbool
bool SLbool
Definition:
SL.h:175
SLInputDevice.h
SLVInputDevice
vector< SLInputDevice * > SLVInputDevice
Definition:
SLInputDevice.h:37
SLInputEvent.h
SLQInputEvent
std::queue< const SLInputEvent * > SLQInputEvent
Definition:
SLInputEvent.h:134
SLInputDevice
Interface for input devices that have to be pollsed.
Definition:
SLInputDevice.h:21
SLInputEvent
Baseclass for all system input events.
Definition:
SLInputEvent.h:25
SLInputManager
SLInputManager. manages system input and custom input devices.
Definition:
SLInputManager.h:23
SLInputManager::pollAndProcessEvents
SLbool pollAndProcessEvents(SLSceneView *sv)
Definition:
SLInputManager.cpp:29
SLInputManager::devices
SLVInputDevice & devices()
Definition:
SLInputManager.h:31
SLInputManager::_devices
SLVInputDevice _devices
list of activated SLInputDevices
Definition:
SLInputManager.h:35
SLInputManager::_systemEvents
SLQInputEvent _systemEvents
queue for known system events
Definition:
SLInputManager.h:34
SLInputManager::SLInputManager
SLInputManager()
Definition:
SLInputManager.h:27
SLInputManager::processQueuedEvents
SLbool processQueuedEvents(SLSceneView *sv)
Definition:
SLInputManager.cpp:52
SLInputManager::queueEvent
void queueEvent(const SLInputEvent *e)
Definition:
SLInputManager.cpp:45
SLSceneView
SceneView class represents a dynamic real time 3D view onto the scene.
Definition:
SLSceneView.h:69
modules
sl
source
input
SLInputManager.h
Generated by
1.9.1