Time for action — adding a FrameListener
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 ...
Get Ogre 3D 1.7 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.