mirror of
https://github.com/mii443/rust-openvr.git
synced 2025-08-22 16:25:36 +00:00
2098bcc25701a4ff6bf6e18565baec7b45b5371f
* Update to OpenVR 1.0.10 * Typo fix * Missing doc comment * Delete dead examples, cleanup * Delete dead code * Remove lifetimes from subsystems OpenVR must be shut down manually, which invalidates outstanding subsystem handles regardless of lifetimes, rendering the ergonomic sacrifice pointless. Future work: make shutdown safe by inserting checks before every OpenVR call. * Depend on our own openvr-sys * Update metadata * Update readme * More detailed safety notes * Depend on released openvr-sys
rust-openvr
A high-level binding for OpenVR 1.0.10.
High-level documentation can be found at the OpenVR wiki.
Using rust-openvr
Requirements
openvr-sys needs cmake and a C++ compiler so that it can compile and statically link the OpenVR client library.
Windows
Upstream OpenVR does not support MinGW. You must use an MSVC-targeted rust toolchain and C++ compiler.
Initializing
extern crate openvr;
fn main() {
// Initialize OpenVR
let context = unsafe { openvr::init(openvr::ApplicationType::Scene) }.unwrap();
// accessing subsystems
let system = context.system().unwrap();
// ..
}
Examples
See examples/test.rs for a more detailed example.
Description
Languages
Rust
100%