Also note, you need to fix the openvr_capi.h to compile with GCC: __stdcall is not valid in GCC.
This is an alignment problem. sizeof(VRControllerState_t) is 64, when sizeof(vr::VRControllerState_t) is 60. There are 4 bytes missing between the two first fields.
openvr_capi.h needs the same #pragma pack(push, 4) that openvr.h has.
this is fixed in the current openvr SDK.
It's not fixed. On Linux 64 bit, the size of C struct is 64 and the size of C++ struct is 60 , and looking at the sources, we have https://github.com/ValveSoftware/openvr/blob/master/headers/openvr_capi.h#L1336 no pack pragma around it (padding of 4 after unPacketNum because the subsequent value is 8 byte sized) and https://github.com/ValveSoftware/openvr/blob/master/headers/openvr.h#L890 has pack 4 pragma around it, but only for linux and mac.
Can confirm, the C header is still missing pragma pack. I know GetControllerState() is deprecated, but still...
I believe this is fixed and will be out in the next SDK.
Nothing extracted yet.
Your system information
Please describe your issue in as much detail as possible:
GetControllerStatefromFnTable:IVRSystem_015(C API) always return with a zeroedVRControllerState_tstruct whenGetControllerStatefromIVRSystem_015returns with a correctVRControllerState_tstruct.This is a problem for ViveCraft for example that uses the C API through JOpenVR. No button on the controllers work.
Here is an example of program. When running, hold buttons. It should then show non zero values. But it is always 0.