Time for action — returning true in the frameStarted function

Now we are going to modify the behavior of our FrameListener to see how this changed its behavior.

  1. Change frameStarted to return true:
    bool frameStarted(const Ogre::FrameEvent& evt)
    {
    std::cout << «Frame started» << std::endl;
    return true;
    }
    
  2. Compile and run the application. Before the application closes directly, you will see a short glimpse of the rendered scene and there should be the two following lines in the output:

    Frame started

    Frame queued

What just happened?

Now, the frameStarted function returns true and this lets Ogre 3D continue to render until false is returned by the frameRenderingQueued function. We see a scene this time because directly after the frameRenderingQueued 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.