Time for action — adding a FrameListener

Using the code from before we are going to add our own FrameListener implementation

  1. Create a new class called MyFrameListener exposing three publicly visible event handler functions:
    class MyFrameListener : public Ogre::FrameListener
    {
    public:
    
  2. First, implement the frameStarted function, which for now returns false to close the application:
    bool frameStarted(const Ogre::FrameEvent& evt)
    {
    return false;
    }
    
  3. We also need a frameEnded function, which also returns false:
    bool frameEnded(const Ogre::FrameEvent& evt)
    {
    return false;
    }
    
  4. The last function we implement is the frameRenderingQueued function, which also returns false:
    bool frameRenderingQueued(const Ogre::FrameEvent& evt)
    {
    return false;
    }
    
  5. 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.