ogre 资源管理 resourcegroupmanager
2012-06-13 17:44
323 查看
1.一般步骤
ResourceGroupManager::addResourceLocation(dir, type, group);
...
ResourceGroupManager::intializeResourceGroup(group);
然后这个group就不能再加入资源的路径了
2.手动解析文件
http://egamesir.blog.163.com/blog/static/1880960882011739122546/
// 将新的资源搜索路径添加到resourcemanager中
std::string new_location = “c:/location/ogreres”;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
new_location.c_str(),
"FileSystem",
"Ogre",
true);
// 手动解析脚本(以material为例)
Ogre::FileInfoListPtr fileInfoList =
Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(
"Ogre",
"*.material");
for (Ogre::FileInfoList::const_iterator cit=fileInfoList->begin();
cit != fileInfoList->end();
++cit) {
const Ogre::String& name = cit->filename;
const Ogre::String& basename = cit->basename;
Ogre::String sType = cit->archive->getType();
Ogre::String sPath = cit->archive->getName();
if (sType=="FileSystem" && sPath==new_location) {
Ogre::DataStreamPtr pData=
Ogre::ResourceGroupManager::getSingleton().openResource(
basename,"Ogre");
Ogre::MaterialManager::getSingleton().parseScript(
pData, "Ogre");
}
}
3.直接在initialize之后继续加入dir
在initialize之后想加入其他组:先clear一个组,然后在加入想加入的组(刚刚remove掉的如果需要也加加入)
ResourceGroupManager::addResourceLocation(dir, type, group);
...
ResourceGroupManager::intializeResourceGroup(group);
然后这个group就不能再加入资源的路径了
2.手动解析文件
http://egamesir.blog.163.com/blog/static/1880960882011739122546/
// 将新的资源搜索路径添加到resourcemanager中
std::string new_location = “c:/location/ogreres”;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
new_location.c_str(),
"FileSystem",
"Ogre",
true);
// 手动解析脚本(以material为例)
Ogre::FileInfoListPtr fileInfoList =
Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(
"Ogre",
"*.material");
for (Ogre::FileInfoList::const_iterator cit=fileInfoList->begin();
cit != fileInfoList->end();
++cit) {
const Ogre::String& name = cit->filename;
const Ogre::String& basename = cit->basename;
Ogre::String sType = cit->archive->getType();
Ogre::String sPath = cit->archive->getName();
if (sType=="FileSystem" && sPath==new_location) {
Ogre::DataStreamPtr pData=
Ogre::ResourceGroupManager::getSingleton().openResource(
basename,"Ogre");
Ogre::MaterialManager::getSingleton().parseScript(
pData, "Ogre");
}
}
3.直接在initialize之后继续加入dir
在initialize之后想加入其他组:先clear一个组,然后在加入想加入的组(刚刚remove掉的如果需要也加加入)
相关文章推荐
- 用户资源管理DBMS_RESOURCE_MANAGER
- Yarn之ResourceManager资源管理
- 资源管理ResourceManager
- ResourceGroupManager初始化加载资源说明
- WebLogic Server 多租户资源管理(resource consume manager)
- 用户资源管理DBMS_RESOURCE_MANAGER
- Java资源管理之ResourceBundle
- Hadoop 管理工具HUE配置-Yarn Resource Manager HA配置
- 视图控制器中的资源管理 Resource Management in View Controllers [苹果官方文档的翻译]
- ASP.net 2.0 中 WebResource.axd 管理资源的一些知识点
- RBAC新解:基于资源的权限管理(Resource-Based Access Control)
- 基于资源的权限管理(Resource-Based Access Control)
- 使用 Azure CLI 将 IaaS 资源从经典部署模型迁移到 Azure Resource Manager 部署模型
- Android资源管理框架(二)AssetManager创建过程
- 使用 Azure PowerShell 将 IaaS 资源从经典部署模型迁移到 Azure Resource Manager
- IO管理四Usb之resource资源申请
- RBAC新解:基于资源的权限管理(Resource-Based Access Control)
- RBAC新解:基于资源的权限管理(Resource-Based Access Control)