From 9f21081c13f70bc41e20b50c19ed2dac9b458833 Mon Sep 17 00:00:00 2001 From: Nicolay Korslund Date: Sat, 10 Jul 2010 13:29:44 +0200 Subject: [PATCH] Added ogre input capturer --- input/clients/ogre_input_capture.hpp | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 input/clients/ogre_input_capture.hpp diff --git a/input/clients/ogre_input_capture.hpp b/input/clients/ogre_input_capture.hpp new file mode 100644 index 0000000000..6a7beae4d2 --- /dev/null +++ b/input/clients/ogre_input_capture.hpp @@ -0,0 +1,29 @@ +#ifndef MANGLE_INPUT_OGREINPUTFRAME_H +#define MANGLE_INPUT_OGREINPUTFRAME_H + +/* + This Ogre FrameListener calls capture() on an input driver every frame. + */ + +#include +#include "../driver.hpp" + +namespace Mangle { +namespace Input { + + struct OgreInputCapture : Ogre::FrameListener + { + Mangle::Input::Driver &driver; + + ExitListener(Mangle::Input::Driver &drv) + : driver(drv) {} + + bool frameStarted(const FrameEvent &evt) + { + driver.capture(); + return true; + } + }; +} + +#endif