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


C++ CPVRTModelPOD::ReadFromFile方法代码示例

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


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

示例1: ReadFromFile

/*!****************************************************************************
 @Function		ReadFromFile
 @Input			pszFilename		filename of file to read
 @Return		bool			true if no error occured
 @Description	Loads POD file
******************************************************************************/
bool CModel::ReadFromFile(const char* const pszFilename)
{
	return m_Scene.ReadFromFile(pszFilename) == PVR_SUCCESS;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例2: PPLProcessingScoped

/*!****************************************************************************
 @Function		InitApplication
 @Return		bool		true if no error occured
 @Description	Code in InitApplication() will be called by PVRShell once per
				run, before the rendering context is created.
				Used to initialize variables that are not dependant on it
				(e.g. external modules, loading meshes, etc.)
				If the rendering context is lost, InitApplication() will
				not be called again.
******************************************************************************/
bool OGLES3PVRScopeRemote::InitApplication()
{
	// We want a data connection to PVRPerfServer
	{
		m_psSPSCommsData = pplInitialise("PVRScopeRemote", 14);
		m_bCommsError = false;

		// Demonstrate that there is a good chance of the initial data being
		// lost - the connection is normally completed asynchronously.
		pplSendMark(m_psSPSCommsData, "lost", static_cast<unsigned int>(strlen("lost")));

		// This is entirely optional. Wait for the connection to succeed, it will
		// timeout if e.g. PVRPerfServer is not running.
		int nBoolConnected;
		pplWaitForConnection(m_psSPSCommsData, &nBoolConnected, 1, 200);
	}

	CPPLProcessingScoped PPLProcessingScoped(m_psSPSCommsData,
		__FUNCTION__, static_cast<unsigned int>(strlen(__FUNCTION__)), m_i32FrameCounter);

	// set thickness variation of the film
	m_fMaxVariation		= 100.0f;
	// set the minimum thickness of the film
	m_fMinThickness		= 100.0f;

	m_puiVbo = 0;
	m_puiIndexVbo = 0;
	m_i32FrameCounter = 0;
	m_i32Frame10Counter = 0;

	// Get and set the read path for content files
	CPVRTResourceFile::SetReadPath((char*)PVRShellGet(prefReadPath));

	// Get and set the load/release functions for loading external files.
	// In the majority of cases the PVRShell will return NULL function pointers implying that
	// nothing special is required to load external files.
	CPVRTResourceFile::SetLoadReleaseFunctions(PVRShellGet(prefLoadFileFunc), PVRShellGet(prefReleaseFileFunc));

	// Load the scene
	if (m_Scene.ReadFromFile(c_szSceneFile) != PVR_SUCCESS)
	{
		PVRShellSet(prefExitMessage, "ERROR: Couldn't load the .pod file\n");
		return false;
	}

	// set angle of rotation
	m_fAngleY = 0.0f;

	/*
		Remotely editable library items
	*/
	if(m_psSPSCommsData)
	{
		SSPSCommsLibraryItem	asItems[8];
		unsigned int			nItemCount = 0;

		/*
			Want editable shaders
		*/
		CPVRTResourceFile FragShaderFile(c_szFragShaderSrcFile);
		CPVRTResourceFile VertShaderFile(c_szVertShaderSrcFile);
		struct SLibList
		{
			const char				* const pszName;
			const CPVRTResourceFile	* const pFile;
		}
		aShaders[2] =
		{
			{ c_szFragShaderSrcFile,	&FragShaderFile },
			{ c_szVertShaderSrcFile,	&VertShaderFile }
		};

		for(unsigned int i = 0; i < sizeof(aShaders) / sizeof(*aShaders); ++i)
		{
			if(aShaders[i].pFile->IsOpen())
			{
				asItems[nItemCount].pszName		= aShaders[i].pszName;
				asItems[nItemCount].nNameLength	= (unsigned int)strlen(aShaders[i].pszName);

				asItems[nItemCount].eType		= eSPSCommsLibTypeString;

				asItems[nItemCount].pData		= (const char*)aShaders[i].pFile->DataPtr();
				asItems[nItemCount].nDataLength	= (unsigned int)aShaders[i].pFile->Size();
				++nItemCount;
			}
		}

		// Want editable: min thickness
		m_sCommsLibMinThickness.fCurrent	= m_fMinThickness;
		m_sCommsLibMinThickness.fMin		= 0.0f;
//.........这里部分代码省略.........
开发者ID:joyfish,项目名称:GameThirdPartyLibs,代码行数:101,代码来源:OGLES3PVRScopeRemote.cpp


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