-
-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server_openvr): ✨ Defer TrackedDevices initialization #2754
base: master
Are you sure you want to change the base?
Conversation
c581a03
to
45477fb
Compare
45477fb
to
e06ab43
Compare
bd3855a
to
511a005
Compare
this->device_class, | ||
(vr::ITrackedDeviceServerDriver*)this | ||
)) { | ||
Error("Failed to register device"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could maybe use some additional information like the serial number, to aid in debugging
ptr, | ||
}; | ||
|
||
pub fn set_openvr_prop(device_id: u64, prop: OpenvrProperty) { | ||
pub fn set_openvr_prop(instance_ptr: Option<*mut c_void>, device_id: u64, prop: OpenvrProperty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the biggest fan of this api, since it behaves like an enum but isn't one, but it's fine if need be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean enum? Do you think we should just check for null pointer? (maybe we should)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use either a device id or a instance ptr, so an enum DeviceHandle { DeviceId, Pts }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that won't work because I use the device_id always, and only optionally instance_ptr
In this PR I make the following changes:
DriverProvider::Init()
toInitializeStreaming()
TrackedDevice::registrer_device()
now waits for theITrackedDeviceServerDriver::Activate()
call.g_driver_provider
until they are successfully activated. This requires changing the signature ofSetOpenvrProps()
andRegisterButtons()
to reference the devices by pointer instead of ID. Allow controllers and trackers to fail registration (we are already handling the absence of any of these devices)Notably, In this PR i'm not implementing the skip of the first SteamVR restart when the client first connects, this will be done in the next PRs.