SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLInputDevice.cpp
Go to the documentation of this file.
1 /**
2  * \file SLInputDevice.cpp
3  * \date January 2015
4  * \authors Marc Wacker, Marcus Hudritsch
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #include <algorithm>
11 #include <SLInputManager.h>
12 
13 //-----------------------------------------------------------------------------
14 /*! Constructor for SLInputDevices. This will automatically enable the device,
15 adding them to the SLInputManager.
16  */
18  : _inputManager(inputManager)
19 {
20  // enable any input device on creation
21  enable();
22 }
23 //-----------------------------------------------------------------------------
24 /*! The destructor removes the device from SLInputManager again if necessary.
25  */
27 {
28  disable();
29 }
30 //-----------------------------------------------------------------------------
31 /*! Enabling an SLInputDevice will add it to the device list kept by
32 SLInputManager
33 */
35 {
36  _inputManager.devices().push_back(this);
37 }
38 //-----------------------------------------------------------------------------
39 /*! Enabling an SLInputDevice will remove it from the device list kept by
40 SLInputManager
41 */
43 {
45  dl.erase(std::remove(dl.begin(), dl.end(), this), dl.end());
46 }
47 //-----------------------------------------------------------------------------
vector< SLInputDevice * > SLVInputDevice
Definition: SLInputDevice.h:37
SLInputManager & _inputManager
Definition: SLInputDevice.h:34
SLInputDevice(SLInputManager &inputManager)
virtual ~SLInputDevice()
SLInputManager. manages system input and custom input devices.
SLVInputDevice & devices()