Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 26, 2008, 11:39:55 PM (16 years ago)
Author:
rgrieder
Message:
  • removed getRoot() from GaphicsEngine —> added getRenderWindow() —> added 3 function to control render loop
  • rearranged the sequence of methods in Orxonox.cc to make it a little bit more logical
  • added deletion code in Orxonox.cc destructor
  • fixed a bug in AudioManger destructor
  • fixed a bug in InputHandler destroy()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/InputHandler.cc

    r928 r929  
    4444    @brief Constructor only resets the pointer values to 0.
    4545  */
    46   InputHandler::InputHandler()
     46  InputHandler::InputHandler() :
     47      mouse_(0), keyboard_(0), inputSystem_(0),
     48      uninitialized_(true)
    4749  {
    4850    //RegisterObject(InputHandler);
    49     this->mouse_       = 0;
    50     this->keyboard_    = 0;
    51     this->inputSystem_ = 0;
     51  }
     52
     53  /**
     54    @brief Destructor only called at the end of the program
     55  */
     56  InputHandler::~InputHandler()
     57  {
     58    this->destroy();
    5259  }
    5360
     
    7178  void InputHandler::initialise(size_t windowHnd, int windowWidth, int windowHeight)
    7279  {
    73     if (!inputSystem_)
     80    if (this->uninitialized_ || !this->inputSystem_)
    7481    {
    7582      // Setup basic variables
     
    104111        this->setWindowExtents(windowWidth, windowHeight);
    105112      }
     113
     114      uninitialized_ = false;
    106115    }
    107116
     
    120129  void InputHandler::destroy()
    121130  {
    122     this->inputSystem_->destroyInputObject(this->mouse_);
    123     this->inputSystem_->destroyInputObject(this->keyboard_);
    124     OIS::InputManager::destroyInputSystem(this->inputSystem_);
    125 
    126     //TODO: If the InputHandler has been destroyed, how does it know?
     131    if (!this->inputSystem_)
     132    {
     133      this->inputSystem_->destroyInputObject(this->mouse_);
     134      this->inputSystem_->destroyInputObject(this->keyboard_);
     135      OIS::InputManager::destroyInputSystem(this->inputSystem_);
     136    }
     137
     138    this->uninitialized_ = true;
    127139  }
    128140
Note: See TracChangeset for help on using the changeset viewer.