Daniele Bartolini 11 лет назад
Родитель
Сommit
9c9826d1f6
3 измененных файлов с 11 добавлено и 3 удалено
  1. 1 3
      engine/crown.cpp
  2. 7 0
      engine/input/input.cpp
  3. 3 0
      engine/input/input.h

+ 1 - 3
engine/crown.cpp

@@ -212,9 +212,7 @@ void update()
 		device()->update();
 		bgfx::frame();
 		lua_globals::clear_temporaries();
-		input_globals::keyboard().update();
-		input_globals::mouse().update();
-		input_globals::touch().update();
+		input_globals::update();
 		profiler_globals::flush();
 	}
 }

+ 7 - 0
engine/input/input.cpp

@@ -58,6 +58,13 @@ namespace input_globals
 		_touch = NULL;
 	}
 
+	void update()
+	{
+		_keyboard->update();
+		_mouse->update();
+		_touch->update();
+	}
+
 	Keyboard& keyboard()
 	{
 		return *_keyboard;

+ 3 - 0
engine/input/input.h

@@ -43,6 +43,9 @@ namespace input_globals
 	/// Shutdowns the input system.
 	void shutdown();
 
+	/// Updates input devices.
+	void update();
+
 	/// Returns the default keyboard.
 	Keyboard& keyboard();