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