Last active
November 29, 2016 21:58
-
-
Save MortimerGoro/7bb855938b7e4da9f6c35cc142182c66 to your computer and use it in GitHub Desktop.
VRServiceManager example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut vr = VRServiceManager::new(); | |
// Register default VRService implementations. | |
// Default VRServices are specified using cargo features. | |
vr.register_defaults(); | |
// Fallback to Mock Device if no real headset is found. | |
vr.register_mock(); | |
// Intialize all registered VR Services | |
vr.initialize_services(); | |
// Discover VR devices | |
let devices = vr.get_devices(); | |
// Select first available device | |
let device = devices.get(0).unwrap(); | |
// Interact with the device | |
let device_data = device.borrow().display_data(); | |
println!("VR Device data: {:?}", device_data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment