当前位置: 首页>>代码示例>>C++>>正文


C++ MaterialManager::initialise方法代码示例

本文整理汇总了C++中MaterialManager::initialise方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialManager::initialise方法的具体用法?C++ MaterialManager::initialise怎么用?C++ MaterialManager::initialise使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaterialManager的用法示例。


在下文中一共展示了MaterialManager::initialise方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setUp

void MeshWithoutIndexDataTests::setUp()
{
	LogManager::getSingleton().createLog("MeshWithoutIndexDataTests.log", true);
	OGRE_NEW ResourceGroupManager();
	OGRE_NEW LodStrategyManager();
    mBufMgr = OGRE_NEW DefaultHardwareBufferManager();
    mMeshMgr = OGRE_NEW MeshManager();
    archiveMgr = OGRE_NEW ArchiveManager();
    archiveMgr->addArchiveFactory(OGRE_NEW FileSystemArchiveFactory());

	MaterialManager* matMgr = OGRE_NEW MaterialManager();
	matMgr->initialise();
}
开发者ID:brunobg,项目名称:TuxSinbad,代码行数:13,代码来源:MeshWithoutIndexDataTests.cpp

示例2: setUp

void MeshSerializerTests::setUp()
{
	errorFactor = 0.05;

	OGRE_DELETE LogManager::getSingletonPtr();
	mLogManager = OGRE_NEW LogManager();
	mLogManager->createLog("MeshWithoutIndexDataTests.log", false);
	mLogManager->setLogDetail(LL_LOW);

	mFSLayer = OGRE_NEW_T(Ogre::FileSystemLayer, Ogre::MEMCATEGORY_GENERAL)(OGRE_VERSION_NAME);

	OGRE_NEW ResourceGroupManager();
	OGRE_NEW LodStrategyManager();
	OGRE_NEW DefaultHardwareBufferManager();
	OGRE_NEW MeshManager();
	OGRE_NEW SkeletonManager();
	ArchiveManager* archiveMgr = OGRE_NEW ArchiveManager();
	archiveMgr->addArchiveFactory(OGRE_NEW FileSystemArchiveFactory());

	MaterialManager* matMgr = OGRE_NEW MaterialManager();
	matMgr->initialise();

	// Load resource paths from config file
	ConfigFile cf;
	String resourcesPath;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
	resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
#else
	resourcesPath = mFSLayer->getConfigFilePath("bin/resources.cfg");
#endif

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

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

		}
	}

	mMesh = MeshManager::getSingleton().load("knot.mesh", ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);

	getResourceFullPath(mMesh, mMeshFullPath);
	if (!copyFile(mMeshFullPath + ".bak", mMeshFullPath)) {
		// If there is no backup, create one.
		copyFile(mMeshFullPath, mMeshFullPath + ".bak");
	}
	mSkeletonFullPath = "";
	mSkeleton = SkeletonManager::getSingleton().load("jaiqua.skeleton", "Popular").staticCast<Skeleton>();
	getResourceFullPath(mSkeleton, mSkeletonFullPath);
	if (!copyFile(mSkeletonFullPath + ".bak", mSkeletonFullPath)) {
		// If there is no backup, create one.
		copyFile(mSkeletonFullPath, mSkeletonFullPath + ".bak");
	}

	mMesh->reload();
#ifdef OGRE_BUILD_COMPONENT_MESHLODGENERATOR
	{
		MeshLodGenerator().generateAutoconfiguredLodLevels(mMesh);
	}
#endif /* ifdef OGRE_BUILD_COMPONENT_MESHLODGENERATOR */
	mOrigMesh = mMesh->clone(mMesh->getName() + ".orig.mesh", mMesh->getGroup());
}
开发者ID:j-rivero,项目名称:ogre-acornacorn,代码行数:74,代码来源:MeshSerializerTests.cpp


注:本文中的MaterialManager::initialise方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。