refactor: initialize xdevs with xrt_device_init
This commit is contained in:
@@ -571,6 +571,8 @@ wivrn_controller::wivrn_controller(int hand_id,
|
||||
inputs_array(input_count, xrt_input{}),
|
||||
cnx(cnx)
|
||||
{
|
||||
xrt_device_init(static_cast<xrt_device *>(this));
|
||||
|
||||
inputs = inputs_array.data();
|
||||
|
||||
// Setup input.
|
||||
|
||||
@@ -57,6 +57,7 @@ wivrn_eye_tracker::wivrn_eye_tracker(xrt_device * hmd) :
|
||||
},
|
||||
gaze(device_id::EYE_GAZE)
|
||||
{
|
||||
xrt_device_init(static_cast<xrt_device *>(this));
|
||||
}
|
||||
|
||||
xrt_result_t wivrn_eye_tracker::update_inputs()
|
||||
|
||||
@@ -60,6 +60,7 @@ wivrn_fb_face2_tracker::wivrn_fb_face2_tracker(xrt_device * hmd,
|
||||
},
|
||||
cnx(cnx)
|
||||
{
|
||||
xrt_device_init(static_cast<xrt_device *>(this));
|
||||
}
|
||||
|
||||
xrt_result_t wivrn_fb_face2_tracker::update_inputs()
|
||||
|
||||
@@ -124,6 +124,8 @@ wivrn_generic_tracker::wivrn_generic_tracker(int index, xrt_device * hmd, wivrn_
|
||||
cnx(cnx),
|
||||
index(index)
|
||||
{
|
||||
xrt_device_init(static_cast<xrt_device *>(this));
|
||||
|
||||
auto unique_name = std::format("WiVRn Generic Tracker #{}", index + 1);
|
||||
strlcpy(str, unique_name.c_str(), std::size(str));
|
||||
auto unique_serial = std::format("wivrn-{}", index + 1);
|
||||
|
||||
@@ -240,6 +240,8 @@ wivrn_hand_interaction::wivrn_hand_interaction(int hand_id,
|
||||
inputs_array(input_count, xrt_input{}),
|
||||
cnx(cnx)
|
||||
{
|
||||
xrt_device_init(static_cast<xrt_device *>(this));
|
||||
|
||||
inputs = inputs_array.data();
|
||||
|
||||
// Setup input.
|
||||
|
||||
@@ -88,6 +88,8 @@ wivrn_hmd::wivrn_hmd(wivrn::wivrn_session * cnx,
|
||||
},
|
||||
cnx(cnx)
|
||||
{
|
||||
xrt_device_init(static_cast<xrt_device *>(this));
|
||||
|
||||
const auto config = configuration();
|
||||
|
||||
auto eye_width = info.recommended_eye_width;
|
||||
|
||||
@@ -66,6 +66,8 @@ wivrn_htc_face_tracker::wivrn_htc_face_tracker(xrt_device * hmd,
|
||||
},
|
||||
cnx(cnx)
|
||||
{
|
||||
xrt_device_init(static_cast<xrt_device *>(this));
|
||||
|
||||
inputs = inputs_array.data();
|
||||
input_count = inputs_array.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user