problem introducing CEGUI to an Ogre APP

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

syngen101
Just popping in
Just popping in
Posts: 19
Joined: Thu Sep 25, 2008 08:30
Location: Australia

problem introducing CEGUI to an Ogre APP

Postby syngen101 » Mon Oct 06, 2008 04:34

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

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Mon Oct 06, 2008 07:08

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.
Check out my released snake game using Cegui!

syngen101
Just popping in
Just popping in
Posts: 19
Joined: Thu Sep 25, 2008 08:30
Location: Australia

Postby syngen101 » Tue Oct 07, 2008 02:48

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

syngen101
Just popping in
Just popping in
Posts: 19
Joined: Thu Sep 25, 2008 08:30
Location: Australia

Postby syngen101 » Tue Oct 07, 2008 02:55

I found my problem, i forgot to add a couple of dll files. cheers for help anyway

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Oct 07, 2008 07:08

Ah, okay glad you found it!
Check out my released snake game using Cegui!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests