Open newhouseb opened 8 years ago
For what it's worth, I went ahead and wrote a tool to do this myself, which appears to generate a working wrapper that adapts the C++ API to C.
Sample here: https://github.com/newhouseb/openvr-c/blob/master/test_binding.c
Is VR_Init(...)
the same as VR_InitInternal(...)
? VR_InitInternal(...)
appears to be at least exposed as a symbol from openvr_api.dll.
https://github.com/ValveSoftware/openvr/blob/master/headers/openvr_capi.h#L1450
I found a discussion explaining why they "meant to do this" https://steamcommunity.com/app/358720/discussions/0/405692758722144628/
can some one please provide a sample how to use the updated file? Am I expected to remove "#if 0" and use the header file? should we be using VR_InitInternal instead?
thanx I found your code, https://github.com/cmbruns/pyopenvr/blob/master/src/c_tests/test_init.c
@amroibrahim I have to give proper credit for unearthing that seemingly undocumented "FnTable:%s" trick to lukexi https://github.com/lukexi/openvr-hs/blob/master/cbits/openvr_capi_helper.c#L9
That trick, plus also following the logic implicit in the inline VR_Init() function implemented in the C++ header https://github.com/ValveSoftware/openvr/blob/master/headers/openvr.h#L3056 has allowed me to progress with my python bindings in pyopenvr. Of course, my bindings are not working flawlessly yet, so take my success with a grain of salt. But I believe the openvr.init() function, at least, is pretty much functioning as expected.
In the meantime, here is a fully ported to C hellovr_opengl sample: https://github.com/VsevolodGolovanov/openvr_c_dabbling
Thank you. Can confirm VR_InitInternal
does not return a VR_IVRSystem_FnTable
pointer. You must use ... = (VR_IVRSystem_FnTable*) VR_GetGenericInterface("FnTable:IVRSystem_022", &init_error);
, where IVRSystem_022
is the value of IVRSystem_Version
Looks like a fair bit of bit rot has occurred since 0.9.17 that has broken the C API. Can you guys re-run whatever tools you have that generate the C API header files?