Time for action — adding compositors

Having almost finished our application, we are going to add compositors to make the application more interesting.

  1. We are going to use compositors in our FrameListener, so we need a member variable containing the viewport:
    Ogre::Viewport* _viewport;
    
  2. We also are going to need to save which compositor is turned on; add three Booleans for this task:
    bool _comp1, _comp2, _comp3;
    
  3. We are going to use keyboard input to switch the compositors on and off. To be able to differentiate between key presses, we need to know the previous state of the key:
    bool _down1, _down2, _down3;
    
  4. Change the constructor of the FrameListener to take the viewport as a parameter:
    MyFrameListener(Ogre::RenderWindow* win,Ogre::Camera* cam,Ogre::Viewport* ...

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.