Mogre custom Resource is it possible ??

koirat

15-06-2009 20:51:47

Is it possible to make custom resource, (sound to be more specific) and use Ogre File System for my own data.

http://www.ogre3d.org/wiki/index.php/Advanced_Tutorial_1
This article show how to do it, but since it needs inheritance of Ogre::Resource and Ogre::ResourceManager i'm posting this question.

smiley80

15-06-2009 21:50:14

Ogre 'loads' all files from the resource paths, no matter whether a resource is defined for them.
For instance, this should write the fullpath of all wave files found in the default resource group to the console:

FileInfoListPtr fiptr = ResourceGroupManager.Singleton.FindResourceFileInfo(ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, "*.wav");
for (int i = 0; i < fiptr.Count; i++)
{
FileInfo_NativePtr fi = fiptr[i];
if (fi.archive.Type.Contains("FileSystem"))
{
Console.WriteLine(Path.Combine(fi.archive.Name, fi.filename));
}
}


Resource and ResourceManager are handy if you want to process the files automatically when they are loaded.