The tutorial targets previous versions of ogre and cegui. Therefore, the. XML format suffix is still used. layout is used for cegui7.1, and the path of the layout file needs to be set under the [general] configuration section When configuring resource. cfg. To solve this problem, you need to take a closer look at how the ResourceManager module handles these configurations. I will provide a detailed description.
Connection problems:
After viewing the cegui and ogreSource codeIn cegui7.1, mguirenderer = & cegui: ogrerenderer: bootstrapsystem ();
SimilarCodeIn ogrerenderer: bootstrapsystem ();
The specific initialization code in is as follows:
Ogrerenderer & Renderer = ogrerenderer: Create (target );
Ogreresourceprovider & Rp = createogreresourceprovider ();
Ogreimagecodec & Ic = createogreimagecodec ();
Among them, ogreresourceprovider has the default resourceprovider in cegui. In ogre, we call bootstrapsystem, which naturally uses ogreresourceprovider. The search for natural resources follows the Ogre configuration rules.
If you try again, you will find that in the windowmanager: loadwindowlayout method
System: getsingleton (). getxmlparser ()-> parsexmlfile (handler, filename, guilayoutschemaname, resourcegroup. Empty ()? D_defaultresourcegroup: resourcegroup); in this line, we find the parsexmlfile method in the class
Expatparser: Public xmlparser, and in expatparser: parsexmlfile, the secret is quickly found: cegui: System: getsingleton (). getresourceprovider ()-> loadrawdatacontainer (filename, rawxmldata, resourcegroup); the problem is that the call relationship is as follows:
Cegui-> initialization (including ogreresourceprovider)-> loadwindowlayout-> parsexmlfile-> getresourceprovider ()-> loadrawdatacontainer
The error is reported in the ResourceManager module of ogre.
As to why we must be in general, I think we didn't provide the name of the Resource Group when loadwindowlayout, so we used the default general group.