forked from mirror/openmw-tes3mp
Added ogre input capturer
This commit is contained in:
parent
18dc065715
commit
9f21081c13
1 changed files with 29 additions and 0 deletions
29
input/clients/ogre_input_capture.hpp
Normal file
29
input/clients/ogre_input_capture.hpp
Normal file
|
@ -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 <OgreFrameListener.h>
|
||||
#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
|
Loading…
Reference in a new issue