ValveSoftware / openvr

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

DLL doesn't have most functions. #1431

Open cmumme opened 4 years ago

cmumme commented 4 years ago
Only 23 functions

I just downloaded the DLL from here and I ran into a Win32 127 error. (ERROR_PROC_NOT_FOUND) when calling VR_Init() and other functions. If anybody could link a 64 bit full version or provide a fix, that'd be awesome!

I'm using Node-ffi to call the functions, by the way, I tested it out with other dlls and it worked fine. It also works fine if I just call the functions that are in the dll. Here's my Node.JS code.

const ffi = require("ffi-napi")

const openvrAPI = ffi.Library("./dll/openvr/openvr_api.dll",{
  "VR_IsHmdPresent": [
    "bool", ["void"]
  ],
  "VR_Init": [
    "void", ["void"]
  ],
  "VR_Shutdown": [
    "void", ["void"]
  ]
})

function toCString(JSString) {
  return Buffer.from(`${JSString}\0`, "ucs2")
}
openvrAPI.VR_Init(null)
console.log(openvrAPI.VR_IsHmdPresent(null))
openvrAPI.VR_Shutdown(null)
Rectus commented 4 years ago

Looks like VR_Init and VR_Shutdown are defined directly in the API header file: https://github.com/ValveSoftware/openvr/blob/master/headers/openvr.h#L5485