OpenXR attach actions to session just once

This commit is contained in:
Lubos 2022-05-10 19:21:13 +02:00
parent 709c0abdcf
commit 314e8b0288

View file

@ -40,6 +40,7 @@ XrAction vibrateRightFeedback;
XrActionSet runningActionSet; XrActionSet runningActionSet;
XrSpace leftControllerAimSpace = XR_NULL_HANDLE; XrSpace leftControllerAimSpace = XR_NULL_HANDLE;
XrSpace rightControllerAimSpace = XR_NULL_HANDLE; XrSpace rightControllerAimSpace = XR_NULL_HANDLE;
qboolean actionsAttached = qfalse;
qboolean inputInitialized = qfalse; qboolean inputInitialized = qfalse;
qboolean useSimpleProfile = qfalse; qboolean useSimpleProfile = qfalse;
@ -1364,12 +1365,15 @@ void IN_VRSyncActions( void )
engine_t* engine = VR_GetEngine(); engine_t* engine = VR_GetEngine();
// Attach to session // Attach to session
XrSessionActionSetsAttachInfo attachInfo = {}; if (!actionsAttached) {
attachInfo.type = XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO; XrSessionActionSetsAttachInfo attachInfo = {};
attachInfo.next = NULL; attachInfo.type = XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO;
attachInfo.countActionSets = 1; attachInfo.next = NULL;
attachInfo.actionSets = &runningActionSet; attachInfo.countActionSets = 1;
OXR(xrAttachSessionActionSets(engine->appState.Session, &attachInfo)); attachInfo.actionSets = &runningActionSet;
OXR(xrAttachSessionActionSets(engine->appState.Session, &attachInfo));
actionsAttached = qtrue;
}
// sync action data // sync action data
XrActiveActionSet activeActionSet = {}; XrActiveActionSet activeActionSet = {};