MCPcopy Create free account
hub / github.com/LibreVR/Revive / ovr_GetInputState

Function ovr_GetInputState

ReviveXR/REV_CAPI.cpp:516–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514} ovrInputState2;
515
516OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetInputState(ovrSession session, ovrControllerType controllerType, ovrInputState* inputState)
517{
518 REV_TRACE(ovr_GetInputState);
519 MICROPROFILE_META_CPU("Controller Type", controllerType);
520
521 if (!session)
522 return ovrError_InvalidSession;
523
524 if (!inputState)
525 return ovrError_InvalidParameter;
526
527 ovrInputState state = { 0 };
528
529 ovrResult result = ovrSuccess;
530 if (session->Input && session->Session)
531 result = session->Input->GetInputState(session, controllerType, &state);
532
533 // We need to make sure we don't write outside of the bounds of the struct
534 // when the client expects a pre-1.7 version of LibOVR.
535 if (Runtime::Get().MinorVersion < 7)
536 memcpy(inputState, &state, sizeof(ovrInputState1));
537 else if (Runtime::Get().MinorVersion < 11)
538 memcpy(inputState, &state, sizeof(ovrInputState2));
539 else
540 memcpy(inputState, &state, sizeof(ovrInputState));
541
542 return result;
543}
544
545OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetConnectedControllerTypes(ovrSession session)
546{

Callers

nothing calls this directly

Calls 1

GetInputStateMethod · 0.45

Tested by

no test coverage detected