Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 24, 2009, 9:43:34 AM (16 years ago)
Author:
rgrieder
Message:

Added support for non exclusive mouse mode on Windows. This means you get the normal mouse cursor when displaying a GUI menu in windowed mode.
The feature is activated via InputState (InputState::setIsExclusiveMouse(bool)). Whenever that state is on top of the mouse state stack, the input manager reloads if necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/core/GUIManager.cc

    r5661 r5670  
    3737#include <CEGUIExceptions.h>
    3838#include <CEGUIInputEvent.h>
     39#include <CEGUIMouseCursor.h>
    3940#include <CEGUIResourceProvider.h>
    4041#include <CEGUISystem.h>
     
    9697    @return true if success, otherwise false
    9798    */
    98     GUIManager::GUIManager(Ogre::RenderWindow* renderWindow)
     99    GUIManager::GUIManager(Ogre::RenderWindow* renderWindow, const std::pair<int, int>& mousePosition, bool bFullScreen)
    99100        : renderWindow_(renderWindow)
    100101        , resourceProvider_(0)
     
    127128        rootFileInfo_ = Resource::getInfo("InitialiseGUI.lua", "GUI");
    128129        this->luaState_->doFile("InitialiseGUI.lua", "GUI", false);
     130
     131        // Align CEGUI mouse with OIS mouse
     132        guiSystem_->injectMousePosition(mousePosition.first, mousePosition.second);
     133
     134#ifdef ORXONOX_PLATFORM_WINDOWS
     135        // Hide the mouse cursor unless playing in fullscreen mode
     136        if (!bFullScreen)
     137            CEGUI::MouseCursor::getSingleton().hide();
     138#endif
    129139    }
    130140
     
    254264    void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    255265    {
    256         guiSystem_->injectMouseMove(static_cast<float>(rel.x), static_cast<float>(rel.y));
     266        guiSystem_->injectMousePosition(static_cast<float>(abs.x), static_cast<float>(abs.y));
    257267    }
    258268    void GUIManager::mouseScrolled(int abs, int rel)
Note: See TracChangeset for help on using the changeset viewer.