d/steamvr_lh: Add vive and index bindings

This commit is contained in:
Christoph Haag 2024-01-10 13:53:59 +01:00
parent bd276ff437
commit ceae41a7bd
2 changed files with 17 additions and 1 deletions

View file

@ -83,7 +83,6 @@ protected:
private:
vr::ITrackedDeviceServerDriver *driver;
std::vector<xrt_binding_profile> binding_profiles_vec;
uint64_t current_frame{0};
std::mutex frame_mutex;

View file

@ -22,6 +22,7 @@
#include "interfaces/context.hpp"
#include "device.hpp"
#include "util/u_device.h"
#include "vive/vive_bindings.h"
namespace {
@ -212,6 +213,22 @@ Context::setup_controller(const char *serial, vr::ITrackedDeviceServerDriver *dr
CTX_ERR("Activating controller failed: error %u", err);
return false;
}
enum xrt_device_name name = controller[device_idx]->name;
switch (name) {
case XRT_DEVICE_VIVE_WAND:
controller[device_idx]->binding_profiles = vive_binding_profiles_wand;
controller[device_idx]->binding_profile_count = vive_binding_profiles_wand_count;
break;
break;
case XRT_DEVICE_INDEX_CONTROLLER:
controller[device_idx]->binding_profiles = vive_binding_profiles_index;
controller[device_idx]->binding_profile_count = vive_binding_profiles_index_count;
break;
default: break;
}
return true;
}