Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3005


Ignore:
Timestamp:
May 21, 2009, 11:57:52 AM (15 years ago)
Author:
rgrieder
Message:

Ugly hacking for a nearing presentation
You should now be able to grab and ungrab the mouse under linux (totally not tested since I'm using windows)

Location:
code/branches/netp3/src/core/input
Files:
2 edited

Legend:

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

    r2896 r3005  
    4242#include "ois/OISInputManager.h"
    4343
     44// HACK
     45#ifdef ORXONOX_PLATFORM_LINUX
     46#  include "ois/linux/LinuxMouse.h"
     47#endif
     48
    4449#include "util/Exception.h"
    4550#include "core/Clock.h"
     
    14691474        getInstance().reloadInputSystem(joyStickSupport);
    14701475    }
     1476
     1477
     1478    // ############################################################
     1479    // #####                   ugly hacks                     #####
     1480    // ##########                                        ##########
     1481    // ############################################################
     1482
     1483#ifdef ORXONOX_PLATFORM_LINUX
     1484    void InputManager::grabMouse()
     1485    {
     1486        OIS::LinuxMouse* linuxMouse = dynamic_cast<OIS::LinuxMouse*>(this->mouse_);
     1487        assert(linuxMouse);
     1488        linuxMouse->grab(true);
     1489    }
     1490
     1491    void InputManager::ungrabMouse()
     1492    {
     1493        OIS::LinuxMouse* linuxMouse = dynamic_cast<OIS::LinuxMouse*>(this->mouse_);
     1494        assert(linuxMouse);
     1495        linuxMouse->grab(false);
     1496    }
     1497#endif
    14711498}
  • code/branches/netp3/src/core/input/InputManager.h

    r2896 r3005  
    137137        bool requestEnterState     (const std::string& name);
    138138        bool requestLeaveState     (const std::string& name);
     139
     140#ifdef ORXONOX_PLATFORM_LINUX
     141        // HACK!
     142        void grabMouse();
     143        void ungrabMouse();
     144#endif
    139145
    140146        void update(const Clock& time);
Note: See TracChangeset for help on using the changeset viewer.