Cegui, Ogre3D and Me

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

User avatar
ArKada
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Fri Jan 23, 2009 14:46

Cegui, Ogre3D and Me

Postby ArKada » Fri Jan 23, 2009 14:54

Hello all !
I'm a french user of Ogre3d and now i want to use Cegui for my game Gui.
I'm reading all they tutorials and i test, BUT there is a small problem, when i try to load a sheme, it reply that the file is in any ressource group or that the file is not finded.
I've include all the Cegui headers and used CEGUI Namespace.

Code: Select all

//-- Activation de CEGUi --//
    RdrGui = new OgreCEGUIRenderer(Fenetre,RENDER_QUEUE_OVERLAY,false,3000,SceneMenu);
    GuiSys = new System(RdrGui);
    Logger::getSingleton().setLoggingLevel(Informative);


    //-- Chargement du skin --//
    SchemeManager::getSingleton().loadScheme((utf8*)"TaharezLook.scheme");


The processus return 3. :shock: (i've only write these line for Cegui and RdrGui and GuiSys are defined into my Global Application Class)

Thank to help me :roll: esle i can go die in fire... :twisted:

ArKada

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Postby Jamarr » Fri Jan 23, 2009 16:48


User avatar
ArKada
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Fri Jan 23, 2009 14:46

Postby ArKada » Fri Jan 23, 2009 17:34

No i've read this but i don't understand anything, i'm french, and a lot of functions in this tutorial doesn't work. Can you explain me ?
Thanks

ArKada

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Postby Jamarr » Fri Jan 23, 2009 18:53

Actually I did not realize you where using Ogre. I don't use Ogre, but from what I have heard I think you need to setup your resource paths using Ogre; how you do that I have no idea...

gamecat
Just popping in
Just popping in
Posts: 20
Joined: Mon Jan 12, 2009 06:40
Location: SF Bay Area

Postby gamecat » Sat Jan 24, 2009 09:56

I'm currently using Ogre with the version 6.0 CEGUI that they provided with their download. See if you can build and run the Demo_GUI program in Samples/GUI.

Here's what my resources.cfg file looks like...

# Resource locations to be added to the 'boostrap' path
# This also contains the minimum you need to use the Ogre example framework
[Bootstrap]
Zip=./Media/packs/OgreCore.zip

# Resource locations to be added to the default path
[General]
FileSystem=./Media
FileSystem=./Media/fonts
FileSystem=./Media/materials/programs
FileSystem=./Media/materials/scripts
FileSystem=./Media/materials/textures
FileSystem=./Media/models
FileSystem=./Media/overlays
FileSystem=./Media/particle
FileSystem=./Media/gui
FileSystem=./Media/DeferredShadingMedia
Zip=./Media/packs/cubemap.zip
Zip=./Media/packs/cubemapsJS.zip
Zip=./Media/packs/ogretestmap.zip

I'm currently trying to build the latest CEGUI for MinGW, but not having much success so far. :-/

User avatar
ArKada
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Fri Jan 23, 2009 14:46

Postby ArKada » Mon Jan 26, 2009 06:24

No, i've the same Ressource file, but it reply again that it can found the sheme file. And the demo_Gui application run perfectly.

I've add in my program they Functions to set they deefaultressourceprovider, but a the first line the compilator crash and return : "Cannot convert RessourceProvider to DefaultRessourceProvider"
But i don't have found any function to return a defaultRessourceProvider.

Code: Select all

DefaultResourceProvider* drp = System::getSingleton().getResourceProvider();


SomeOne has an idea ?

ArKada

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

Postby CrazyEddie » Mon Jan 26, 2009 09:11

Hi,

With regards to ResourceProvider objects, it is correct that the ResourceProvider that Ogre creates (which is a CEGUI:: OgreCEGUIResourceProvider) cannot be cast and used as a DefaultResourceProvider because these are not compatible types; the tutorial does mention this, although I understand there maybe a language barrier / understanding issue there :)

Since the Ogre Gui demo is working, the approach that you should have taken is to look at your own code and look at the code in the Ogre Gui demo and note all of the differences - therein you will find the cause of your issue. For my money, I think you're mistakenly trying to load "TaharezLook.scheme" which is not provided by Ogre, they use "TaharezLookSkin.scheme" instead.

HTH

CE.

User avatar
ArKada
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Fri Jan 23, 2009 14:46

Postby ArKada » Wed Jan 28, 2009 16:20

Sorry for my late Reply :roll:
I've solve one part of my problem with this Subject :
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=3440

But at the end, the process return an another 3 ... :cry:
and it reply in the Ogre.log : 17:03:20: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource TaharezLookSkin.scheme in resource group Interface or any other group. in ResourceGroupManager::openResource at C:\Ogre_Shoggoth\OgreMain\src\OgreResourceGroupManager.cpp (line 753)

I need add manually they ressource with a function ??

And when the compilor crash with this 2 lines of code :

Code: Select all

