im adding cegui to an existing Ogre project of mine. i initially set up cegui like this:
Code: Select all
mGUIRenderer = new CEGUI::OgreCEGUIRenderer(win, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, sceneMgr);
mGUISystem = new CEGUI::System(mGUIRenderer);
CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseMoveCursor");
CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseMoveCursor");
this just displays the cursor (a '+' sign) in the centre of the screen when the app first loads up. all i am trying to do is make it move round the screen by using the mouse! so simple! but im having problems. as soon as i touch the mouse, the cursor disappears. note: i dont actually see a mouse cursor when the app first loads up, i see the '+' sign. i would expect that when i move the mouse around, the cursor turns into a pointer.
now, i handle input using OIS, not Ogre's ExampleFrameListener. in my frameStarted method, i call mouse->capture (OIS functionality here), and then in my mouseMoved event i do:
Code: Select all
bool OISManager::mouseMoved( const OIS::MouseEvent &arg)
{
int width = mGUIManager->GetOgreCEGUIRenderer()->getWidth();
int height = mGUIManager->GetOgreCEGUIRenderer()->getHeight();
double x = arg.state.relX * width;
double y = arg.state.relY * height;
CEGUI::System::getSingleton().injectMouseMove(x, y);
return true;
}
so you can see that the argument that gets passed is an OIS::MouseEvent, and not Ogre::MouseEvent. this is the only difference that i can see between the tutorial on the Ogre wiki, and my app. i can still get relX and relY from the OIS argument, and i calculate the x and y screen positions and then call injectMouseMove(x, y). i have set a breakpoint on this function and it definately hits, and i can see x and y have values.
so why does the mouse cursor just disappear? is there something else i need to do after this? have i forgot something blindingly obvious?