vr::EVRInitError CClientDriver_Leap::Init( vr::IDriverLog * pDriverLog, vr::IClientDriverHost * pDriverHost, const char * pchUserDriverConfigDir, const char * pchDriverInstallDir )
{
    InitDriverLog( pDriverLog );
    DriverLog("CClientDriver_Leap::Init()\n");
    m_pDriverHost = pDriverHost;
    return vr::VRInitError_None;
}
vr::EVRInitError CServerDriver_Leap::Init( vr::IDriverLog * pDriverLog, vr::IServerDriverHost * pDriverHost, const char * pchUserDriverConfigDir, const char * pchDriverInstallDir )
{
    InitDriverLog( pDriverLog );
    DriverLog("CServerDriver_Leap::Init()\n");

    m_pDriverHost = pDriverHost;
    m_strDriverInstallDir = pchDriverInstallDir;

    m_Controller = new Controller;

    Controller &controller = *m_Controller;

    m_Controller->addListener(*this);

    return vr::VRInitError_None;
}
예제 #3
0
vr::EVRInitError CServerDriver_Hydra::Init( vr::IDriverLog * pDriverLog, vr::IServerDriverHost * pDriverHost, const char * pchUserDriverConfigDir, const char * pchDriverInstallDir )
{
	InitDriverLog( pDriverLog );
	m_pDriverHost = pDriverHost;
	m_strDriverInstallDir = pchDriverInstallDir;

	if ( sixenseInit() != SIXENSE_SUCCESS )
		return vr::VRInitError_Driver_Failed;

	// Will not immediately detect controllers at this point.  Sixense driver must be initializing
	// in its own thread...  It's okay to dynamically detect devices later, but if controllers are
	// the only devices (e.g. requireHmd=false) we must have GetTrackedDeviceCount() != 0 before returning.
	for ( int i = 0; i < 20; ++i )
	{
		ScanForNewControllers( false );
		if ( GetTrackedDeviceCount() )
			break;
		Sleep( 100 );
	}

	m_Thread = std::thread( ThreadEntry, this );

	return vr::VRInitError_None;
}