High-level, mostly-safe OpenXR bindings

17 releases (8 breaking)

✓ Uses Rust 2018 edition

new 0.9.4 Oct 9, 2019
0.8.1 Jul 30, 2019
0.3.2 Mar 24, 2019

#30 in Rendering

Download history 14/week @ 2019-05-17 9/week @ 2019-05-24 15/week @ 2019-05-31 36/week @ 2019-06-07 35/week @ 2019-06-14 81/week @ 2019-06-21 24/week @ 2019-06-28 68/week @ 2019-07-05 20/week @ 2019-07-12 11/week @ 2019-07-19 39/week @ 2019-07-26 72/week @ 2019-08-02 236/week @ 2019-08-09 348/week @ 2019-08-16 444/week @ 2019-08-23

1,010 downloads per month


23K SLoC

C++ 12K SLoC // 0.1% comments Rust 8K SLoC // 0.0% comments Python 1.5K SLoC // 0.3% comments Visual Studio Project 453 SLoC Scons 217 SLoC // 0.1% comments C 121 SLoC // 0.2% comments Shell 5 SLoC // 0.7% comments


Documentation Crates.io License: MIT License: Apache 2.0

Rust bindings for the OpenXR virtual/augmented reality runtime API. Refer to the specification for detailed documentation on individual API calls.


The high-level bindings provide abstractions focusing on ergonomics and safety. Escape hatches to the raw API are exposed to support unforeseen requirements, and patterns that cannot be efficiently exposed in safe terms are preserved as unsafe.

The crate exposes a number of cargo features:

  • static builds in the Khronos OpenXR loader, which can then be accessed with Entry::linked(). This is the easiest way to get going.
  • loaded allows access to a manually identified OpenXR implementation at run time. This allows for cases where a built-in Khronos loader, normally responsible for that task, cannot be used.
  • linked enables access to an OpenXR implementation linked in by the application. As opposed to static, this is useful when the target environment guarantees the presence of an OpenXR implementation or loader at a specific location, making a built-in loader redundant.
  • nalgebra exposes Into and From impls for converting to and from nalgebra types where appropriate.


The low-level bindings provide faithful unsafe access to the raw API, with ergonomics and type safety improved as much as feasible compared to a bindgen-style binding without reducing expressiveness. For example, symbols are named according to Rust conventions, enums and bitmasks are strongly typed, and many types have helpful Debug impls. This crate is almost entirely generated from the Khronos XML registry.