mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +02:00
add popping of messages for entitlement check
This commit is contained in:
parent
d0236af334
commit
ea3e5f702a
1 changed files with 19 additions and 1 deletions
|
@ -15,6 +15,9 @@
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QProcessEnvironment>
|
#include <QtCore/QProcessEnvironment>
|
||||||
|
|
||||||
|
#define OVRPL_DISABLED
|
||||||
|
#include <OVR_Platform.h>
|
||||||
|
|
||||||
#include <controllers/Input.h>
|
#include <controllers/Input.h>
|
||||||
#include <controllers/Pose.h>
|
#include <controllers/Pose.h>
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
|
@ -27,6 +30,7 @@ static ovrSession session { nullptr };
|
||||||
|
|
||||||
static bool _quitRequested { false };
|
static bool _quitRequested { false };
|
||||||
static bool _reorientRequested { false };
|
static bool _reorientRequested { false };
|
||||||
|
static bool _entitlementCheckFailed { false };
|
||||||
|
|
||||||
inline ovrErrorInfo getError() {
|
inline ovrErrorInfo getError() {
|
||||||
ovrErrorInfo error;
|
ovrErrorInfo error;
|
||||||
|
@ -125,6 +129,20 @@ void handleOVREvents() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pop messages to see if we got a return for an entitlement check
|
||||||
|
while ((message = ovr_PopMessage()) != nullptr) {
|
||||||
|
switch (ovr_Message_GetType(message)) {
|
||||||
|
case ovrMessage_Entitlement_GetIsViewerEntitled: {
|
||||||
|
if (!ovr_Message_IsError(message)) {
|
||||||
|
// this viewer is entitled, no need to flag anything
|
||||||
|
} else {
|
||||||
|
// we failed the entitlement check, set our flag so the app can stop
|
||||||
|
_entitlementCheckFailed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_quitRequested = status.ShouldQuit;
|
_quitRequested = status.ShouldQuit;
|
||||||
_reorientRequested = status.ShouldRecenter;
|
_reorientRequested = status.ShouldRecenter;
|
||||||
}
|
}
|
||||||
|
@ -217,4 +235,4 @@ controller::Pose ovrControllerPoseToHandPose(
|
||||||
pose.velocity = toGlm(handPose.LinearVelocity);
|
pose.velocity = toGlm(handPose.LinearVelocity);
|
||||||
pose.valid = true;
|
pose.valid = true;
|
||||||
return pose;
|
return pose;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue