Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to OpenXR 1.1.36 #158

Merged
merged 10 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Rust bindings for the OpenXR virtual/augmented reality runtime
API. Refer to [the
specification](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html)
specification](https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html)
for detailed documentation on individual API calls.

## `openxr`
Expand Down
263 changes: 161 additions & 102 deletions generator/src/main.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions openxr/examples/vulkan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub fn main() {
application_version: 0,
engine_name: "openxrs example",
engine_version: 0,
api_version: xr::Version::new(1, 0, 0),
},
&enabled_extensions,
&[],
Expand Down
14 changes: 7 additions & 7 deletions openxr/src/display_refresh_rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! The extension also includes a new event ([`Event::DisplayRefreshRateChangedFB`]) that gets
//! sent when the display refresh rate changes.
//!
//! [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_FB_display_refresh_rate
//! [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#XR_FB_display_refresh_rate
//! [`Event::DisplayRefreshRateChangedFB`]: crate::Event::DisplayRefreshRateChangedFB

use crate::{cvt, Session};
Expand All @@ -13,8 +13,8 @@ impl<G> Session<G> {
/// [Enumerates] the supported display refresh rates.
/// Requires [`XR_FB_display_refresh_rate`]
///
/// [Enumerates]: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrEnumerateDisplayRefreshRatesFB
/// [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_FB_display_refresh_rate
/// [Enumerates]: https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#xrEnumerateDisplayRefreshRatesFB
/// [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#XR_FB_display_refresh_rate
pub fn enumerate_display_refresh_rates(&self) -> Result<Vec<f32>> {
let ext = self
.inner
Expand All @@ -31,8 +31,8 @@ impl<G> Session<G> {
/// Retrieves the [current display refresh rate].
/// Requires [`XR_FB_display_refresh_rate`]
///
/// [current display refresh rate]: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrGetDisplayRefreshRateFB
/// [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_FB_display_refresh_rate
/// [current display refresh rate]: https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#xrGetDisplayRefreshRateFB
/// [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#XR_FB_display_refresh_rate
pub fn get_display_refresh_rate(&self) -> Result<f32> {
let ext = self
.inner
Expand All @@ -54,8 +54,8 @@ impl<G> Session<G> {
/// [Requests] a change to the `display_refresh_rate`.
/// Requires [`XR_FB_display_refresh_rate`]
///
/// [Requests]: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrRequestDisplayRefreshRateFB
/// [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_FB_display_refresh_rate
/// [Requests]: https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#xrRequestDisplayRefreshRateFB
/// [`XR_FB_display_refresh_rate`]: https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#XR_FB_display_refresh_rate
pub fn request_display_refresh_rate(&self, display_refresh_rate: f32) -> Result<()> {
let ext = self
.inner
Expand Down
19 changes: 16 additions & 3 deletions openxr/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Entry {
application_version: app_info.application_version,
engine_name: [0; sys::MAX_ENGINE_NAME_SIZE],
engine_version: app_info.engine_version,
api_version: CURRENT_API_VERSION,
api_version: app_info.api_version,
},
enabled_api_layer_count: layer_ptrs.len() as _,
enabled_api_layer_names: layer_ptrs.as_ptr(),
Expand Down Expand Up @@ -346,16 +346,29 @@ impl std::error::Error for LoadError {
}
}

#[derive(Debug, Copy, Clone, Default)]
#[derive(Debug, Copy, Clone)]
pub struct ApplicationInfo<'a> {
pub application_name: &'a str,
pub application_version: u32,
pub engine_name: &'a str,
pub engine_version: u32,
pub api_version: Version,
}

impl<'a> Default for ApplicationInfo<'a> {
fn default() -> Self {
Self {
application_name: Default::default(),
application_version: Default::default(),
engine_name: Default::default(),
engine_version: Default::default(),
api_version: Version::new(1, 0, 0),
}
}
}

#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "See [XrApiLayerProperties](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrApiLayerProperties)"]
#[doc = "See [XrApiLayerProperties](https://www.khronos.org/registry/OpenXR/specs/1.1/html/xrspec.html#XrApiLayerProperties)"]
pub struct ApiLayerProperties {
pub layer_name: String,
pub spec_version: Version,
Expand Down
Loading
Loading