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 */
23 {
24  friend class SLInputDevice;
25 
26 public:
28 
30  void queueEvent(const SLInputEvent* e);
32 
33 private:
34  SLQInputEvent _systemEvents; //!< queue for known system events
35  SLVInputDevice _devices; //!< list of activated SLInputDevices
36 
38 };
39 //-----------------------------------------------------------------------------
40 #endif
bool SLbool
Definition: SL.h:175
vector< SLInputDevice * > SLVInputDevice
Definition: SLInputDevice.h:37
std::queue< const SLInputEvent * > SLQInputEvent
Definition: SLInputEvent.h:134
Interface for input devices that have to be pollsed.
Definition: SLInputDevice.h:21
Baseclass for all system input events.
Definition: SLInputEvent.h:25
SLInputManager. manages system input and custom input devices.
SLbool pollAndProcessEvents(SLSceneView *sv)
SLVInputDevice & devices()
SLVInputDevice _devices
list of activated SLInputDevices
SLQInputEvent _systemEvents
queue for known system events
SLbool processQueuedEvents(SLSceneView *sv)
void queueEvent(const SLInputEvent *e)
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69