2010-07-10 11:29:44 +00:00
|
|
|
#ifndef MANGLE_INPUT_OGREINPUTFRAME_H
|
|
|
|
#define MANGLE_INPUT_OGREINPUTFRAME_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
This Ogre FrameListener calls capture() on an input driver every frame.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <OgreFrameListener.h>
|
|
|
|
#include "../driver.hpp"
|
|
|
|
|
|
|
|
namespace Mangle {
|
|
|
|
namespace Input {
|
|
|
|
|
|
|
|
struct OgreInputCapture : Ogre::FrameListener
|
|
|
|
{
|
|
|
|
Mangle::Input::Driver &driver;
|
|
|
|
|
2010-07-27 10:12:06 +00:00
|
|
|
OgreInputCapture(Mangle::Input::Driver &drv)
|
2010-07-10 11:29:44 +00:00
|
|
|
: driver(drv) {}
|
|
|
|
|
2010-07-27 10:12:06 +00:00
|
|
|
bool frameStarted(const Ogre::FrameEvent &evt)
|
2010-07-10 11:29:44 +00:00
|
|
|
{
|
|
|
|
driver.capture();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
2010-07-27 10:12:06 +00:00
|
|
|
}}
|
2010-07-10 11:29:44 +00:00
|
|
|
|
|
|
|
#endif
|