Time for action — experimenting with the FrameListener implementation

Using the console printing we are going to inspect when the FrameListener is called.

  1. First let each function print a message to the console when it is called:
    bool frameStarted(const Ogre::FrameEvent& evt)
    {
    std::cout << «Frame started» << std::endl;
    return false;
    }
    bool frameEnded(const Ogre::FrameEvent& evt)
    {
    std::cout << «Frame ended» << std::endl;
    return false;
    }
    bool frameRenderingQueued(const Ogre::FrameEvent& evt)
    {
    std::cout << «Frame queued» << std::endl;
    return false;
    }
    
  2. Compile and run the application; in the console you should find the first string – Frame started.

What just happened?

We added a "debug" output to each of the FrameListener functions to see which function ...

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.