Using the code from before we are going to add our own FrameListener
implementation
Create a new class called
MyFrameListener
exposing three publicly visible event handler functions:class MyFrameListener : public Ogre::FrameListener { public:
First, implement the
frameStarted
function, which for now returnsfalse
to close the application:bool frameStarted(const Ogre::FrameEvent& evt) { return false; }
We also need a
frameEnded
function, which also returnsfalse:
bool frameEnded(const Ogre::FrameEvent& evt) { return false; }
The last function we implement is the
frameRenderingQueued
function, which also returnsfalse:
bool frameRenderingQueued(const Ogre::FrameEvent& evt) { return false; }
The main class needs a point to store the
FrameListener:
MyFrameListener* _listener;
Remember that the constructor needs to set the initial value of the listener to
NULL:
_listener = NULL;
Let the destructor delete the instance:
delete _listener;
At...