Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 27, 2008, 5:15:08 PM (16 years ago)
Author:
rgrieder
Message:
  • added debug output to the InputHandler
  • fixed singleton issues
  • cleaned up Main.cc (replaced WinMain by main)
File:
1 edited

Legend:

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

    r929 r934  
    4343namespace orxonox
    4444{
     45  /**
     46    @brief Captures and distributes mouse and keyboard input.
     47    It resolves the key bindings to InputEvents which can be heard by
     48    implementing the InputEventListener interface.
     49  */
    4550  class _OrxonoxExport InputHandler
    4651        : public Tickable, public OIS::KeyListener, public OIS::MouseListener
    4752  {
    48     //friend ClassIdentifier<InputHandler>;
     53    //friend class ClassIdentifier<InputHandler>;
    4954  public:
    50     void initialise(size_t windowHnd, int windowWidth, int windowHeight);
    51     void destroy();
     55    bool initialise(size_t windowHnd, int windowWidth, int windowHeight);
     56    void destroyDevices();
    5257    void tick(float dt);
    5358    void setWindowExtents(int width, int height);
    5459
     60    // Temporary solutions. Will be removed soon!
    5561    OIS::Mouse    *getMouse()    { return this->mouse_   ; }
    5662    OIS::Keyboard *getKeyboard() { return this->keyboard_; }
    5763
    5864    static InputHandler* getSingleton();
     65    static void destroy();
    5966
    6067  private:
     
    7885    OIS::Mouse        *mouse_;          //!< OIS keyboard
    7986
    80     /**
    81       @bref Tells whether initialise has been called successfully
    82       Also true if destroy() has been called.
    83     */
    84     bool uninitialized_;
    85 
    86     //! denotes the maximum number of different keys there are in OIS.
    87     //! 256 should be ok since the highest number in the enum is 237.
     87    /** denotes the maximum number of different keys there are in OIS.
     88        256 should be ok since the highest number in the enum is 237. */
    8889    static const int numberOfKeys_ = 256;
    8990    //! Array of input events for every pressed key
     
    9293    InputEvent bindingsKeyReleased_[numberOfKeys_];
    9394
    94     //! denotes the maximum number of different buttons there are in OIS.
    95     //! 16 should be ok since the highest number in the enum is 7.
     95    /** denotes the maximum number of different buttons there are in OIS.
     96        16 should be ok since the highest number in the enum is 7. */
    9697    static const int numberOfButtons_ = 16;
    9798    //! Array of input events for every pressed key
     
    100101    InputEvent bindingsButtonReleased_[numberOfButtons_];
    101102
     103    //! Pointer to the instance of the singleton
     104    static InputHandler *singletonRef_s;
    102105  };
    103106}
Note: See TracChangeset for help on using the changeset viewer.