Once again we modify the code to test the behavior of the Frame Listener.
Change
frameRenderingQueued
to returntrue:
bool frameRenderingQueued (const Ogre::FrameEvent& evt) { std::cout << «Frame queued» << std::endl; return true; }
Compile and run the application. You should see Sinbad for a short period of time before the application closes, and the following three lines should be in the console output:
Frame started
Frame queued
Frame ended
Now that the frameRenderingQueued
handler returns true
, it will let Ogre 3D continue to render until the frameEnded
handler returns false
.
Like in the last example, the render buffers were swapped, so we saw the scene for a short period of time. After the frame was rendered, the frameEnded
function returned false
, which closes the application and, in this case, doesn't change anything from our perspective.