Skip to content

Commit 055337e

Browse files
schulzchRalith
authored andcommitted
Better instructions, version bump.
1 parent 45ff98e commit 055337e

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openvr_sys"
3-
version = "2.0.2"
3+
version = "2.0.3"
44
authors = [
55
"Colin Sherratt",
66
"Erick Tryzelaar",

README.md

+27-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
1-
To update, update the submodule then bindgen on wrapper.h
1+
# openvr-sys
22

3-
The following structs must be marked `#[cfg_attr(unix, repr(packed))]` to work around OpenVR's broken ABI on Linux/OSX:
4-
- `VRControllerState_t`
5-
- `RenderModel_TextureMap_t`
6-
- `RenderModel_t`
7-
- `VREvent_t`
3+
Contains function definitions for the [OpenVR](https://github.com/ValveSoftware/openvr) library. Use the `openvr` crate, unless you know what you are doing.
4+
5+
## Instructions for updating OpenVR
6+
7+
1. `git submodule update --init --recursive` (initial checkout only)
8+
1. `git submodule foreach git pull origin master` to update the submodule
9+
1. `cargo build --features "buildtime_bindgen"` to update the bindings
10+
1. Apply the workaround for broken OpenVR ABIs, if required
11+
12+
## Workaround for broken OpenVR ABIs (Linux/macOS only)
13+
14+
Search for packed structs in `headers/openvr.h`, i.e., `#pragma pack( push, 4 )`. Currently, that is:
15+
16+
```
17+
VRControllerState_t
18+
RenderModel_TextureMap_t
19+
RenderModel_t
20+
VREvent_t
21+
```
22+
23+
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:
24+
25+
```rust
26+
#[repr(C)]
27+
#[cfg_attr(unix, repr(packed(4)))]
28+
```

0 commit comments

Comments
 (0)