can't load mygui resouce from resources.cfg

planB

27-05-2010 12:32:58

hi, everyone!

i'm new here, and i found that can not load mygui resouce from resources.cfg.
i have add the mygui resource folder in ogre's media/mygui, and add this code to resources.cfg
FileSystem=../../media/mygui

in ogre the locateresource cede is below,

void BaseApplication::setupResources(void)
{
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);

// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();

Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}


}


but when i run the app, i cannot see the mygui button and so on.(ogre itself is ok) in the log, show that
Core | Error | ResourceManager : 'core.xml', not found
surely the core.xml is in the media/mygui folder

haibo19981984

28-05-2010 02:27:00

please send a screenshot about your error.
And say carefully about your directory of your bin.
Normally,we set resource as follows:
bin/Media/myGUI
bin/debug/resources.cfg
the directory in resources.cfg should be:FileSystem=../Media/myGUI

planB

30-05-2010 02:19:12

thanks!

my media path is like the ogre1.7sdk.
ogredsk/Media/myGUI
ogredsk/bin/debug/resources.cfg


i add the myGUI in resources.cfg
FileSystem=../../Media/myGUI

the result is that i can not see the button and so on, but if there is caption, i can see the word caption.
i guess that the ogre can not find the mygui picture, though it in the media folder.

Altren

30-05-2010 15:49:00

Usially it is because MyGUI resources is not "General" group and you not informed GUI about it. So you should either put resources into General group or set resource group in MyGUI::OgrePlatform:
mPlatform->initialise(mWindow, mSceneManager, "MyResourceGroup");