Now uses new sys binding

- refactored Struct_ and Enum_ prefixes from old bindgen version
- added error implementation for rendering system (was blocked by valve)
- started with camera implementation (has_camera done)
This commit is contained in:
Rene Eichhorn
2016-06-11 10:42:42 +02:00
parent bb0bb6e640
commit 4ebe423ee3
13 changed files with 150 additions and 75 deletions

26
examples/camera.rs Normal file
View File

@ -0,0 +1,26 @@
extern crate openvr;
pub fn main () {
// init vr system
let system = match openvr::init() {
Ok(ivr) => ivr,
Err(err) => {
println!("Failed to create IVRSystem subsystem {:?}", err);
return;
}
};
let camera = match openvr::subsystems::tracked_camera() {
Ok(ivr) => ivr,
Err(err) => {
println!("Failed to create IVRTrackedCamera subsystem {:?}", err);
return;
}
};
for device in system.tracked_devices(0.0).connected_iter() {
println!("Device found: {}", device.index);
println!("\t{:?}", device.device_class());
println!("\t{:?}", camera.has_camera(&device));
}
}