Use of several Ogre Resource Groups?

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

mattekenpis
Just popping in
Just popping in
Posts: 9
Joined: Wed Jan 23, 2013 12:35

Use of several Ogre Resource Groups?

Postby mattekenpis » Tue Feb 05, 2013 15:13

Hi!

We use the Ogre mechanism of Resource Groups to define CEGUI assets paths, and it's working well

Code: Select all

[CEGUI]
FileSystem=../../ui/fonts
FileSystem=../../ui/imagesets
FileSystem=../../ui/schemes


and the lua to set the default ResourceGroup for each kind of assets :

Code: Select all

CEGUI.Imageset:setDefaultResourceGroup("CEGUI")
   CEGUI.Font:setDefaultResourceGroup("CEGUI")
   CEGUI.Scheme:setDefaultResourceGroup("CEGUI")



We would like to load some extra assets that stand in another folders, and we would need to store their paths in another Ogre resource group;

Is there a way to add some more resource group for the assets manager? Something like CEGUI.Imageset:setResourceGroup("CEGUI") .... (without "default") ....?
I couldn't manage to find this in the documentation...

Thanx in advance for the help

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

Re: Use of several Ogre Resource Groups?

Postby CrazyEddie » Wed Feb 06, 2013 09:12

I wonder which documentation you looked at? Because the documentation clearly includes the information you need (it may be lacking in one area, which is that if you load an imageset from a non-default resource group, IIRC the imageset xml has to refer to the correct resource group in the xml - how to do that is also documented).

Since I believe this is documented, please link to the documentation that does not show what you need, so that it may be improved in the future.

CE.

mattekenpis
Just popping in
Just popping in
Posts: 9
Joined: Wed Jan 23, 2013 12:35

Re: Use of several Ogre Resource Groups?

Postby mattekenpis » Wed Feb 06, 2013 12:50

Hi CrazyEddy, and thanx for your answer.

Seeing your answer, I understand how basic was my question.... :p Sorry for the misunderstanding....

With your post I've just realized that there is no need to explicitly set some Resource Groups for CEGUI (has I always done before), and that the CEGUI System automatically fetch the ressources from the path defined in Ogre resources.cfg.
And that:

Code: Select all

void setDefaultResourceGroup (const String &resourceGroup)

is only a way to make some resources overridding some other in case of duplicate names... That's it?

This is the page of the reference that I was refering to: http://www.cegui.org.uk/docs/0.7/classC ... vider.html

Thanx again for the help!

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

Re: Use of several Ogre Resource Groups?

Postby CrazyEddie » Wed Feb 06, 2013 13:24

When using Ogre, there are a few options to how to approach resources and groups (because you can have >1 location for each group - which is what you have).

If you're using that set up where all the resource locations are listed under one group, then the easiest appraoch is to set the default group on the ResourceProvider itself, and not set the per-resource type defaults. This is basically what you have now, I believe (in the previous post). Although you can also set the per resource default groups - it does not matter.

To selectively load some resource from another group, you just pass that group to the call that loads the resource, so:

Code: Select all

...
CEGUI.ImagesetManager:getSingleton():create("AnImageset.imageset", "AResourceGroup")
...


This loads an imageset "AnImageset.imageset" from the explicitly specified resource group "AResourceGroup". You can / may have to also specify the resource group of the underlying image file in the XML - this is done by adding the attribute ResourceGroup="AResourceGroup" to the Imageset tag (and similar for fonts which also have that issue of depending on another resource).

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 26 guests