35 releases (18 breaking)

0.19.0 Jul 26, 2024
0.18.0 Feb 23, 2024
0.17.1 Oct 8, 2022
0.16.0 Feb 12, 2022
0.3.2 Mar 24, 2019

#5 in Rendering

Download history 2068/week @ 2024-08-19 3025/week @ 2024-08-26 2776/week @ 2024-09-02 2598/week @ 2024-09-09 1836/week @ 2024-09-16 2038/week @ 2024-09-23 2137/week @ 2024-09-30 3911/week @ 2024-10-07 2805/week @ 2024-10-14 3084/week @ 2024-10-21 2746/week @ 2024-10-28 2587/week @ 2024-11-04 2133/week @ 2024-11-11 2820/week @ 2024-11-18 2106/week @ 2024-11-25 2182/week @ 2024-12-02

9,449 downloads per month
Used in 6 crates (5 directly)

MIT/Apache

2MB
43K SLoC

Rust 26K SLoC // 0.0% comments C++ 15K SLoC // 0.1% comments Python 1K SLoC // 0.2% comments C 408 SLoC // 0.3% comments Visual Studio Project 278 SLoC PowerShell 98 SLoC // 0.2% comments AsciiDoc 95 SLoC // 0.0% comments Bazel 33 SLoC Perl 4 SLoC

OpenXRS

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.

openxr

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, provided your environment has a working C++ compiler and CMake installation.
  • 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 attempts to link to an OpenXR loader in the build environment. This is appropriate for target environments like desktop Linux which guarantee the presence of an OpenXR implementation or loader at a specific location, making a built-in loader redundant.
  • mint exposes From impls for converting to and from mint types where appropriate.

See openxr/examples/vulkan.rs for an example high-performance Vulkan rendering workflow.

openxr-sys

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.

Dependencies

~0–4.5MB