InputSystem.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <unordered_set>
6 #include <unordered_map>
7 
8 namespace iv
9 {
10 
11 class InputNode;
12 
15 class InputSystem : public System
16 {
17 public:
18  InputSystem( SystemContainer * sc, InputSource * source );
19  virtual ~InputSystem(){}
20  virtual std::string debug_name() const override { return "InputSystem"; }
21  virtual void status( TextDebugView * view ) override;
22  virtual bool flushSystem() override;
23 
24  void window_size( int2 );
25  int2 window_size();
26 
27  int2 input_position( Input::Key key, int device_id );
28  float input_value( Input::Key key, int device_id );
29  unsigned input_character();
30 
31  //--------------------- consistency checking --------------------
32  void node_register( InputNode * );
33  void node_unregister( InputNode * );
34 
35 private:
36  InputSource * source;
37  int2 _window_size;
38 
39  std::unordered_set< InputNode * > nodes;
40  unsigned last_check_frame_id;
41 };
42 
43 }