| 522 | } ovrInputState2; |
| 523 | |
| 524 | OVR_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 | |
| 549 | OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetConnectedControllerTypes(ovrSession session) |
| 550 | { |
nothing calls this directly
no test coverage detected