Mouse problems

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Bobo7581
Just popping in
Just popping in
Posts: 4
Joined: Wed Feb 23, 2005 12:12
Location: England, Bristol
Contact:

Mouse problems

Postby Bobo7581 » Wed Feb 23, 2005 12:32

I don't know if anyone can help me, but i'm having problems with using the mouse in CEGUI... I am using Ogre 1.0 and have basically comented out and adjust the Gui tutorial that comes standard with that. My create Scene function is below..

Code: Select all

void GuiApplication::createScene(void)
{
   // Setup the scene
   ...................

   // setup GUI system
   mGUIRenderer = new CEGUI::OgreRenderer(mWindow,Ogre::RENDER_QUEUE_OVERLAY, false, 3000);
   mGUISystem = new CEGUI::System(mGUIRenderer);
   CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);

   // load scheme and set up defaults
   CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLook.scheme");
   mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
   mGUISystem->setDefaultFont((CEGUI::utf8*)"Tahoma-12");

   // Main bits loads and shows my layout
   guiWindow = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"gamegui.layout");
   mGUISystem->setGUISheet(guiWindow);

   // To handle events
   setupEventHandlers();
}


The main problem i am having is with my mouse... It seems to be random as to whether it shows it or not. I can't really understand it. I have set the scene up with the standard GuiFrameListener from the tutorial and adjusted to my own layout, posted here

I have compiled this and get no errors and even run it and sometimes it works and then seems to not work for a while, i don't know if my layout is wrong or code, has any body else had any problems with the mouse or are there any common faults that i should know about...

Thanks for any help

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Mouse problems

Postby CrazyEddie » Thu Feb 24, 2005 09:30

There's no known bugs in the mouse related code. I have no immediate idea what could be wrong; on a run when things do not work, is there anything in CEGUI.log that indicates where the problem may lie?

CE

User avatar
Bobo7581
Just popping in
Just popping in
Posts: 4
Joined: Wed Feb 23, 2005 12:12
Location: England, Bristol
Contact:

Re: Mouse problems

Postby Bobo7581 » Thu Feb 24, 2005 12:51

Sorry, my fault the problem in case anybody is wondering seems to be because i am trying to implement mulitple screens and switching between them, i had another frame listener based on ExampleFrameListener running that seemed to be conflicting with the GuiFrameListener, maybye they both try and grab the mouse? i don't really know...

One problem i now have, in case anybody knows the answer is that i have implemented mulitple scenes in Ogre which switch nicely between each other, hiding and showing the gui with guiWindow->setVisible(bool); and changing the other scenes by mSceneMgr->clearScene(); and setting up new nodes etc.

The problem lies however in when i want to have a different framelistener for each scene...

With my normal scenes in ogre,

Code: Select all

   
{
   mFrameListener = new    AlleyRoomSceneFrameListener(mWindow,mCamera,mSceneController);
   mRoot->addFrameListener(mFrameListener);
}


and

Code: Select all

{
   mRoot->removeFrameListener(mFrameListener);
   if (mFrameListener) delete mFrameListener;
}


seem to work fine removing and adding framelisteners, although i seem to have problems with the GuiFrameListener. The framelistener seems to add okay with:

Code: Select all

{
   mFrameListener = new GuiFrameListener(mWindow, mCamera,     mGUIRenderer);
   mRoot->addFrameListener(mFrameListener);
}


but doesn't seem to be removed with:

Code: Select all

{
   mRoot->removeFrameListener(mFrameListener);
}


causing a few problems in my scene, and specifically a segmenation fault when i try and return to the gui and call "mFrameListener = new GuiFrameListener(mWindow, mCamera, mGUIRenderer);" again...

I have tried to detroy the framelistener with "if (mFrameListener) delete mFrameListener;" however this just seems to seg fault even though i have the if statement to test first...

Is there a desired way to handle adding and removing framelisteners for new scenes and/or even closing down a GUI to enter into a scene and return back to it. If this is more of an Ogre Question, please tell me and i'll ask them, but it just seems that seeing as a GUI is not connected to a scene node and doesn't get removed in clearScene() etc. that it is slightly different and that there may be a specific way to handle leaving and returning to a gui...

thanks for any help...

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Mouse problems

Postby CrazyEddie » Thu Feb 24, 2005 19:29

I'm going to cop out and suggest to ask on the Ogre forums :oops: I don't feel I have enough experience with Ogre to be able to advise, and the whole frame listener thing is definately more of an Ogre thing than a CEGUI thing.

I'd be interested in the outcome though, especially if there's anything that may affect other users :)

CE.

User avatar
Emmeran
Quite a regular
Quite a regular
Posts: 46
Joined: Wed Jan 12, 2005 12:06
Location: Germany, near Nuremberg
Contact:

Re: Mouse problems

Postby Emmeran » Sun Feb 27, 2005 15:44

you get the segfault after delete mFrameListener without removeFrameListener(), because mRoot tries to access it's mFrameListener after your deletion -> segfault

but removeFrameListener should actually work...


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 8 guests