Time for action — modifying the number of pixels with user input
We are going to use the knowledge about user input and frame listeners that we have seen in Chapter 3,Camera, Light, and Shadow
- Our application needs
FrameListener
. Add a new private variable to store the pointer to the application:Ogre::FrameListener* FrameListener;
- In the same way,
FrameListener
should also be inited withNULL:
Example79() { FrameListener = NULL; compListener = NULL; }
- And it should be destroyed in the same way:
~Example79() { if(compListener) { delete compListener; } if(FrameListener) { delete FrameListener; } }
- Lets add it and then implement it. The rest of the application class doesn't change:
void createFrameListener() { FrameListener = new Example79FrameListener(mWindow,compListener); ...
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.