1.DXUTFindMediaSearchTypicalDirs()分析:
DXUTFindMediaSearchTypicalDirs()这个函数用于在特定的搜索路径中查找媒体文件,主要供DXUTFindDXSDKMediaFileCch()调用以查找媒体文件。
参数分析:
strSearchPath:函数调用完后将媒体文件的路径返回给该字符串(可能是当前工作目录路径,也可能是全路径)
cchSearch: strSearchPath的长度
strLeaf:指定要查找的媒体文件名
strExePath:当前进程执行文件所在的目录(全路径名)
strExeName:当前进程执行文件名(不包含扩展名)
//--------------------------------------------------------------------------------------
// Search a set of typical directories
//--------------------------------------------------------------------------------------
bool DXUTFindMediaSearchTypicalDirs( WCHAR* strSearchPath, int cchSearch, LPCWSTR strLeaf,
WCHAR* strExePath, WCHAR* strExeName )
2.
DXUTFindDXSDKMediaFileCch()分析
该函数主要用于查找媒体文件。
参数分析:
strDestPath:函数调用成功后将返回媒体文件的全路径名(若在当前工作目录找到该文件则仅返回媒体文件名),若调用失败则返回媒体文件名。
cchDest:strDestPath的长度。
strFilename:要查找的媒体文件名。
//--------------------------------------------------------------------------------------
// Tries to find the location of a SDK media file.
//
// cchDest is the size in WCHARs of strDestPath.
// Be careful not to pass in sizeof(strDest) on UNICODE builds.
//--------------------------------------------------------------------------------------
HRESULT DXUTFindDXSDKMediaFileCch( WCHAR* strDestPath, int cchDest, LPCWSTR strFilename )