Now we are going to modify the behavior of our FrameListener
to see how this changed its behavior.
Change
frameStarted
to returntrue:
bool frameStarted(const Ogre::FrameEvent& evt) { std::cout << «Frame started» << std::endl; return true; }
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
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 is called, the render buffers are swapped before the application gets the possibility to close itself.