From 8b3e901c1085615e93d49b1392e08ea9c408a854 Mon Sep 17 00:00:00 2001 From: Shawn Wallace Date: Sat, 24 Aug 2024 23:09:38 -0400 Subject: [PATCH] Change Action::create_space to take a &Session Closes #130 --- openxr/examples/vulkan.rs | 4 ++-- openxr/src/action.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openxr/examples/vulkan.rs b/openxr/examples/vulkan.rs index e01c13b8..bb3206ab 100644 --- a/openxr/examples/vulkan.rs +++ b/openxr/examples/vulkan.rs @@ -382,10 +382,10 @@ pub fn main() { // Create an action space for each device we want to locate let right_space = right_action - .create_space(session.clone(), xr::Path::NULL, xr::Posef::IDENTITY) + .create_space(&session, xr::Path::NULL, xr::Posef::IDENTITY) .unwrap(); let left_space = left_action - .create_space(session.clone(), xr::Path::NULL, xr::Posef::IDENTITY) + .create_space(&session, xr::Path::NULL, xr::Posef::IDENTITY) .unwrap(); // OpenXR uses a couple different types of reference frames for positioning content; we need diff --git a/openxr/src/action.rs b/openxr/src/action.rs index 8699556e..91d56cdf 100644 --- a/openxr/src/action.rs +++ b/openxr/src/action.rs @@ -79,7 +79,7 @@ impl Action { /// Creates a `Space` relative to this action pub fn create_space( &self, - session: Session, + session: &Session, subaction_path: Path, pose_in_action_space: Posef, ) -> Result { @@ -97,7 +97,7 @@ impl Action { &info, &mut out, ))?; - Ok(Space::action_from_raw(self.clone(), session, out)) + Ok(Space::action_from_raw(self.clone(), session.clone(), out)) } }