Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 3, 2008, 10:23:37 AM (16 years ago)
Author:
rgrieder
Message:
  • not really done a lot, but svn create patch doesn't work with renamed files
File:
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/orxonox/core/InputManager.cc

    r971 r973  
    3535#include "core/Debug.h"
    3636#include "InputEventListener.h"
    37 #include "InputHandler.h"
     37#include "InputManager.h"
    3838
    3939namespace orxonox
     
    4242    @brief The reference to the singleton
    4343  */
    44   InputHandler* InputHandler::singletonRef_s = 0;
     44  InputManager* InputManager::singletonRef_s = 0;
    4545
    4646  /**
    4747    @brief Constructor only resets the pointer values to 0.
    4848  */
    49   InputHandler::InputHandler() :
     49  InputManager::InputManager() :
    5050      mouse_(0), keyboard_(0), inputSystem_(0)
    5151  {
     
    5555    @brief Destructor only called at the end of the program
    5656  */
    57   InputHandler::~InputHandler()
     57  InputManager::~InputManager()
    5858  {
    5959    this->destroyDevices();
     
    6161
    6262  /**
    63     @brief The one instance of the InputHandler is stored in this function.
    64     @return The pointer to the only instance of the InputHandler
    65   */
    66   InputHandler *InputHandler::getSingleton()
     63    @brief The one instance of the InputManager is stored in this function.
     64    @return The pointer to the only instance of the InputManager
     65  */
     66  InputManager *InputManager::getSingleton()
    6767  {
    6868    if (!singletonRef_s)
    69       singletonRef_s = new InputHandler();
     69      singletonRef_s = new InputManager();
    7070    return singletonRef_s;
    7171  }
     
    7878    @param windowHeight The height of the render window
    7979  */
    80   bool InputHandler::initialise(size_t windowHnd, int windowWidth, int windowHeight)
     80  bool InputManager::initialise(size_t windowHnd, int windowWidth, int windowHeight)
    8181  {
    8282    if (!this->inputSystem_)
     
    9898        // Create inputsystem
    9999        inputSystem_ = OIS::InputManager::createInputSystem(paramList);
    100         COUT(ORX_DEBUG) << "*** InputHandler: Created OIS input system" << std::endl;
     100        COUT(ORX_DEBUG) << "*** InputManager: Created OIS input system" << std::endl;
    101101
    102102        // create a keyboard. If none are available the exception is caught.
    103103        keyboard_ = static_cast<OIS::Keyboard*>(inputSystem_->createInputObject(OIS::OISKeyboard, true));
    104104        keyboard_->setEventCallback(this);
    105         COUT(ORX_DEBUG) << "*** InputHandler: Created OIS mouse" << std::endl;
     105        COUT(ORX_DEBUG) << "*** InputManager: Created OIS mouse" << std::endl;
    106106
    107107        // create a mouse. If none are available the exception is caught.
    108108        mouse_ = static_cast<OIS::Mouse*>(inputSystem_->createInputObject(OIS::OISMouse, true));
    109109        mouse_->setEventCallback(this);
    110         COUT(ORX_DEBUG) << "*** InputHandler: Created OIS keyboard" << std::endl;
     110        COUT(ORX_DEBUG) << "*** InputManager: Created OIS keyboard" << std::endl;
    111111
    112112        // Set mouse region
     
    122122    }
    123123
    124     COUT(ORX_DEBUG) << "*** InputHandler: Loading key bindings..." << std::endl;
     124    COUT(ORX_DEBUG) << "*** InputManager: Loading key bindings..." << std::endl;
    125125    // load the key bindings
    126126    InputEvent empty = {0, false, 0, 0, 0};
     
    130130    //assign 'abort' to the escape key
    131131    this->bindingsKeyPressed_[(int)OIS::KC_ESCAPE].id = 1;
    132     COUT(ORX_DEBUG) << "*** InputHandler: Loading done." << std::endl;
     132    COUT(ORX_DEBUG) << "*** InputManager: Loading done." << std::endl;
    133133
    134134    return true;
     
    138138    @brief Destroys all the created input devices.
    139139  */
    140   void InputHandler::destroyDevices()
    141   {
    142     COUT(ORX_DEBUG) << "*** InputHandler: Destroying InputHandler..." << std::endl;
     140  void InputManager::destroyDevices()
     141  {
     142    COUT(ORX_DEBUG) << "*** InputManager: Destroying InputManager..." << std::endl;
    143143    if (this->mouse_)
    144144      this->inputSystem_->destroyInputObject(mouse_);
     
    151151    this->keyboard_      = 0;
    152152    this->inputSystem_   = 0;
    153     COUT(ORX_DEBUG) << "*** InputHandler: Destroying done." << std::endl;
     153    COUT(ORX_DEBUG) << "*** InputManager: Destroying done." << std::endl;
    154154  }
    155155
     
    157157    @brief Destroys the singleton.
    158158  */
    159   void InputHandler::destroySingleton()
     159  void InputManager::destroySingleton()
    160160  {
    161161    if (singletonRef_s)
     
    165165
    166166  /**
    167     @brief Updates the InputHandler
     167    @brief Updates the InputManager
    168168    @param dt Delta time
    169169  */
    170   void InputHandler::tick(float dt)
     170  void InputManager::tick(float dt)
    171171  {
    172172    //this->mouse_->setEventCallback(this);
     
    185185    @param height the new height of the render window
    186186  */
    187   void InputHandler::setWindowExtents(int width, int height)
     187  void InputManager::setWindowExtents(int width, int height)
    188188  {
    189189    // Set mouse region (if window resizes, we should alter this to reflect as well)
     
    197197    @param evt The input event that occured.
    198198  */
    199   inline void InputHandler::callListeners(orxonox::InputEvent &evt)
     199  inline void InputManager::callListeners(orxonox::InputEvent &evt)
    200200  {
    201201    for (Iterator<InputEventListener> it = ObjectList<InputEventListener>::start(); it; )
     
    212212    @param e Event information
    213213  */
    214   bool InputHandler::keyPressed(const OIS::KeyEvent &e)
     214  bool InputManager::keyPressed(const OIS::KeyEvent &e)
    215215  {
    216216    callListeners(this->bindingsKeyPressed_[(int)e.key]);
     
    222222    @param e Event information
    223223  */
    224   bool InputHandler::keyReleased(const OIS::KeyEvent &e)
     224  bool InputManager::keyReleased(const OIS::KeyEvent &e)
    225225  {
    226226    return true;
     
    231231    @param e Event information
    232232  */
    233   bool InputHandler::mouseMoved(const OIS::MouseEvent &e)
     233  bool InputManager::mouseMoved(const OIS::MouseEvent &e)
    234234  {
    235235    return true;
     
    241241    @param id The ID of the mouse button
    242242  */
    243   bool InputHandler::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id)
     243  bool InputManager::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id)
    244244  {
    245245    COUT(1) << "asdf" << std::endl;
     
    252252    @param id The ID of the mouse button
    253253  */
    254   bool InputHandler::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id)
     254  bool InputManager::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id)
    255255  {
    256256    return true;
Note: See TracChangeset for help on using the changeset viewer.