Page 1 of 1

problem introducing CEGUI to an Ogre APP

Posted: Mon Oct 06, 2008 04:34
by syngen101
Hi,

I am having a problem adding a mouse cursor using the following code:

Code: Select all

    CEGUI::OgreCEGUIRenderer* mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow,Ogre::RENDER_QUEUE_OVERLAY,false,3000,mSceneManager);
    CEGUI::System* mGUISystem = new CEGUI::System(mGUIRenderer);
    CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
    mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
    CEGUI::MouseCursor::getSingleton().setImage(CEGUI::System::getSingleton().getDefaultMouseCursor());

When I run my application I am getting a runtime error:

Code: Select all

First-chance exception at 0x762b42eb in DemoForSkull.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x001fd748..
Unhandled exception at 0x762b42eb in DemoForSkull.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x001fd748..

I am adding this code in the 'main' file when i create the scene. Can someone please tell me what is causing this error. If you need to see more code please reply and ask for that.

Thank you in advance

Posted: Mon Oct 06, 2008 07:08
by scriptkid
Hi,

have you already disabled some lines? My guess is that names are not matching. Does the scheme inside the file TaharezLookSkin.scheme has its name attribute set to "TaharezLook"?

You might check the result of getDefaultMouseCursor() for Null first.

HTH.

Posted: Tue Oct 07, 2008 02:48
by syngen101
Hi,

Yes the scheme file has its name attribute set to "TaharezLook", i have tried commenting out certain sections of the code to see what line it seems to be throwing the exception

Code: Select all

 CEGUI::OgreCEGUIRenderer* mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow,Ogre::RENDER_QUEUE_OVERLAY,false,3000,mSceneManager);
    CEGUI::System* mGUISystem = new CEGUI::System(mGUIRenderer);
    //CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
   // mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
    //CEGUI::MouseCursor::getSingleton().setImage(CEGUI::System::getSingleton().getDefaultMouseCursor());

This still throws the same exception, but when i comment out the second line:

Code: Select all

CEGUI::OgreCEGUIRenderer* mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow,Ogre::RENDER_QUEUE_OVERLAY,false,3000,mSceneManager);
    //CEGUI::System* mGUISystem = new CEGUI::System(mGUIRenderer);
    //CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
   // mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
    //CEGUI::MouseCursor::getSingleton().setImage(CEGUI::System::getSingleton().getDefaultMouseCursor());

it gives me the following error in the command prompt window:

Code: Select all

Assertion failed: ms_Singleton, file f:\ogre_cvs_vc9\cegui-0.5\include\ceguisingleton.h, line 79

Posted: Tue Oct 07, 2008 02:55
by syngen101
I found my problem, i forgot to add a couple of dll files. cheers for help anyway

Posted: Tue Oct 07, 2008 07:08
by scriptkid
Ah, okay glad you found it!