// figure out where we're going to look for vrclient.dll // see if the specified path actually exists. if( !Path_IsDirectory( sRuntimePath ) )
{ return vr::VRInitError_Init_InstallationNotFound;
}
// Because we don't have a way to select debug vs. release yet we'll just // use debug if it's there #ifdefined( LINUX64 ) || defined( LINUXARM64 )
std::string sTestPath = Path_Join( sRuntimePath, "bin", PLATSUBDIR ); #else
std::string sTestPath = Path_Join( sRuntimePath, "bin" ); #endif if( !Path_IsDirectory( sTestPath ) )
{ return vr::VRInitError_Init_InstallationCorrupt;
}
// only look in the override void *pMod = SharedLib_Load( sDLLPath.c_str() ); // nothing more to do if we can't load the DLL if( !pMod )
{ return vr::VRInitError_Init_VRClientDLLNotFound;
}
if( g_pHmdSystem )
{ // if we're already initialized, just call through return g_pHmdSystem->BIsHmdPresent();
} else
{ // otherwise we need to do a bit more work
EVRInitError err = VR_LoadHmdSystemInternal(); if( err != VRInitError_None ) returnfalse;
/** Returns true if the OpenVR runtime is installed. */ bool VR_IsRuntimeInstalled()
{
std::lock_guard<std::recursive_mutex> lock( g_mutexSystem );
if( g_pHmdSystem )
{ // if we're already initialized, OpenVR is obviously installed returntrue;
} else
{ // otherwise we need to do a bit more work
std::string sRuntimePath, sConfigPath, sLogPath;
// figure out where we're going to look for vrclient.dll // see if the specified path actually exists. if( !Path_IsDirectory( sRuntimePath ) )
{ returnfalse;
}
// the installation may be corrupt in some way, but it certainly looks installed returntrue;
}
}
// ------------------------------------------------------------------------------- // Purpose: This is the old Runtime Path interface that is no longer exported in the // latest header. We still want to export it from the DLL, though, so updating // to a new DLL doesn't break old compiled code. This version was not thread // safe and could change the buffer pointer to by a previous result on a // subsequent call // -------------------------------------------------------------------------------
VR_EXPORT_INTERFACE constchar *VR_CALLTYPE VR_RuntimePath();
/** Returns where OpenVR runtime is installed. */ bool VR_GetRuntimePath( char *pchPathBuffer, uint32_t unBufferSize, uint32_t *punRequiredBufferSize )
{ // otherwise we need to do a bit more work
std::string sRuntimePath;
// figure out where we're going to look for vrclient.dll // see if the specified path actually exists. if ( !Path_IsDirectory( sRuntimePath ) )
{ returnfalse;
}
/** Returns the symbol version of an HMD error. */ constchar *VR_GetVRInitErrorAsSymbol( EVRInitError error )
{
std::lock_guard<std::recursive_mutex> lock( g_mutexSystem );
/** Returns the english string version of an HMD error. */ constchar *VR_GetVRInitErrorAsEnglishDescription( EVRInitError error )
{
std::lock_guard<std::recursive_mutex> lock( g_mutexSystem );
/** Returns the english string version of an HMD error. */ constchar *VR_GetStringForHmdError( EVRInitError error )
{ return VR_GetVRInitErrorAsEnglishDescription( error );
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.