smallfly / ofxOpenVR

Implementation of Valve Software's OpenVR API.
MIT License
73 stars 38 forks source link

Device not detected? #9

Open mattfelsen opened 7 years ago

mattfelsen commented 7 years ago

Hi! I just tried out this addon today but I'm having some trouble. I'm using a nightly OF version, Windows 10, a GTX 1060, and an Oculus DK2.

I did run into this compile issue: 'cannot convert argument 1 from 'const char *' to 'LPCWSTR' in SharedLib_Load() in sharedlibtools_public.cpp, which I fixed by replacing LoadLibraryEx with LoadLibraryExA , though I'm curious that it doesn't look like it's been reported yet here.

After fixing that, I get this output when I run the app and the app window shows "System name" and "System S/N" but they're blank.

Unable to read VR Path Registry from C:\Users\hypersonic\AppData\Local\openvr\openvrpaths.vrpath
PoseCount:0 Controllers:0

It looks like the device may not be detected? I'm not sure how to test if it's the device, the API, the addon, etc. Do you know if the DK2 is even supported with OpenVR?

smallfly commented 7 years ago

Hi Matt,

I just recompiled the 'example-simple' project against the OF's master branch, and I do not have this issue. Did you find any specific information about that issue ? If yes, could you please share what you have found.

I have not tried the addon or OpenVR with the DK2 - I only have tried it with the Vive and the Oculus Rift (consumer version).

Cheers

mattfelsen commented 7 years ago

Weird that you don't run into it... I don't know too much about character encoding (ie unicode vs non-unicode string handling), especially around MS's implementation, and often run into compile errors with VS around mis-matching types where a function will receive a char* but wants something like WCHAR, LPCWCSTR, LPCTSTR, etc.

In this particular case, I saw that there's a an #ifdef UNICODE in that sharedlibtools file which determines whether the ansi or unicode functions are used for loading a shared lib. I couldn't find a #define UNICODE anywhere but think that it's set here, since either switching the function (like I mentioned in the original post), or changing the option from "Use Unicode Character Set" to "Use Multi-Byte Character Set" fixes the error:

vs-unicode

In any case, I don't think it matters aside from just fixing the compile error because the included OpenVR is actually a static lib, and a breakpoint I set at that function never gets triggered.

Is there any configuration or setup I need to do? I haven't installed any of the Oculus SDK bundles, anything from Valve/Steam, etc. I also don't have a folder at C:\Users\hypersonic\AppData\Local\openvr\, where apparently it's trying to load an openvrpaths.vrpath file, which doesn't exist.