Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 24, 2008, 4:48:13 PM (17 years ago)
Author:
FelixSchulthess
Message:

GraphicsEngine now listening to window events…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/orxonox/GraphicsEngine.cc

    r1090 r1178  
    4040#include <OgreLogManager.h>
    4141#include <OgreTextureManager.h>
    42 #include <OgreRenderWindow.h>
    43 
     42#include "core/InputManager.h"
    4443#include "core/CoreIncludes.h"
    4544#include "core/ConfigValueIncludes.h"
     
    9089  {
    9190    COUT(4) << "*** GraphicsEngine: Destroying objects..." << std::endl;
     91    Ogre::WindowEventUtilities::removeWindowEventListener(this->renderWindow_, this);
    9292    if (this->root_)
    9393      delete this->root_;
     
    184184  {
    185185    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
     186    Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this);
    186187    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    187188    //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
     
    289290        << "*** Ogre: " << message << std::endl;
    290291  }
     292
     293    void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw){
     294        int w = rw->getWidth();
     295        int h = rw->getHeight();
     296        InputManager::getSingleton().setWindowExtents(w, h);
     297    }
     298
     299    void GraphicsEngine::windowResized(Ogre::RenderWindow *rw){
     300        int w = rw->getWidth();
     301        int h = rw->getHeight();
     302        InputManager::getSingleton().setWindowExtents(w, h);
     303    }
     304
     305    void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw){
     306        int w = rw->getWidth();
     307        int h = rw->getHeight();
     308        InputManager::getSingleton().setWindowExtents(w, h);
     309    }
    291310}
Note: See TracChangeset for help on using the changeset viewer.