Understanding the ResourceGroupManager

fletch27502

20-05-2010 17:49:45

Can anyone lead me to the best information on how to understand and use the ResourceGroupManager?? I'm assuming that somewhere in the ogre information there must be a good description of the use of this class, but I haven't found anything sufficient yet.

TIA,
Scott

smiley80

21-05-2010 23:47:52

Basically, you use the ResourceGroupManager to manage the resource locations or find information about your resources.

Adding resource locations:

// Default resource group
ResourceGroupManager.Singleton.AddResourceLocation("path/to/folder", "FileSystem");
ResourceGroupManager.Singleton.AddResourceLocation("path/to/zip/file", "Zip");

// Custom resource groups
ResourceGroupManager.Singleton.AddResourceLocation("path/to/folder", "FileSystem", "myResGrp1");
ResourceGroupManager.Singleton.AddResourceLocation("path/to/zip/file", "Zip", "myResGrp2");

ResourceGroupManager.Singleton.InitialiseAllResourceGroups();


Finding all .png files in the default resource group:
var pngs = ResourceGroupManager.Singleton.FindResourceNames(ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, "*.png");

Manual: http://www.ogre3d.org/docs/manual/manual_8.html
Class reference: http://www.ogre3d.org/docs/api/html/cla ... nager.html

fletch27502

25-05-2010 10:45:44

Calling InitialiseAllResourceGroups() has been my problem. I just figured this out last night, after realizing that all calls to Initialise any other Groups failed after calling to intialise all groups. In order to dynamically load multiple scenes at runtime you need to individually load each group.

Scott