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

Function ovr_GetInputState

Revive/REV_CAPI.cpp:524–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

GetInputStateMethod · 0.45

Tested by

no test coverage detected