コード例 #1
0
ファイル: OVR_Sensor2Impl.cpp プロジェクト: e1e8/max_oculus
bool Sensor2DeviceImpl::GetGyroOffsetReport(GyroOffsetReport* data)
{
    // direct call if we are already on the device manager thread
    if (GetCurrentThreadId() == GetManagerImpl()->GetThreadId())
    {
        return getGyroOffsetReport(data);
    }

    bool result;
	if (!GetManagerImpl()->GetThreadQueue()->
            PushCallAndWaitResult(this, &Sensor2DeviceImpl::getGyroOffsetReport, &result, data))
	{
		return false;
	}

	return result;
}
コード例 #2
0
ファイル: OVR_Sensor2Impl.cpp プロジェクト: e1e8/max_oculus
bool Sensor2DeviceImpl::GetAllTemperatureReports(Array<Array<TemperatureReport> >* data)
{
    // direct call if we are already on the device manager thread
    if (GetCurrentThreadId() == GetManagerImpl()->GetThreadId())
    {
        return getAllTemperatureReports(data);
    }

    bool result;
    if (!GetManagerImpl()->GetThreadQueue()->
        PushCallAndWaitResult(this, &Sensor2DeviceImpl::getAllTemperatureReports, &result, data))
    {
        return false;
    }

    return result;
}
コード例 #3
0
ファイル: OVR_Sensor2Impl.cpp プロジェクト: e1e8/max_oculus
bool Sensor2DeviceImpl::SetTemperatureReport(const TemperatureReport& data)
{
    // direct call if we are already on the device manager thread
    if (GetCurrentThreadId() == GetManagerImpl()->GetThreadId())
    {
        return setTemperatureReport(data);
    }

    bool result;
	if (!GetManagerImpl()->GetThreadQueue()->
            PushCallAndWaitResult(this, &Sensor2DeviceImpl::setTemperatureReport, &result, data))
	{
		return false;
	}

	return result;
}
コード例 #4
0
ファイル: OVR_Sensor2Impl.cpp プロジェクト: e1e8/max_oculus
bool Sensor2DeviceImpl::GetKeepAliveMuxReport(KeepAliveMuxReport* data)
{
	bool result;
	if (!GetManagerImpl()->GetThreadQueue()->
            PushCallAndWaitResult(this, &Sensor2DeviceImpl::getKeepAliveMuxReport, &result, data))
	{
		return false;
	}

	return result;
}
コード例 #5
0
ファイル: OVR_Sensor2Impl.cpp プロジェクト: e1e8/max_oculus
bool Sensor2DeviceImpl::SetUUIDReport(const UUIDReport& data)
{ 
	bool result;
	if (!GetManagerImpl()->GetThreadQueue()->
            PushCallAndWaitResult(this, &Sensor2DeviceImpl::setUUIDReport, &result, data))
	{
		return false;
	}

	return result;
}
コード例 #6
0
ファイル: OVR_Sensor2Impl.cpp プロジェクト: e1e8/max_oculus
bool Sensor2DeviceImpl::GetAllPositionCalibrationReports(Array<PositionCalibrationReport>* data)
{
    bool result;
    if (!GetManagerImpl()->GetThreadQueue()->
        PushCallAndWaitResult(this, &Sensor2DeviceImpl::getAllPositionCalibrationReports, &result, data))
    {
        return false;
    }

    return result;
}
コード例 #7
0
ファイル: OVR_Win32_HMDDevice.cpp プロジェクト: Enerccio/Jift
Profile* HMDDeviceCreateDesc::GetProfileAddRef() const
{
    // Create device may override profile name, so get it from there is possible.
    ProfileManager* profileManager = GetManagerImpl()->GetProfileManager();
    ProfileType     profileType    = GetProfileType();
    const char *    profileName    = pDevice ?
                        ((HMDDevice*)pDevice)->GetProfileName() :
                        profileManager->GetDefaultProfileName(profileType);
    
    return profileName ? 
        profileManager->LoadProfile(profileType, profileName) :
        profileManager->GetDeviceDefaultProfile(profileType);
}
コード例 #8
0
void DeviceCreateDesc::Release()
{
    while(1)
    {
        UInt32 handleCount = HandleCount;
        // HandleCount must obviously be >= 1, since we are releasing it.
        OVR_ASSERT(handleCount > 0);

        // {1 -> 0} transition may cause us to be destroyed, so require a lock.
        if (handleCount == 1)
        {       
            Ptr<DeviceManagerLock>  lockKeepAlive;
            Lock::Locker            deviceLockScope(GetLock());

            if (!HandleCount.CompareAndSet_NoSync(handleCount, 0))
                continue;
            
            OVR_ASSERT(pDevice == 0);

            // Destroy *this if the manager was destroyed already, or Enumerated
            // is false (device no longer available).           
            if (!GetManagerImpl() || !Enumerated)
            {
                lockKeepAlive = pLock;

                // Remove from manager list (only matters for !Enumerated).
                if (pNext)
                {
                    RemoveNode();
                    pNext = pPrev = 0;
                }

                delete this;
            }

            // Available DeviceCreateDesc may survive with { HandleCount == 0 },
            // in case it might be enumerated again later.
            break;
        }
        else if (HandleCount.CompareAndSet_NoSync(handleCount, handleCount-1))
        {
            break;
        }
    }
}