Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 14, 2009, 11:50:47 AM (15 years ago)
Author:
rgrieder
Message:

Added window size as static variable to the WindowEventListener interface.
This resolves several hacks and inconveniences in Mouse, InputManager, InGameConsole, GSGraphics and OrxonoxOverlay.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/core/input/Mouse.h

    r3286 r3291  
    3131
    3232#include "InputPrereqs.h"
     33
    3334#include "InputDevice.h"
     35#include "core/WindowEventListener.h"
    3436
    3537namespace orxonox
     
    5355        : public InputDeviceTemplated<MouseTraits>
    5456        , public OIS::MouseListener
     57        , public WindowEventListener
    5558    {
    5659        friend class InputDeviceTemplated<MouseTraits>;
     
    6063    public:
    6164        //! Only sets the clipping size. Initialising is done in the base class.
    62         Mouse(unsigned int id, OIS::InputManager* oisInputManager, unsigned int windowWidth, unsigned int windowHeight);
     65        Mouse(unsigned int id, OIS::InputManager* oisInputManager);
    6366        ~Mouse() { }
    6467
    65         /**
    66         @brief
    67             Adjusts the mouse window metrics.
    68 
    69             This method has to be called every time the size of the window changes.
    70         */
    71         void setMouseClipping(unsigned int width, unsigned int height);
    72         // Returns the width of the mouse window
    73         unsigned int getClippingWidth() const;
    74         // Returns the height of the mouse window
    75         unsigned int getClippingHeight() const;
    76 
    77         // HACK!
    78         static void setMouseClipping_s(unsigned int width, unsigned int height)
    79             { instancePointer_s->setMouseClipping(width, height); }
    80         void setConfigValues() { }
    8168#ifdef ORXONOX_PLATFORM_LINUX
    82         // HACK!
    8369        // TODO: Make this a feature rather than a hack
    84         static void grabMouse();
    85         static void ungrabMouse();
     70        void grabMouse();
     71        void ungrabMouse();
    8672#endif
    8773
     
    10389        bool mouseMoved(const OIS::MouseEvent &arg);
    10490
     91        void windowResized(unsigned int newWidth, unsigned int newHeight);
     92
    10593        // Returns the class name as string
    10694        static std::string getClassNameImpl() { return "Mouse"; }
    107 
    108         // HACK:
    109         static Mouse* instancePointer_s;
    11095    };
    11196}
Note: See TracChangeset for help on using the changeset viewer.