Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 4:49:41 PM (15 years ago)
Author:
rgrieder
Message:

Moved grab/ungrab mouse hack for Linux from InputManager to Mouse.

File:
1 edited

Legend:

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

    r3274 r3276  
    6161#include "Keyboard.h"
    6262
    63 // HACK (include this as last, X11 seems to define some macros...)
    64 #ifdef ORXONOX_PLATFORM_LINUX
    65 #  include <ois/linux/LinuxMouse.h>
    66 #endif
    67 
    6863namespace orxonox
    6964{
    7065    SetConsoleCommand(InputManager, calibrate, true);
    7166    SetConsoleCommand(InputManager, reload, false);
    72 #ifdef ORXONOX_PLATFORM_LINUX
    73     SetConsoleCommand(InputManager, grabMouse, true);
    74     SetConsoleCommand(InputManager, ungrabMouse, true);
    75 #endif
    7667    SetCommandLineSwitch(keyboard_no_grab).information("Whether not to exclusively grab the keyboard");
    7768
     
    914905        getInstance().reloadInputSystem();
    915906    }
    916 
    917 
    918     // ############################################################
    919     // #####                   ugly hacks                     #####
    920     // ##########                                        ##########
    921     // ############################################################
    922 
    923 #ifdef ORXONOX_PLATFORM_LINUX
    924     void InputManager::grabMouse()
    925     {
    926         OIS::LinuxMouse* linuxMouse = dynamic_cast<OIS::LinuxMouse*>(singletonRef_s->mouse_);
    927         assert(linuxMouse);
    928         linuxMouse->grab(true);
    929     }
    930 
    931     void InputManager::ungrabMouse()
    932     {
    933         OIS::LinuxMouse* linuxMouse = dynamic_cast<OIS::LinuxMouse*>(singletonRef_s->mouse_);
    934         assert(linuxMouse);
    935         linuxMouse->grab(false);
    936     }
    937 #endif
    938907}
Note: See TracChangeset for help on using the changeset viewer.