Using the console printing we are going to inspect when the FrameListener
is called.
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; }
Compile and run the application; in the console you should find the first string – Frame started.
We added a "debug" output to each of the FrameListener
functions to see which function is getting called. Running the application, we noticed that only the first debug message is printed. The reason is that the frameStarted
function returns false
, which is a signal for the root
instance...