ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.07k stars 1.28k forks source link

openvr_capi.h missing newer VREvent_Data_t fields #39

Open lukexi opened 8 years ago

lukexi commented 8 years ago

openvr_capi.h is missing 6 of the newer fields in VREvent_Data_t from openvr.h:

https://github.com/ValveSoftware/openvr/blob/master/headers/openvr_capi.h#L71

typedef union
{
    VREvent_Reserved_t reserved;
    VREvent_Controller_t controller;
    VREvent_Mouse_t mouse;
    VREvent_Process_t process;
} VREvent_Data_t;

Versus the version in openvr.h https://github.com/ValveSoftware/openvr/blob/master/headers/openvr.h#L509

typedef union
{
    VREvent_Reserved_t reserved;
    VREvent_Controller_t controller;
    VREvent_Mouse_t mouse;
    VREvent_Process_t process;
    VREvent_Notification_t notification;
    VREvent_Overlay_t overlay;
    VREvent_Status_t status;
    VREvent_Keyboard_t keyboard;
    VREvent_Ipd_t ipd;
    VREvent_Chaperone_t chaperone;
} VREvent_Data_t;

See also #31 — the VREvent_t type is missing entirely in openvr_capi.h

Thanks!

lukexi commented 8 years ago

Ah, and we're also missing the associated VREvent_Notification_t, VREvent_Overlay_t, VREvent_Status_t, VREvent_Keyboard_t, VREvent_Ipd_t and VREvent_Chaperone_t types.

ChristophHaag commented 6 years ago

In 2018 this is still an issue.

I was scratching my head why I was getting garbage data from the events until I compared:

https://github.com/ValveSoftware/openvr/blob/6aacebd1246592d9911439d5abd0c657b8948ab0/headers/openvr_capi.h#L1970-L1986

https://github.com/ValveSoftware/openvr/blob/6aacebd1246592d9911439d5abd0c657b8948ab0/headers/openvr.h#L1012-L1041

replacing the union in openvr_capi.h with the one in openvr.h makes events work. Thanks, lukexi for documenting this issue.

ChristophHaag commented 6 years ago

Unrelated to this issue but the actual fix for my issue was not the union, but if anyone else stumbles here: the pragma below that I also copied over in my test was the actual fix for my issue.

https://github.com/ValveSoftware/openvr/blob/6aacebd1246592d9911439d5abd0c657b8948ab0/headers/openvr.h#L1044-L1048