XercesParser::setSchemaDefaultResourceGroup("Interface");
Font::setDefaultResourceGroup("Interface");


It reply that "XercesParcer" and "Font" have not been declared

What did i can do to declare these two things ?


ArKada

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

Postby CrazyEddie » Thu Jan 29, 2009 09:29

ArKada wrote:17:03:20: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource TaharezLookSkin.scheme in resource group Interface or any other group. in ResourceGroupManager::openResource at C:\Ogre_Shoggoth\OgreMain\src\OgreResourceGroupManager.cpp (line 753)

This tells me that it's looking in the place you want it to (that being the "Interface" resource group), but that it can't find the requested file within that group. I think this means that either the file is really not in the specified location, or that the resource group has not been specified correctly - either by calling appropriate Ogre functions (that I can't remember off the top of my head), or more likely within a "Resources.cfg" file.

ArKada wrote:And when the compilor crash with this 2 lines of code :

Code: Select all

XercesParser::setSchemaDefaultResourceGroup("Interface");
Font::setDefaultResourceGroup("Interface");


It reply that "XercesParcer" and "Font" have not been declared

What did i can do to declare these two things ?

This error basically means you are missing header file includes. The main CEGUI.h header will bring in most things (like the CEGUIFont.h header needed in this case), though for Xerces you'll need to explicitly include that module's header file (and also link to the lib for the module). The header is "XMLParserModules/XercesParser/CEGUIXercesParser.h" - though note that if you're using the CEGUI version supplied by the Ogre project, you only have access to the Expat module and not the Xerces one.

CE.

User avatar
ArKada
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Fri Jan 23, 2009 14:46

Postby ArKada » Thu Jan 29, 2009 14:07

Okay Boys ! :D
I have a good and two Bad news... :?
The Good news : I managed to start a cegui scene ! :D (The path for the ressource group was'nt correct) :roll:
The first Bad News : 'Font' was not declared another.

Code: Select all

Font::setDefaultResourceGroup("Interface");


Reply from the compilor :

Code: Select all

error : 'Font' has not been declared.


I don't know were can been the error because i've put all they headers need to CEgui. (CEGUI.h , OgreCEGUIRenderer.h , OgreCEGUIResourceProvider.h)

And the last Bad News : If i try to compile without 'Font', all work,
but nothing happens. Yet i've put this line to define the mouse cursor:

Code: Select all

MouseCursor::getSingleton().setImage((utf8*)"TaharezLook",(utf8*)"MouseArrow");


Before i've invoked this line :

Code: Select all

SchemeManager::getSingleton().loadScheme((utf8*)"TaharezLookSkin.scheme");


Anyone can help me ? :wink:

ArKada, End Of Transmission

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

Postby CrazyEddie » Thu Jan 29, 2009 14:35

Ok, a couple of things...

With regards to the mouse cursor, you should swap those parts of the code around. Meaning you should call the MouseCursor::setImage after you've loaded the scheme and not before (otherwise you get an unknown object error/exception).

As far as the font issue, that's odd. Can you try using the namespace qualifier? So:

Code: Select all

CEGUI::Font::setDefaultResourceGroup("Interface");


CE.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu Jan 29, 2009 19:06

Also, you need to call the CEGUI::System::getSingleton().renderGUI() method within your rendering loop to see anything.

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

Postby CrazyEddie » Fri Jan 30, 2009 09:26

Also, you should set a default mouse cursor as mentioned in the tutorials rather than relying on MouseCursor::setImage, using setImage alone - with no default initialised - will normally result in your mouse cursor disappearing at some point.

Pompei2 wrote:Also, you need to call the CEGUI::System::getSingleton().renderGUI() method within your rendering loop to see anything.

While that is definitely true, the Ogre renderer module actually takes care of this automagically due to the way it hooks the Ogre rendering process. So unless you have a very specialised app, it's usually okay to skip this step when using Ogre.

CE.

User avatar
ArKada
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Fri Jan 23, 2009 14:46

Postby ArKada » Fri Jan 30, 2009 15:38

Sorry all, but it doesn't work... :cry:
I tried to add :

Code: Select all

System::getSingleton().setDefaultMouseCursor( "TaharezLook", "MouseArrow" );


before The

Code: Select all

MouseCursor::getSingleton().setImage((utf8*)"TaharezLook",(utf8*)"MouseArrow");


line. But there is no change... :?

And i always have the problem with "Font" (Font has not been declared)

And without or With : the rendergui method.

Anything Happens

ArKada

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

Postby CrazyEddie » Sat Jan 31, 2009 08:40

Hi,

Sorry to hear that you're still wrestling with this.

Can you post all your code - well at least if it's just the basic app initialisation and CEGUI set up and what have you. Meaning if you have 20K lines or something, do not post that, hehe ;)

I suspect it's likely something fairly simple that's wrong, but without seeing everything in context, the chances of guessing what the issue is are dropping with every additional post (or in other words, I've run out of ideas based on the info provided) :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests