#vr #vive #steamvr

sys openvr_sys

Raw unsafe system binding for openvr

9 releases (stable)

Uses old Rust 2015

2.0.3 Jun 29, 2019
2.0.2 Aug 25, 2018
2.0.1 Dec 22, 2017
2.0.0 Oct 8, 2017
0.1.2 May 11, 2016

#703 in Hardware support

Download history 35/week @ 2024-07-21 35/week @ 2024-07-28 32/week @ 2024-08-04 39/week @ 2024-08-11 20/week @ 2024-08-18 20/week @ 2024-08-25 22/week @ 2024-09-01 27/week @ 2024-09-08 36/week @ 2024-09-15 54/week @ 2024-09-22 39/week @ 2024-09-29 10/week @ 2024-10-06 23/week @ 2024-10-13 18/week @ 2024-10-20 25/week @ 2024-10-27 38/week @ 2024-11-03

104 downloads per month
Used in openvr

MIT license

1MB
25K SLoC

Rust 14K SLoC // 0.0% comments C++ 7K SLoC // 0.1% comments C# 4.5K SLoC // 0.0% comments

openvr-sys

Contains function definitions for the OpenVR library. Use the openvr crate, unless you know what you are doing.

Instructions for updating OpenVR

  1. git submodule update --init --recursive (initial checkout only)
  2. git submodule foreach git pull origin master to update the submodule
  3. cargo build --features "buildtime_bindgen" to update the bindings
  4. Apply the workaround for broken OpenVR ABIs, if required

Workaround for broken OpenVR ABIs (Linux/macOS only)

Search for packed structs in headers/openvr.h, i.e., #pragma pack( push, 4 ). Currently, that is:

VRControllerState_t
RenderModel_TextureMap_t
RenderModel_t
VREvent_t

Depending on what bindgen did parse, you have to replace a bunch of #[repr(C)] and #[repr(C, packed(4))] precending those structs in bindings.rs with:

#[repr(C)]
#[cfg_attr(unix, repr(packed(4)))]

No runtime deps

~0–1MB
~11K SLoC