Skip to content

Instantly share code, notes, and snippets.

@MortimerGoro
Last active November 29, 2016 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MortimerGoro/7bb855938b7e4da9f6c35cc142182c66 to your computer and use it in GitHub Desktop.
Save MortimerGoro/7bb855938b7e4da9f6c35cc142182c66 to your computer and use it in GitHub Desktop.
VRServiceManager example
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