Returns where OpenVR runtime is installed. */
| 284 | |
| 285 | /** Returns where OpenVR runtime is installed. */ |
| 286 | bool VR_GetRuntimePath( char *pchPathBuffer, uint32_t unBufferSize, uint32_t *punRequiredBufferSize ) |
| 287 | { |
| 288 | // otherwise we need to do a bit more work |
| 289 | std::string sRuntimePath; |
| 290 | |
| 291 | *punRequiredBufferSize = 0; |
| 292 | |
| 293 | bool bReadPathRegistry = CVRPathRegistry_Public::GetPaths( &sRuntimePath, nullptr, nullptr, nullptr, nullptr ); |
| 294 | if ( !bReadPathRegistry ) |
| 295 | { |
| 296 | return false; |
| 297 | } |
| 298 | |
| 299 | // figure out where we're going to look for vrclient.dll |
| 300 | // see if the specified path actually exists. |
| 301 | if ( !Path_IsDirectory( sRuntimePath ) ) |
| 302 | { |
| 303 | return false; |
| 304 | } |
| 305 | |
| 306 | *punRequiredBufferSize = (uint32_t)sRuntimePath.size() + 1; |
| 307 | if ( sRuntimePath.size() >= unBufferSize ) |
| 308 | { |
| 309 | *pchPathBuffer = '\0'; |
| 310 | } |
| 311 | else |
| 312 | { |
| 313 | strcpy_safe( pchPathBuffer, unBufferSize, sRuntimePath.c_str() ); |
| 314 | } |
| 315 | |
| 316 | return true; |
| 317 | } |
| 318 | |
| 319 | |
| 320 | /** Returns the symbol version of an HMD error. */ |
no test coverage detected