staging some oculus helper code

This commit is contained in:
Wayne Chen 2018-12-19 10:18:18 -08:00
parent 1fc51445d0
commit c22ad2b15a
2 changed files with 13 additions and 0 deletions

View file

@ -174,6 +174,18 @@ ovrTrackingState ovr::getTrackingState(double absTime, ovrBool latencyMarker) {
return result;
}
QString ovr::getLoggedInUserID() {
ovr_GetLoggedInUserID();
ovrMessageHandle message = ovr_PopMessage();
if (!ovr_Message_IsError(message)) {
ovrUserHandle user = ovr_Message_GetUser(message);
qCDebug(oculusLog) << "User is: " << ovr_User_GetID(user) << ", " << ovr_User_GetOculusID(user);
} else {
auto error = ovr_Message_GetError(message);
qCDebug(oculusLog) << "User failure error: " << ovr_Error_GetMessage(error);
}
}
QString ovr::getError() {
static ovrErrorInfo error;
ovr_GetLastErrorInfo(&error);

View file

@ -29,6 +29,7 @@ struct ovr {
static ovrSessionStatus getStatus();
static ovrSessionStatus getStatus(ovrResult& result);
static ovrTrackingState getTrackingState(double absTime = 0.0, ovrBool latencyMarker = ovrFalse);
static QString getLoggedInUserID();
static QString getError();
static bool handleOVREvents();