NAP
inputservice.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Nap Includes
8 #include <nap/service.h>
9 #include <utility/dllexport.h>
10 #include <entity.h>
11 #include <nap/signalslot.h>
12 
13 // Local Includes
14 #include "inputevent.h"
15 
16 namespace nap
17 {
18  class InputService;
19  class Window;
20  class EntityInstance;
21  class InputRouter;
22 
32  class NAPAPI InputService : public Service
33  {
34  RTTI_ENABLE(Service)
35 
36  public:
37  // Default constructor
38  InputService(ServiceConfiguration* configuration) ;
39 
40  // Disable copy
41  InputService(const InputService& that) = delete;
42  InputService& operator=(const InputService&) = delete;
43 
53  void processWindowEvents(Window& window, InputRouter& inputRouter, const EntityList& entities);
54 
62  void processControllerEvents(int controllerID, InputRouter& inputRouter, const EntityList& entities);
63 
73  void processAllEvents(InputRouter& inputRouter, const EntityList& entities);
74 
79  void addEvent(InputEventPtr inEvent);
80 
84  virtual void postUpdate(double deltaTime);
85 
87 
88  private:
89  InputEventPtrList mInputEvents;
90  };
91 }
nap::InputRouter
Definition: inputrouter.h:23
nap::InputEventPtrList
std::vector< InputEventPtr > InputEventPtrList
Definition: inputevent.h:415
nap::InputService::controllerConnectionChanged
Signal< const ControllerConnectionEvent & > controllerConnectionChanged
Signal emitted when a controller is removed or added.
Definition: inputservice.h:86
nap::EntityList
std::vector< EntityInstance * > EntityList
Definition: entity.h:27
nap::ServiceConfiguration
Definition: service.h:28
nap::Signal
Definition: signalslot.h:28
nap::InputService
Definition: inputservice.h:32
nap::Service
Definition: templateservice.h:8
nap
Definition: templateapp.h:17
nap::InputEventPtr
std::unique_ptr< nap::InputEvent > InputEventPtr
Definition: inputevent.h:414
nap::Window
Definition: window.h:26